Fix attribute name
This commit is contained in:
parent
721dc313e0
commit
8620a53c44
|
@ -24,6 +24,7 @@ from .const import DEFAULT_NAME, DEVICE_ID, DOMAIN, EVENT_TAG_SCANNED, TAG_ID
|
|||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
LAST_SCANNED = "last_scanned"
|
||||
LAST_SCANNED_BY_DEVICE_ID = "last_scanned_by_device_id"
|
||||
STORAGE_KEY = DOMAIN
|
||||
STORAGE_VERSION = 1
|
||||
TAGS = "tags"
|
||||
|
@ -256,7 +257,7 @@ class TagEntity(Entity):
|
|||
@property
|
||||
def extra_state_attributes(self) -> dict[str, Any]:
|
||||
"""Return the state attributes of the sun."""
|
||||
return {TAG_ID: self._tag_id, DEVICE_ID: self._last_device_id}
|
||||
return {TAG_ID: self._tag_id, LAST_SCANNED_BY_DEVICE_ID: self._last_device_id}
|
||||
|
||||
async def async_add_initial_state(self) -> None:
|
||||
"""Add initial state."""
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
"tag_id": {
|
||||
"name": "Tag ID"
|
||||
},
|
||||
"device_id": {
|
||||
"name": "Device ID"
|
||||
"last_scanned_by_device_id": {
|
||||
"name": "Last scanned by device ID"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ async def test_entity(
|
|||
assert entity.state == now.isoformat(timespec="milliseconds")
|
||||
assert entity.attributes == {
|
||||
"tag_id": "test tag id",
|
||||
"device_id": "device id",
|
||||
"last_scanned_by_device_id": "device id",
|
||||
"friendly_name": "test tag name",
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue