mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Merge pull request #1010 from MartinHjelmare/fix-device-attr
Fix device_state_attributes
This commit is contained in:
commit
6796219f37
@ -153,8 +153,10 @@ class MySensorsSensor(Entity):
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
device_attr = dict(self._values)
|
||||
device_attr.pop(self.value_type, None)
|
||||
device_attr = {}
|
||||
for value_type, value in self._values.items():
|
||||
if value_type != self.value_type:
|
||||
device_attr[self.gateway.const.SetReq(value_type).name] = value
|
||||
return device_attr
|
||||
|
||||
@property
|
||||
|
@ -103,8 +103,10 @@ class MySensorsSwitch(SwitchDevice):
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return device specific state attributes."""
|
||||
device_attr = dict(self._values)
|
||||
device_attr.pop(self.value_type, None)
|
||||
device_attr = {}
|
||||
for value_type, value in self._values.items():
|
||||
if value_type != self.value_type:
|
||||
device_attr[self.gateway.const.SetReq(value_type).name] = value
|
||||
return device_attr
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user