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 this Bridge.

Every Accessory in a Bridge must have an AID and this AID must be unique among all the Accessories in the same Bridge. If the given Accessory’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 other Accessory already in this Bridge with that AID.

Note

A Bridge cannot be added to another Bridge.

Parameters:acc (Accessory) – The Accessory to be bridged.
Raises:ValueError – When the given Accessory is of category CATEGORY_BRIDGE or if the AID of the Accessory clashes with another Accessory already in this Bridge.
get_characteristic(aid, iid)[source]

See also

Accessory.to_HAP

run()[source]

Schedule tasks for each of the accessories’ run method.

stop()[source]

Calls stop() on all contained accessories.

to_HAP()[source]

Returns a HAP representation of itself and all contained accessories.

See also

Accessory.to_HAP