From 35f2df16d9eb5e6ca3796e63abf746aae65a822f Mon Sep 17 00:00:00 2001 From: DigiH Date: Wed, 4 Dec 2024 14:50:16 +0100 Subject: [PATCH] [DISC] Defined boolean values (#276) Defined boolean values in discovery message for cross platform discovery in HA and OH for binary_sensors. --- TheengsGateway/discovery.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TheengsGateway/discovery.py b/TheengsGateway/discovery.py index 7bbc0b7..ab6c014 100644 --- a/TheengsGateway/discovery.py +++ b/TheengsGateway/discovery.py @@ -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( @@ -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":