Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DISC] Defined proper boolean values #276

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[DISC] Defined boolean values
Defined boolean values in discovery message for cross platform discovery in HA and OH for binary_sensors.
  • Loading branch information
DigiH committed Dec 4, 2024
commit 939e03169ad40e77dd337de0868255d04e36c5c5
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