Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions homeassistant/components/fibaro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def should_poll(self):
@property
def device_state_attributes(self):
"""Return the state attributes of the device."""
attr = {}
attr = {"fibaro_id": self.fibaro_device.id}

try:
if "battery" in self.fibaro_device.interfaces:
Expand All @@ -528,5 +528,4 @@ def device_state_attributes(self):
except (ValueError, KeyError):
pass

attr["fibaro_id"] = self.fibaro_device.id
return attr
11 changes: 6 additions & 5 deletions homeassistant/components/homematic/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ def available(self):
@property
def device_state_attributes(self):
"""Return device specific state attributes."""
attr = {}

# Static attributes
attr = {
"id": self._hmdevice.ADDRESS,
"interface": self._interface,
}

# Generate a dictionary with attributes
for node, data in HM_ATTRIBUTE_SUPPORT.items():
Expand All @@ -82,10 +87,6 @@ def device_state_attributes(self):
value = data[1].get(self._data[node], self._data[node])
attr[data[0]] = value

# Static attributes
attr["id"] = self._hmdevice.ADDRESS
attr["interface"] = self._interface

return attr

def update(self):
Expand Down
3 changes: 1 addition & 2 deletions homeassistant/components/lutron_caseta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ def device_info(self):
@property
def device_state_attributes(self):
"""Return the state attributes."""
attr = {"device_id": self.device_id, "zone_id": self._device["zone"]}
return attr
return {"device_id": self.device_id, "zone_id": self._device["zone"]}

@property
def should_poll(self):
Expand Down