Fix RFLink restore state (#20588)
* some minor tests refactor * unused import * async/await refactor * Correct tests failures * Restore state bug added call to super().async_added_to_hass() * Show brightness attribute if device supports it * Fix light/test_rflink Dimmable devices defaults to 255 brightness * delete super().device_state_attributes call
This commit is contained in:
parent
5f7f7777a0
commit
13421b326b
3 changed files with 18 additions and 1 deletions
|
@ -185,6 +185,14 @@ class DimmableRflinkLight(SwitchableRflinkDevice, Light):
|
|||
"""Return the brightness of this light between 0..255."""
|
||||
return self._brightness
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
attr = {}
|
||||
if self._brightness is not None:
|
||||
attr[ATTR_BRIGHTNESS] = self._brightness
|
||||
return attr
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
|
@ -239,6 +247,14 @@ class HybridRflinkLight(SwitchableRflinkDevice, Light):
|
|||
"""Return the brightness of this light between 0..255."""
|
||||
return self._brightness
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
attr = {}
|
||||
if self._brightness is not None:
|
||||
attr[ATTR_BRIGHTNESS] = self._brightness
|
||||
return attr
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue