parent
6dd836589c
commit
dd03fcbeb3
|
@ -281,3 +281,8 @@ class VolvoEntity(Entity):
|
|||
self.instrument.attributes,
|
||||
model=f"{self.vehicle.vehicle_type}/{self.vehicle.model_year}",
|
||||
)
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return a unique ID."""
|
||||
return f"{self.vin}-{self.component}-{self.attribute}"
|
||||
|
|
|
@ -26,7 +26,9 @@ class VolvoSwitch(VolvoEntity, ToggleEntity):
|
|||
async def async_turn_on(self, **kwargs):
|
||||
"""Turn the switch on."""
|
||||
await self.instrument.turn_on()
|
||||
self.async_write_ha_state()
|
||||
|
||||
async def async_turn_off(self, **kwargs):
|
||||
"""Turn the switch off."""
|
||||
await self.instrument.turn_off()
|
||||
self.async_write_ha_state()
|
||||
|
|
Loading…
Reference in New Issue