Return empty dictionary at first for attributes (#41348)
This commit is contained in:
parent
4d12fcc218
commit
61d9067a49
16 changed files with 75 additions and 77 deletions
|
@ -197,9 +197,9 @@ class DimmableRflinkLight(SwitchableRflinkDevice, LightEntity):
|
|||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
if self._brightness is not None:
|
||||
return {ATTR_BRIGHTNESS: self._brightness}
|
||||
return {}
|
||||
if self._brightness is None:
|
||||
return {}
|
||||
return {ATTR_BRIGHTNESS: self._brightness}
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
|
@ -259,9 +259,9 @@ class HybridRflinkLight(SwitchableRflinkDevice, LightEntity):
|
|||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
if self._brightness is not None:
|
||||
return {ATTR_BRIGHTNESS: self._brightness}
|
||||
return {}
|
||||
if self._brightness is None:
|
||||
return {}
|
||||
return {ATTR_BRIGHTNESS: self._brightness}
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue