Limit Whirlpool timestamp changes to +/- 60 seconds#85368
Conversation
|
Hey there @abmantis, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
It looks like something was missed in reviews here. State is not supposed to contain things like remaining time that keeps on changing. Could you please change this sensor to a completion time instead. |
|
This timer value is marked as end time for the wash/dry cycle, it updates the end time while the cycle is running (it starts with and estimate which gets better as the load runs). I'm afraid I don't understand the request. |
|
It should be a timestamp of when the machine ends tte cycle instead of a count down. |
|
It is a timestamp. Maybe I'm still missing your point? |
|
You were not missing my point. I was miss-reading the code. How accurate is the update? Could 30 seconds diff work, could 20? Im okey with 60. But if we dont need yo be that course it could.be worth being more accurate. |
| ): | ||
| """Test the sensor value callbacks.""" | ||
| hass.state = CoreState.not_running | ||
| thetimestamp: datetime = datetime(2022, 11, 29, 00, 00, 00, 00, timezone.utc) |
There was a problem hiding this comment.
I fail to understand how the added tests verify the 60 second limits on update? Or are they not doing that?
|
They are not verifying 60 second update. They are just causing the update
to execute because "now" is > than 2022.
I suppose I could add a test to verify <60 doesn't update too.
…On Sat, Jan 7, 2023, 1:52 PM Joakim Plate ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In tests/components/whirlpool/test_sensor.py
<#85368 (comment)>
:
> @@ -90,6 +109,25 @@ async def test_washer_sensor_values(
mock_sensor1_api: MagicMock,
):
"""Test the sensor value callbacks."""
+ hass.state = CoreState.not_running
+ thetimestamp: datetime = datetime(2022, 11, 29, 00, 00, 00, 00, timezone.utc)
I fail to understand how the added tests verify the 60 second limits on
update? Or are they not doing that?
—
Reply to this email directly, view it on GitHub
<#85368 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3GVBHNS2BN6RLPYNLWP6DWRG3PVANCNFSM6AAAAAATT4ZP2A>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
the estimate changes quite a bit at the beginning, then settles down. I've
found 60 seconds to limit unnecessary updates the really don't show on the
UI until it's closer to the end of the cycle. Being off by a minute
doesn't really affect "knowing when the cycle will finish" from a user
perspective. (Wife still has to walk over to the machine :) )
…On Sat, Jan 7, 2023, 1:46 PM Joakim Plate ***@***.***> wrote:
You were not missing my point. I was miss-reading the code. How accurate
is the update? Could 30 seconds diff work, could 20?
Im okey with 60. But if we dont need yo be that course it could.be worth
being more accurate.
—
Reply to this email directly, view it on GitHub
<#85368 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3GVBHXNPFBND5UB7DLQODWRG2YNANCNFSM6AAAAAATT4ZP2A>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
elupus
left a comment
There was a problem hiding this comment.
Ok for me. A test would be good. I will not merge right away if you want to add a test.
|
Added tests. Plan to stick with 60 second threshold as it has the minimum number of updates to HA state machine (only a couple per wash/dry cycle) while continuing to provide similar completion times as the Whirlpool app. |
…5368) * Limit timestamp changes to +/- 60 seconds * Add timestamp callback tests
Proposed change
Limit timestamp changes to +/- 60 seconds: Updating timestamp changes for anything less than 60 seconds produces unnecessary state machine updates with no value to the user. For most cycles this reduces the "changes" by 90%.
Type of change
Additional 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.To help with the load of incoming pull requests: