-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Update state with earlier charge complete and arrival times #575
Conversation
I've confirmed this change works in home assistant. I'm not sure how to get the state to update in the test after the times move earlier. |
3aa481b
to
b6da3a4
Compare
Such a small logic change I think we are good w/o specific test |
My preference is that we have a test to help with regressions. HA should have loads of examples of testing around mocking time. I think they use timemachine but there are alternatives. |
I'm able to mock the time okay. The entity state does not update after the mocked time changes (I tired to increase and decrease the time to make sure, increasing works under the original logic). Is there a way to force HA to update the sensors? Not working test sequence:
|
I haven't done HA testing for a while, but again, this is probably something done in core a lot. |
I've dumped way too much time into this, I can't solve it. I think I've narrowed down to, the mock controller does not grab new data and update the HA states during the test. Its not an issue with the changing time, that would be easy. |
Well, if you can't solve it just merge up to dev and I'll get you in the next release. |
b6da3a4
to
1df6b0b
Compare
Added absolute value around the seconds comparison to allow for a state change when the charge complete time and the arrival time move earlier than before.
closes #565