mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
VOC: Update library version. Moved method one step out. Instruments can be a set as well (#18967)
This commit is contained in:
parent
c8d92ce907
commit
d7a10136df
@ -24,7 +24,7 @@ DOMAIN = 'volvooncall'
|
|||||||
|
|
||||||
DATA_KEY = DOMAIN
|
DATA_KEY = DOMAIN
|
||||||
|
|
||||||
REQUIREMENTS = ['volvooncall==0.7.4']
|
REQUIREMENTS = ['volvooncall==0.7.9']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -117,6 +117,10 @@ async def async_setup(hass, config):
|
|||||||
|
|
||||||
data = hass.data[DATA_KEY] = VolvoData(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):
|
def discover_vehicle(vehicle):
|
||||||
"""Load relevant platforms."""
|
"""Load relevant platforms."""
|
||||||
data.vehicles.add(vehicle.vin)
|
data.vehicles.add(vehicle.vin)
|
||||||
@ -125,17 +129,13 @@ async def async_setup(hass, config):
|
|||||||
mutable=config[DOMAIN][CONF_MUTABLE],
|
mutable=config[DOMAIN][CONF_MUTABLE],
|
||||||
scandinavian_miles=config[DOMAIN][CONF_SCANDINAVIAN_MILES])
|
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 (
|
for instrument in (
|
||||||
instrument
|
instrument
|
||||||
for instrument in dashboard.instruments
|
for instrument in dashboard.instruments
|
||||||
if instrument.component in COMPONENTS and
|
if instrument.component in COMPONENTS and
|
||||||
is_enabled(instrument.slug_attr)):
|
is_enabled(instrument.slug_attr)):
|
||||||
|
|
||||||
data.instruments.append(instrument)
|
data.instruments.add(instrument)
|
||||||
|
|
||||||
hass.async_create_task(
|
hass.async_create_task(
|
||||||
discovery.async_load_platform(
|
discovery.async_load_platform(
|
||||||
@ -174,7 +174,7 @@ class VolvoData:
|
|||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
"""Initialize the component state."""
|
"""Initialize the component state."""
|
||||||
self.vehicles = set()
|
self.vehicles = set()
|
||||||
self.instruments = []
|
self.instruments = set()
|
||||||
self.config = config[DOMAIN]
|
self.config = config[DOMAIN]
|
||||||
self.names = self.config.get(CONF_NAME)
|
self.names = self.config.get(CONF_NAME)
|
||||||
|
|
||||||
|
@ -1590,7 +1590,7 @@ venstarcolortouch==0.6
|
|||||||
volkszaehler==0.1.2
|
volkszaehler==0.1.2
|
||||||
|
|
||||||
# homeassistant.components.volvooncall
|
# homeassistant.components.volvooncall
|
||||||
volvooncall==0.7.4
|
volvooncall==0.7.9
|
||||||
|
|
||||||
# homeassistant.components.verisure
|
# homeassistant.components.verisure
|
||||||
vsure==1.5.2
|
vsure==1.5.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user