mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-10 01:17:42 +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
|
self.state = True
|
||||||
|
|
||||||
async def off(self):
|
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)
|
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):
|
async def off(self):
|
||||||
self.state = False
|
self.state = False
|
||||||
await self.cbpi.satellite.publish(self.topic, json.dumps(
|
await self.cbpi.satellite.publish(self.topic, json.dumps(
|
||||||
{"state": "off", "power": self.power}), True)
|
{"state": "off", "power": 0}), True)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
|
|
Loading…
Reference in a new issue