diff options
| author | jwansek <eddie.atten.ea29@gmail.com> | 2025-10-04 18:32:10 +0100 | 
|---|---|---|
| committer | jwansek <eddie.atten.ea29@gmail.com> | 2025-10-04 18:32:10 +0100 | 
| commit | 7143ff0243487745868f41fcd0d97cfe2d9c5771 (patch) | |
| tree | 149b2b65ab487f4569b7364bd403eaceb3d6964d | |
| parent | cb8810825fb119dd8f07fe491c38991d5e438c80 (diff) | |
| download | power.eda.gay-7143ff0243487745868f41fcd0d97cfe2d9c5771.tar.gz power.eda.gay-7143ff0243487745868f41fcd0d97cfe2d9c5771.zip | |
| -rw-r--r-- | mqtt-client/mqtt-client.py | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/mqtt-client/mqtt-client.py b/mqtt-client/mqtt-client.py index 37ed8cb..d4279e9 100644 --- a/mqtt-client/mqtt-client.py +++ b/mqtt-client/mqtt-client.py @@ -88,13 +88,13 @@ class MQTTClient:              self.tasmota_power_prom.labels(plug = location, field = k).set(v)      def handle_zigbee(self, msg_j): -        def toggle_geoffery(): +        def toggle_firestick():              print("Starting thread...") -            tasmotaMQTTClient.MQTTClient(MQTT_HOST, "TasmotaGeoffery", os.environ["MQTT_USER"], os.environ["MQTT_PASSWD"], "OFF") -            print("Waiting...") -            time.sleep(8) -            tasmotaMQTTClient.MQTTClient(MQTT_HOST, "TasmotaGeoffery", os.environ["MQTT_USER"], os.environ["MQTT_PASSWD"], "ON") -            print("Toggled again.") +            tasmotaMQTTClient.MQTTClient(MQTT_HOST, "TasmotaFirestick", os.environ["MQTT_USER"], os.environ["MQTT_PASSWD"], "TOGGLE") +            #print("Waiting...") +            #time.sleep(8) +            #tasmotaMQTTClient.MQTTClient(MQTT_HOST, "TasmotaFirestick", os.environ["MQTT_USER"], os.environ["MQTT_PASSWD"], "ON") +            print("Toggled firestick.")          zigbee_id = list(msg_j["ZbReceived"].keys())[0]          fields = msg_j["ZbReceived"][zigbee_id] @@ -106,7 +106,7 @@ class MQTTClient:              if fields["Power"] == 2:                  print("TV Zigbee button pressed, toggling TasmotaTV Tasmota Plug")                  self.toggle_plug("TasmotaTV") -                threading.Thread(target = toggle_geoffery, args = ()).start() +                threading.Thread(target = toggle_firestick, args = ()).start()                  #loop = asyncio.get_event_loop()                  #loop.run_until_complete(tasmotaHTTPClient.main(host = "geoffery.plug", username = "admin", password = os.environ["MQTT_PASSWD"], toggle = True))                  #time.sleep(8) | 
