So I am working on getting Flair Smart Vents added into my HA. I have found some older add on with Github but have required modification. I am new to Python and to HA so not sure the best way to do this. I have it working but not creating the entities correct.
This is the code I am using to create the entities.
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Setup the sensor platform"""
name = config.get(CONF_NAME)
client_id = config.get(CONF_CLIENT_ID)
client_secret = config.get(CONF_CLIENT_SECRET)
home_id = config.get(CONF_HOME_ID)
monitored_conditions = config.get(CONF_MONITORED_CONDITIONS)
sensors = []
if monitored_conditions is not None:
for item in monitored_conditions:
sensors += [FlairVent(
name, client_id, client_secret, home_id, _MONITORED_CONDITIONS[item])]
add_entities(sensors, True)
return
This is how it is displaying.
What I am hoping for is a way to loop through what you see here for each vent and make a separate entity for each of those. Any help or assistance would be greatly appreciated.