1 """Support for Volvo heater."""
3 from __future__
import annotations
7 from volvooncall.dashboard
import Instrument
15 from .const
import DOMAIN, VOLVO_DISCOVERY_NEW
16 from .coordinator
import VolvoUpdateCoordinator
17 from .entity
import VolvoEntity
22 config_entry: ConfigEntry,
23 async_add_entities: AddEntitiesCallback,
25 """Configure binary_sensors from a config entry created in the integrations UI."""
26 coordinator: VolvoUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
27 volvo_data = coordinator.volvo_data
31 """Discover and add a discovered Volvo On Call switch."""
35 instrument.vehicle.vin,
40 for instrument
in instruments
41 if instrument.component ==
"switch"
46 config_entry.async_on_unload(
52 """Representation of a Volvo switch."""
56 coordinator: VolvoUpdateCoordinator,
62 """Initialize the switch."""
63 super().
__init__(vin, component, attribute, slug_attr, coordinator)
67 """Determine if switch is on."""
71 """Turn the switch on."""
76 """Turn the switch off."""
None __init__(self, VolvoUpdateCoordinator coordinator, str vin, str component, str attribute, str slug_attr)
None async_turn_on(self, **Any kwargs)
None async_turn_off(self, **Any kwargs)
None turn_off(self, **Any kwargs)
None turn_on(self, **Any kwargs)
None async_request_refresh(self)
ElkSystem|None async_discover_device(HomeAssistant hass, str host)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)