1
0
mirror of synced 2026-03-09 20:13:40 +00:00

fix: fix doorbell entity name when device is called 'Doorbell'

This commit is contained in:
Daniel Chesterton
2021-12-31 03:20:34 +00:00
parent cfa7b00135
commit bd18f74507

View File

@@ -262,6 +262,8 @@ if home_assistant:
}
if is_doorbell:
doorbell_name = "Doorbell" if device_name == "Doorbell" else f"{device_name} Doorbell"
mqtt_publish(topics["home_assistant_legacy"]["doorbell"], "")
mqtt_publish(
topics["home_assistant"]["doorbell"],
@@ -271,7 +273,7 @@ if home_assistant:
"payload_on": "on",
"payload_off": "off",
"icon": "mdi:doorbell",
"name": f"{device_name} Doorbell",
"name": doorbell_name,
"unique_id": f"{serial_number}.doorbell",
},
json=True,