public void addAccessory ( HomekitAccessory accessory ) { if ( accessory . getId ( ) <= 1 && ! ( accessory instanceof Bridge ) ) { throw new IndexOutOfBoundsException ( "The ID of an accessory used in a bridge must be greater than 1" ) ; } addAccessorySkipRangeCheck ( accessory ) ; }
Add an accessory to be handled and advertised by this root . Any existing Homekit connections will be terminated to allow the clients to reconnect and see the updated accessory list . When using this for a bridge the ID of the accessory must be greater than 1 as that ID is reserved for the Bridge itself .