Beispiel #1
0
 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)
Beispiel #3
0
 def test_init(self):
     acc = accessory.Accessory("Test Accessory")
Beispiel #4
0
 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)
Beispiel #5
0
 def test_add_accessory(self):
     bridge = accessory.Bridge("Test Bridge")
     acc = accessory.Accessory("Test Accessory", aid=2)
     bridge.add_accessory(acc)
 def test_publish_no_broker(self):
     acc = accessory.Accessory("Test Accessory")
     service = loader.get_serv_loader().get("TemperatureSensor")
     char = service.get_characteristic("CurrentTemperature")
     acc.add_service(service)
     char.set_value(25, should_notify=True)