-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
In some scenarios, such as switching lights on and off, we need to do something extra to synchronize the state with the device after updating the properties, but webthing-python doesn't seem to implement this feature, I add this in aiowebthing, property:
async def property_action(self, property_):
"""
Additional action when a property change.
property_ -- the property that changed
"""
passclass Z2mThing(Thing):
async def property_action(self, property_):
if property_.name == "state":
value = "ON" if await property_.get_value() else "OFF"
else:
value = await property_.get_value()
await mqtt.publish(f"zigbee2mqtt/{self.id}/set", {property_.name: value})Metadata
Metadata
Assignees
Labels
No labels