Skip to content
This repository has been archived by the owner on Apr 30, 2022. It is now read-only.

Commit

Permalink
subscribe to HILD and DCAD topics
Browse files Browse the repository at this point in the history
  • Loading branch information
unlobito committed May 17, 2021
1 parent 68d34e7 commit db42193
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion custom_components/hildebrandglow/glow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Glow:
BASE_URL = "https://api.glowmarkt.com/api/v0-1"
HILDEBRAND_MQTT_HOST = "glowmqtt.energyhive.com"
HILDEBRAND_MQTT_TOPIC = "SMART/HILD/{hardwareId}"
HILDEBRAND_MQTT_LEGACY = "SMART/DCAD/{hardwareId}"

username: str
password: str
Expand Down Expand Up @@ -101,7 +102,15 @@ def connect_mqtt(self) -> None:

def _cb_on_connect(self, client, userdata, flags, rc):
"""Receive a CONNACK message from the server."""
client.subscribe(self.HILDEBRAND_MQTT_TOPIC.format(hardwareId=self.hardwareId))
client.subscribe(
[
(self.HILDEBRAND_MQTT_TOPIC.format(hardwareId=self.hardwareId), 0),
(
self.HILDEBRAND_MQTT_LEGACY.format(hardwareId=self.hardwareId),
0,
),
]
)

self.broker_active = True

Expand Down

0 comments on commit db42193

Please sign in to comment.