Bridge¶
Bridge Class to host multiple HAP Accessories.
-
class
pyhap.accessory.
Bridge
(driver, display_name, iid_manager=None)[source]¶ A representation of a HAP bridge.
A Bridge can have multiple Accessories.
-
add_accessory
(acc)[source]¶ Add the given
Accessory
to thisBridge
.Every
Accessory
in aBridge
must have an AID and this AID must be unique among all theAccessories
in the same Bridge. If the givenAccessory
’s AID is None, a unique AID will be assigned to it. Otherwise, it will be verified that the AID is not the standalone aid (STANDALONE_AID
) and that there is no otherAccessory
already in thisBridge
with that AID.Note
A
Bridge
cannot be added to anotherBridge
.Parameters: acc (Accessory) – The Accessory
to be bridged.Raises: ValueError – When the given Accessory
is of categoryCATEGORY_BRIDGE
or if the AID of theAccessory
clashes with anotherAccessory
already in thisBridge
.
-