From ddeb7f3beadd354ba1c4075de1d888decc6a0b33 Mon Sep 17 00:00:00 2001 From: emontnemery Date: Sat, 5 Jan 2019 13:43:37 +0100 Subject: [PATCH] Clear ALREADY_DISCOVERED list with helper --- homeassistant/components/binary_sensor/mqtt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/binary_sensor/mqtt.py b/homeassistant/components/binary_sensor/mqtt.py index 34db8b2f3fb..f42feec6838 100644 --- a/homeassistant/components/binary_sensor/mqtt.py +++ b/homeassistant/components/binary_sensor/mqtt.py @@ -21,7 +21,7 @@ from homeassistant.components.mqtt import ( MqttAttributes, MqttAvailability, MqttDiscoveryUpdate, MqttEntityDeviceInfo, subscription) from homeassistant.components.mqtt.discovery import ( - ALREADY_DISCOVERED, MQTT_DISCOVERY_NEW) + MQTT_DISCOVERY_NEW, clear_discovery_hash) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.dispatcher import async_dispatcher_connect import homeassistant.helpers.event as evt @@ -71,7 +71,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): discovery_hash) except Exception: if discovery_hash: - del hass.data[ALREADY_DISCOVERED][discovery_hash] + clear_discovery_hash(hass, discovery_hash) raise async_dispatcher_connect(