mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Extract 'modules' as a constant
This commit is contained in:
parent
0c2fe4c5f3
commit
dc31ddbef2
@ -31,6 +31,7 @@ SENSOR_TYPES = {
|
||||
}
|
||||
|
||||
CONF_SECRET_KEY = 'secret_key'
|
||||
ATTR_MODULE = 'modules'
|
||||
|
||||
# Return cached results if last scan was less then this time ago
|
||||
# NetAtmo Data is uploaded to server every 10mn
|
||||
@ -67,7 +68,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
dev = []
|
||||
try:
|
||||
# Iterate each module
|
||||
for module_name, monitored_conditions in config['modules'].items():
|
||||
for module_name, monitored_conditions in config[ATTR_MODULE].items():
|
||||
# Test if module exist """
|
||||
if module_name not in data.get_module_names():
|
||||
_LOGGER.error('Module name: "%s" not found', module_name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user