Fix Canary KeyError: 'ffmpeg_arguments' (#35158)

This commit is contained in:
Franck Nijhof 2020-05-04 10:35:40 +02:00 committed by GitHub
parent 7284f4e7ca
commit 96a998ad25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -24,10 +24,7 @@ _LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Canary alarms."""
data = hass.data[DATA_CANARY]
devices = []
for location in data.locations:
devices.append(CanaryAlarm(data, location.location_id))
devices = [CanaryAlarm(data, location.location_id) for location in data.locations]
add_entities(devices, True)

View File

@ -29,6 +29,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Canary sensors."""
if discovery_info is not None:
return
data = hass.data[DATA_CANARY]
devices = []