Fix BloomSky KeyError: 'monitored_conditions' (#34613)

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Franck Nijhof 2020-04-24 01:00:57 +02:00 committed by GitHub
parent 637ff5698c
commit 5b7a4434c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -25,6 +25,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the available BloomSky weather binary sensors."""
# Default needed in case of discovery
if discovery_info is not None:
return
sensors = config[CONF_MONITORED_CONDITIONS]
bloomsky = hass.data[DOMAIN]

View File

@ -10,6 +10,9 @@ from . import DOMAIN
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up access to BloomSky cameras."""
if discovery_info is not None:
return
bloomsky = hass.data[DOMAIN]
for device in bloomsky.devices.values():

View File

@ -60,6 +60,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the available BloomSky weather sensors."""
# Default needed in case of discovery
if discovery_info is not None:
return
sensors = config[CONF_MONITORED_CONDITIONS]
bloomsky = hass.data[DOMAIN]