Use list literal without using dict.keys() (#42573)

This commit is contained in:
springstan 2020-10-30 15:19:13 +01:00 committed by GitHub
parent 2dc5c4dd69
commit 92379ad8d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 27 additions and 27 deletions

View file

@ -40,7 +40,7 @@ def _check_sensor_schema(conf):
except (ImportError, AttributeError):
return conf
customs = list(conf[CONF_CUSTOM].keys())
customs = list(conf[CONF_CUSTOM])
for sensor in conf[CONF_SENSORS]:
if sensor in customs:
@ -120,7 +120,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
if isinstance(config_sensors, list):
if not config_sensors: # Use all sensors by default
config_sensors = [s.name for s in sensor_def]
used_sensors = list(set(config_sensors + list(config[CONF_CUSTOM].keys())))
used_sensors = list(set(config_sensors + list(config[CONF_CUSTOM])))
for sensor in used_sensors:
hass_sensors.append(SMAsensor(sensor_def[sensor], []))