Fix unnecessary hass.components interaction (#23029)
* Fix wemo * Fix bloomsky * Fix netatmo * Fix one more reference
This commit is contained in:
1 parent
57f17707c6
commit
c94b031db1
11 files changed
+41
-33
No files matched your search
@@ -8,7 +8,9 @@ from homeassistant.const import (TEMP_FAHRENHEIT, CONF_MONITORED_CONDITIONS)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
from . import BLOOMSKY
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DEPENDENCIES = ['bloomsky']
|
||||
|
||||
@@ -38,14 +40,13 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
"""Set up the available BloomSky weather sensors."""
|
||||
bloomsky = hass.components.bloomsky
|
||||
# Default needed in case of discovery
|
||||
sensors = config.get(CONF_MONITORED_CONDITIONS, SENSOR_TYPES)
|
||||
|
||||
for device in bloomsky.BLOOMSKY.devices.values():
|
||||
for device in BLOOMSKY.devices.values():
|
||||
for variable in sensors:
|
||||
add_entities(
|
||||
[BloomSkySensor(bloomsky.BLOOMSKY, device, variable)], True)
|
||||
[BloomSkySensor(BLOOMSKY, device, variable)], True)
|
||||
|
||||
|
||||
class BloomSkySensor(Entity):
|
||||
|
||||
Reference in new issue
Block a user