def test_get_property(self, mydevolo): device = Zwave(mydevolo_instance=mydevolo, **self.devices['mains']['properties']) device.binary_switch_property = {} element_uid = f"devolo.BinarySwitch:{self.devices['mains']['uid']}" device.binary_switch_property[element_uid] = BinarySwitchProperty( element_uid=element_uid, setter=lambda uid, state: None, state=self.devices['mains']['properties']['state'], enabled=self.devices['mains']['properties']['guiEnabled']) assert isinstance( device.get_property("binary_switch")[0], BinarySwitchProperty)
def test_get_property(self, mydevolo): device = Zwave(mydevolo_instance=mydevolo, **self.devices['mains']['properties']) gateway = MockGateway(self.gateway['id'], mydevolo=mydevolo) session = requests.Session() device.binary_switch_property = {} element_uid = f"devolo.BinarySwitch:{self.devices['mains']['uid']}" device.binary_switch_property[element_uid] = \ BinarySwitchProperty(gateway=gateway, session=session, mydevolo=mydevolo, element_uid=element_uid, state=self.devices['mains']['properties']['state'], enabled=self.devices['mains']['properties']['guiEnabled']) assert isinstance( device.get_property("binary_switch")[0], BinarySwitchProperty)
def test_get_property_invalid(self, mydevolo): device = Zwave(mydevolo_instance=mydevolo, **self.devices['mains']['properties']) with pytest.raises(AttributeError): device.get_property("binary_switch")