def test_n_add_accessory_dup_aid(self): bridge = accessory.Bridge("Test Bridge") acc_1 = accessory.Accessory("Test Accessory 1", aid=2) acc_2 = accessory.Accessory("Test Accessory 2", aid=acc_1.aid) bridge.add_accessory(acc_1) with pytest.raises(ValueError): bridge.add_accessory(acc_2)
def test_add_accessory(self): bridge = accessory.Bridge("Test Bridge") acc = accessory.Accessory("Test Accessory", aid=2) bridge.add_accessory(acc) acc2 = accessory.Accessory("Test Accessory 2") bridge.add_accessory(acc2) assert (acc2.aid != accessory.STANDALONE_AID and acc2.aid != acc.aid)
def __init__(self, sensor): super().__init__() self.__logger = logging.getLogger(self.__class__.__name__) bridge = hap_accessory.Bridge(self, 'RadioAlarmClock') bridge.set_info_service(firmware_revision='1.0.0', manufacturer='Anubi', model='rpi-zw', serial_number=self.__get_pi_serial()) bridge.add_accessory(HapBME280(self, sensor)) self.add_accessory(bridge)
def test_n_add_accessory_bridge_aid(self): bridge = accessory.Bridge("Test Bridge") acc = accessory.Accessory("Test Accessory", aid=accessory.STANDALONE_AID) with pytest.raises(ValueError): bridge.add_accessory(acc)
def test_add_accessory(self): bridge = accessory.Bridge("Test Bridge") acc = accessory.Accessory("Test Accessory", aid=2) bridge.add_accessory(acc)
def test_init(self): bridge = accessory.Bridge("Test Bridge")