Clear ALREADY_DISCOVERED list with helper

This commit is contained in:
emontnemery authored and Erik committed 2019-01-07 17:00:03 +01:00
1 parent 44c619a853
commit ddeb7f3bea
1 file changed
+2 -2
@@ -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(