Add base class to gardena bluetooth entities (#96775)
Add helper base class for gardena entities
This commit is contained in:
parent
36cb3f7278
commit
d80b7d0145
4 changed files with 28 additions and 32 deletions
|
@ -51,10 +51,7 @@ class GardenaBluetoothValveSwitch(GardenaBluetoothEntity, SwitchEntity):
|
|||
self._attr_is_on = None
|
||||
|
||||
def _handle_coordinator_update(self) -> None:
|
||||
if data := self.coordinator.data.get(Valve.state.uuid):
|
||||
self._attr_is_on = Valve.state.decode(data)
|
||||
else:
|
||||
self._attr_is_on = None
|
||||
self._attr_is_on = self.coordinator.get_cached(Valve.state)
|
||||
super()._handle_coordinator_update()
|
||||
|
||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue