Pop key when discovery is removed, fix typo

This commit is contained in:
jbouwh
2026-04-16 17:11:59 +00:00
parent 35b2b0d0c5
commit e7743f3ea3
2 changed files with 3 additions and 3 deletions

View File

@@ -574,8 +574,8 @@ async def async_start( # noqa: C901
else:
if (
(
entity_hash := mqtt_data.discovery_discovered_and_disabled.get(
discovery_hash
entity_hash := mqtt_data.discovery_discovered_and_disabled.pop(
discovery_hash, None
)
)
and (entity_registry := er.async_get(hass))

View File

@@ -578,7 +578,7 @@ async def test_registry_enable_not_enabled_by_default_entity(
assert device_registry.async_get(device_id) is not None
# Remove the entity and device
# At this stage no entry existsed during the initization
# At this stage no entry existed during the initialization
async_fire_mqtt_message(hass, discovery_topic, "")
await hass.async_block_till_done(wait_background_tasks=True)
entry = entity_registry.async_get("sensor.test")