mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-03 12:14:18 +01:00
Merge pull request #52 from chappo/master
Set MQTT Actor Power Level to Zero if Switched Off
This commit is contained in:
commit
459c4207fe
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -39,7 +39,7 @@ class MQTTActor(CBPiActor):
|
|||
async def off(self):
|
||||
self.state = False
|
||||
await self.cbpi.satellite.publish(self.topic, json.dumps(
|
||||
{"state": "off", "power": self.power}), True)
|
||||
{"state": "off", "power": 0}), True)
|
||||
pass
|
||||
|
||||
async def run(self):
|
||||
|
@ -56,4 +56,4 @@ class MQTTActor(CBPiActor):
|
|||
else:
|
||||
await self.off()
|
||||
await self.cbpi.actor.actor_update(self.id,power)
|
||||
pass
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue