This commit is contained in:
Johann Kellerman 2019-08-28 09:21:21 +02:00 committed by GitHub
parent 3c07a9b4c7
commit a28e644def
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,7 +143,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
hass_sensors.append(SMAsensor(sensor_def[name], sub_sensors))
used_sensors.append(name)
used_sensors.extend(attr)
used_sensors = [sensor_def[s] for s in set(used_sensors)]
if isinstance(config_sensors, list):
if not config_sensors: # Use all sensors by default
@ -152,6 +151,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
for sensor in used_sensors:
hass_sensors.append(SMAsensor(sensor_def[sensor], []))
used_sensors = [sensor_def[s] for s in set(used_sensors)]
async_add_entities(hass_sensors)
# Init the SMA interface