Skip to content

Commit 20a8baa

Browse files
authored
Merge pull request #377 from Troon/main
Updates HA auto-discovery config, fixes #376
2 parents ad6bed9 + 28def25 commit 20a8baa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/integrations/home_assistant/discovery.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,7 @@ def __publish_remote_ac(self) -> None:
808808
def __get_common_attributes(
809809
self,
810810
unique_id: str,
811+
domain: str,
811812
name: str,
812813
custom_availability: HaCustomAvailabilityConfig | None = None,
813814
) -> dict[str, Any]:
@@ -816,6 +817,7 @@ def __get_common_attributes(
816817
"device": self.__get_device_node(),
817818
"unique_id": unique_id,
818819
"object_id": unique_id,
820+
"default_entity_id": f"{domain}.{unique_id}",
819821
}
820822

821823
if custom_availability is not None:
@@ -883,7 +885,7 @@ def _publish_ha_discovery_message(
883885
vin = self.vin
884886
unique_id = f"{vin}_{snake_case(sensor_name)}"
885887
final_payload = (
886-
self.__get_common_attributes(unique_id, sensor_name, custom_availability)
888+
self.__get_common_attributes(unique_id, sensor_type, sensor_name, custom_availability)
887889
| payload
888890
)
889891
ha_topic = (

0 commit comments

Comments
 (0)