Clear ALREADY_DISCOVERED list with helper

pull/19744/head
emontnemery 2019-01-05 13:43:37 +01:00 committed by Erik
parent 44c619a853
commit ddeb7f3bea
1 changed files with 2 additions and 2 deletions

View File

@ -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(