Vaskivskyi / ha-asusrouter

Monitor and control your AsusWRT-powered router from Home Assistant
https://asusrouter.vaskivskyi.com
Apache License 2.0
179 stars 17 forks source link

[Bug] entities do not correctly get`created_at` or `modified_at` set #848

Open Morriz opened 1 month ago

Morriz commented 1 month ago

The problem

Like the title says. These props do not get set, which is a shame if one wants to check how old entities are.

Your device model

GT-AXE16000

Firmware type

Merlin

Firmware version

3.0.0.4.388.8_2_rog

Integration version with the issue

all

Method of the integration installation

HACS

What version and type of Home Assistant installation do you use

2024.8.1

Is there anything useful in the logs?

No response

Diagnostics information

No response

Additional information

No response

Vaskivskyi commented 1 month ago

Please, elaborate a bit more on what exactly is the bug. Also, an example of such a feature from any other integration would be appreciated, because I am not sure I can fully understand this issue

Morriz commented 1 week ago

Those are native props of entities if I understand it correctly, so it is up to the creator of any entity to set those props upon creation/modification time. Just like in any other stateful app?

Now I only see asusrouter creating entities that have those props unset. (Check changes in the underlying yaml files that are used for state storage in HASS, and you will see what I mean.)

I would expect devs be forced to use an api to create devices and entities, such that the wrapping layer would take care of such low level manipulation, but it seems not the case. I am disappointed by the HASS team that they did not follow up on their own design choices. I would force integration devs to use a base set of props and either validate those or set at db write time.

Vaskivskyi commented 1 week ago

@Morriz, so, you cannot see the history of the AsusRouter entities?

image

Morriz commented 1 week ago

Indeed, I can not see the modified date of the tracker devices, making it impossible to see if they are ready for deletion