mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
add id to state attributes (#26086)
This commit is contained in:
parent
4bce1efeee
commit
f34b84a5cf
@ -11,6 +11,7 @@ from homeassistant.helpers.entity import Entity
|
|||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
ATTR_MODEL_TYPE = "model_type"
|
ATTR_MODEL_TYPE = "model_type"
|
||||||
|
ATTR_ID = "id"
|
||||||
# RSSI HAP -> Device
|
# RSSI HAP -> Device
|
||||||
ATTR_RSSI_DEVICE = "rssi_device"
|
ATTR_RSSI_DEVICE = "rssi_device"
|
||||||
# RSSI Device -> HAP
|
# RSSI Device -> HAP
|
||||||
@ -93,7 +94,8 @@ class HomematicipGenericDevice(Entity):
|
|||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes of the generic device."""
|
"""Return the state attributes of the generic device."""
|
||||||
attr = {ATTR_MODEL_TYPE: self._device.modelType}
|
attr = {ATTR_MODEL_TYPE: self._device.modelType, ATTR_ID: self._device.id}
|
||||||
|
|
||||||
if hasattr(self._device, "sabotage") and self._device.sabotage:
|
if hasattr(self._device, "sabotage") and self._device.sabotage:
|
||||||
attr[ATTR_SABOTAGE] = self._device.sabotage
|
attr[ATTR_SABOTAGE] = self._device.sabotage
|
||||||
if hasattr(self._device, "rssiDeviceValue") and self._device.rssiDeviceValue:
|
if hasattr(self._device, "rssiDeviceValue") and self._device.rssiDeviceValue:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user