diff --git a/homeassistant/components/fibaro/__init__.py b/homeassistant/components/fibaro/__init__.py index 4b51c82469e..6b56b146a9c 100644 --- a/homeassistant/components/fibaro/__init__.py +++ b/homeassistant/components/fibaro/__init__.py @@ -508,7 +508,7 @@ class FibaroDevice(Entity): @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: @@ -528,5 +528,4 @@ class FibaroDevice(Entity): except (ValueError, KeyError): pass - attr["fibaro_id"] = self.fibaro_device.id return attr diff --git a/homeassistant/components/homematic/entity.py b/homeassistant/components/homematic/entity.py index 8578be93555..bd0f8cf66dd 100644 --- a/homeassistant/components/homematic/entity.py +++ b/homeassistant/components/homematic/entity.py @@ -73,7 +73,12 @@ class HMDevice(Entity): @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(): @@ -82,10 +87,6 @@ class HMDevice(Entity): 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): diff --git a/homeassistant/components/lutron_caseta/__init__.py b/homeassistant/components/lutron_caseta/__init__.py index 37a9d12af95..612c6a26d1b 100644 --- a/homeassistant/components/lutron_caseta/__init__.py +++ b/homeassistant/components/lutron_caseta/__init__.py @@ -140,8 +140,7 @@ class LutronCasetaDevice(Entity): @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):