diff --git a/homeassistant/components/volvooncall.py b/homeassistant/components/volvooncall.py index fe7ec460674..46c22c65e85 100644 --- a/homeassistant/components/volvooncall.py +++ b/homeassistant/components/volvooncall.py @@ -24,7 +24,7 @@ DOMAIN = 'volvooncall' DATA_KEY = DOMAIN -REQUIREMENTS = ['volvooncall==0.7.4'] +REQUIREMENTS = ['volvooncall==0.7.9'] _LOGGER = logging.getLogger(__name__) @@ -117,6 +117,10 @@ async def async_setup(hass, config): data = hass.data[DATA_KEY] = VolvoData(config) + def is_enabled(attr): + """Return true if the user has enabled the resource.""" + return attr in config[DOMAIN].get(CONF_RESOURCES, [attr]) + def discover_vehicle(vehicle): """Load relevant platforms.""" data.vehicles.add(vehicle.vin) @@ -125,17 +129,13 @@ async def async_setup(hass, config): mutable=config[DOMAIN][CONF_MUTABLE], scandinavian_miles=config[DOMAIN][CONF_SCANDINAVIAN_MILES]) - def is_enabled(attr): - """Return true if the user has enabled the resource.""" - return attr in config[DOMAIN].get(CONF_RESOURCES, [attr]) - for instrument in ( instrument for instrument in dashboard.instruments if instrument.component in COMPONENTS and is_enabled(instrument.slug_attr)): - data.instruments.append(instrument) + data.instruments.add(instrument) hass.async_create_task( discovery.async_load_platform( @@ -174,7 +174,7 @@ class VolvoData: def __init__(self, config): """Initialize the component state.""" self.vehicles = set() - self.instruments = [] + self.instruments = set() self.config = config[DOMAIN] self.names = self.config.get(CONF_NAME) diff --git a/requirements_all.txt b/requirements_all.txt index 2a1649e9b9a..fadfe6491b6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1590,7 +1590,7 @@ venstarcolortouch==0.6 volkszaehler==0.1.2 # homeassistant.components.volvooncall -volvooncall==0.7.4 +volvooncall==0.7.9 # homeassistant.components.verisure vsure==1.5.2