Set Power to Zero if Switched Off

Set power to Zero if the actor is switched off.
This commit is contained in:
chappo 2022-06-07 13:35:06 +08:00 committed by GitHub
parent 58175bf951
commit 55db17e4fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,6 +32,6 @@ class GenericMqttActor(MQTTActor):
self.state = True
async def off(self):
formatted_payload = self.payload.format(switch_onoff = "off", switch_10 = 0, power = self.power)
formatted_payload = self.payload.format(switch_onoff = "off", switch_10 = 0, power = 0)
await self.publish_mqtt_message(self.topic, formatted_payload)
self.state = False
self.state = False