Clear ALREADY_DISCOVERED list with helper
parent
44c619a853
commit
ddeb7f3bea
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue