#Fritz
1 messages · Page 1 of 1 (latest)
I'm working on completing tests coverage for fritz.
After latest PR were merged, missing lines are basically from coordinator.py module.
I think we need a rework of the conftest.py as currently a lot of code should be already part of the tests but it's not due to fixture overriding methods.
Like https://github.com/home-assistant/core/blob/dev/tests/components/fritz/conftest.py#L43
@short raptor maybe you can help on this task
What do you need help with?
As in, happy to take a look, but at the moment I probably don't have the room to take the task itself
I think current code in conftest just overwrite real code so it’s never really tested
Mainly call_action() but not only
I had to force a forward to real code for clear cache too
So an advice on how to proceed would be appreciated
I can go down that route myself, once understood
Submitted a PR with 100% coverage: https://github.com/home-assistant/core/pull/164074
Hi @vestal abyss! I recently submitted a PR for the Fritz integration: https://github.com/home-assistant/core/pull/166158
It fixes an issue where the internet access switch flip-flops — toggling it off briefly disables access but then it immediately re-enables. The cause is that the batch-fetched device status stays stale for ~30s after the switch action, so the coordinator overwrites the new state with the old one. The PR is small, feel free to have a quick look.
Proposed change
Fix the internet access profile switch flipping back to its previous state after toggling, before eventually settling on the correct state.
The FritzBox exposes two ways to read a d...
Hi
thx for the submission
We will review it in the next days
I think we should just invalidate the cache when there is an action on the switch
Or maybe even get rid of it, @fresh belfry what you think ?
We can redesign data get to avoid calling the same endpoint more than once and avoid all the cache system
I added the caching, because some properties in the fritzconnection lib return different values from the same API call. So we need to adjust the lib itself to get rid of it