Add force_update to timer integration#31646
Conversation
As per this discussion we need to update last_changed when active timer restarted. One way to do that is to force HA update the state on each request even if it remains the same. More details here - home-assistant/architecture#345
|
Please add a test. |
|
@balloob could you point me to the description how to do that - I've never done it. |
|
IMO you could tap into https://github.com/home-assistant/home-assistant/blob/e3894d212c8d7b2ab36e33b4911460352625e64a/tests/components/timer/test_init.py#L342-L406 Define another fakelistener and listen for |
|
Thanks Alexei, will try my best in finding out how the tests work. |
|
you also may want to install pre-commit for git, so it would take care of formatting and sorting imports |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
bump, will deal with it soon |
make sure state_change event fired every time timer (re)started
Breaking change
It is not a breaking change as far as I understand.
Proposed change
As per this discussion we need to update last_changed when active timer restarted.
One way to do that is to force HA update the state on each request even if it remains the same.
Type of change
Example entry for
configuration.yaml:# Example configuration.yamlAdditional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale: