1 """Support for Volvo On Call."""
6 from .const
import DOMAIN
7 from .coordinator
import VolvoUpdateCoordinator
11 """Base class for all VOC entities."""
19 coordinator: VolvoUpdateCoordinator,
21 """Initialize the entity."""
31 """Return corresponding instrument."""
32 return self.coordinator.volvo_data.instrument(
38 """Return the icon."""
52 return self.coordinator.volvo_data.vehicle_name(self.
vehiclevehicle)
56 """Return full name of the entity."""
57 return f
"{self._vehicle_name} {self._entity_name}"
61 """Return true if unable to access real state of entity."""
66 """Return a inique set of attributes for each vehicle."""
68 identifiers={(DOMAIN, self.
vehiclevehicle.vin)},
70 model=self.
vehiclevehicle.vehicle_type,
76 """Return device specific state attributes."""
79 model=f
"{self.vehicle.vehicle_type}/{self.vehicle.model_year}",
84 """Return a unique ID."""
86 if self.
instrumentinstrument.slug_override
is not None:
87 slug_override = f
"-{self.instrument.slug_override}"
88 return f
"{self.vin}-{self.component}-{self.attribute}{slug_override}"
def extra_state_attributes(self)
DeviceInfo device_info(self)
None __init__(self, str vin, str component, str attribute, str slug_attr, VolvoUpdateCoordinator coordinator)