Revert host to name in mqtt topic

This commit is contained in:
saveriol
2024-09-16 14:33:41 +02:00
committed by GitHub
parent 3f203639df
commit f9f8894365

View File

@@ -163,8 +163,7 @@ def augment_device_features(features):
def publish_ha_discovery(device, client, mqtt_topic):
print(f"{now()} Publishing HA discovery for {device}")
device_ident = device["host"]
device_name = device["name"]
device_ident = device["name"]
device_description = device.get("description", {})
version_parts = filter(
@@ -174,7 +173,7 @@ def publish_ha_discovery(device, client, mqtt_topic):
device_info = {
"identifiers": [device_ident],
"name": device_name,
"name": device_ident,
"manufacturer": device_description.get("brand"),
"model": device_description.get("model"),
"sw_version": ".".join(version_parts),