home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.26k stars 29.86k forks source link

"created_at" & "modified_at" properties - for a yaml/UI input_number #123421

Open ildar170975 opened 1 month ago

ildar170975 commented 1 month ago

The problem

Create an input_number in yaml:

input_number:
  test_created:
    min: 10
    max: 100
    mode: box
    icon: mdi:car

Reload "input_number" (Dev tools -> yaml). The created entity does have a created_at property set (which is correct): image

Edit a max attribute in yaml:

input_number:
  test_created:
    ...
    max: 1000
    ...

Reload "input_number" (Dev tools -> yaml). The modified_at value is NOT changed (which is NOT correct).

Open more-info and edit an area or add a label, or change entity_id: image

The modified_at value is changed (which is correct).


Next, create an input_number in UI: image

The created entity does have a created_at property set (which is correct): image

Open more-info and edit an area or add a label, or change entity_id: image

The modified_at value is changed (which is correct).

Open more-info and edit a step property: image

The modified_at value is NOT changed (which is NOT correct).

What version of Home Assistant Core has the issue?

2024.8

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

input_number

Link to integration documentation on our website

https://www.home-assistant.io/integrations/input_number/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (input_number) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `input_number` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign input_number` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


input_number documentation input_number source (message by IssueLinks)

gfn256 commented 1 month ago

Both your other post & this one are probably because yaml code has to be reloaded. Try reloading and then check the modified at attribute.

ildar170975 commented 1 month ago

yaml code has to be reloaded

Ofc the yaml was reloaded as an obvious step. It was not only reloaded when I changed UI settings.

Just in case - added about yaml reload in to the 1st post.

mib1185 commented 1 month ago

~I think~ yaml defined helpers will never update the "modified at" value, since there configuration is not tracked between the reloads and reboots, so HA can not determine if it is the same as before

EDIT: Let me be a bit more clearly in this case

ildar170975 commented 1 month ago

think yaml defined helpers will never update the "modified at" value

If we assume that this is true - we should not assume that this is CORRECT. In this case the whole shiny idea of adding "modify" is a useless toy. Just say officially in Docs that "modify" is only updated for UI-controlled entities.