Skip to content

Commit

Permalink
[DISC] Defined boolean values (#276)
Browse files Browse the repository at this point in the history
Defined boolean values in discovery message for cross platform discovery in HA and OH for binary_sensors.
  • Loading branch information
DigiH authored Dec 4, 2024
1 parent 95940d9 commit 35f2df1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TheengsGateway/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def publish_device_info(self, pub_device) -> None: # noqa: ANN001
entity_type = "sensor"

for k in data:
device = {}
device: DataJSONType = {}
device["stat_t"] = state_topic
# device_tracker discovery
self.publish_device_tracker(
Expand All @@ -173,8 +173,8 @@ def publish_device_info(self, pub_device) -> None: # noqa: ANN001
entity_type = "sensor"
elif pub_device["properties"][k]["unit"] == "status":
entity_type = "binary_sensor"
device["pl_on"] = "True"
device["pl_off"] = "False"
device["pl_on"] = True
device["pl_off"] = False
device["name"] = pub_device["model_id"] + "-" + k
device["uniq_id"] = pub_device_uuid + "-" + k
if k == "unlocked":
Expand Down

0 comments on commit 35f2df1

Please sign in to comment.