Skip to content

Commit

Permalink
Expose numeric ids for MQTT definitions
Browse files Browse the repository at this point in the history
This allows matching zones (which expose a numeric "partition" value) to the corresponding partition.
  • Loading branch information
lpaolini authored Apr 17, 2024
1 parent ac83cd0 commit 8d59dfa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions paradox/interfaces/mqtt/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,16 @@ def _on_ready(self):
if i not in labels:
continue

for attribute in definitions[i]: # attribute
definition = {**(definitions[i]), "id": i}
for attribute in definition: # attribute
if element_type == "user" and attribute == "code":
continue
self._publish(
f"{cfg.MQTT_BASE_TOPIC}/{cfg.MQTT_DEFINITION_TOPIC}",
element_type,
labels[i]["key"],
attribute,
definitions[i][attribute],
definition[attribute],
)

if (
Expand Down

0 comments on commit 8d59dfa

Please sign in to comment.