Fix issue where an MQTT device is removed linked to two config entries (#120430)

* Fix issue where an MQTT device is removed linked to two config entries

* Update homeassistant/components/mqtt/discovery.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/mqtt/debug_info.py

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Jan Bouwhuis 2024-06-26 09:14:33 +02:00 committed by GitHub
parent d3ceaef098
commit e567f8f3d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 5 deletions

View file

@ -138,7 +138,7 @@ def remove_trigger_discovery_data(
hass: HomeAssistant, discovery_hash: tuple[str, str]
) -> None:
"""Remove discovery data."""
del hass.data[DATA_MQTT].debug_info_triggers[discovery_hash]
hass.data[DATA_MQTT].debug_info_triggers.pop(discovery_hash, None)
def _info_for_entity(hass: HomeAssistant, entity_id: str) -> dict[str, Any]: