Skip to content
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 switch states in AVM FRITZ!Box Tools #107183

Merged

Conversation

mib1185
Copy link
Contributor

@mib1185 mib1185 commented Jan 4, 2024

Proposed change

Since property caching has been introduced, when setting a value to a class variable, it seems to be assumed unchangeable and those never read/considered again. btw this also fixes an issue were the initial value was always False and corrected after first data fetch.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

home-assistant bot commented Jan 4, 2024

Hey there @mammuth, @AaronDavidSchneider, @chemelli74, mind taking a look at this pull request as it has been labeled with an integration (fritz) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of fritz can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign fritz Removes the current integration label and assignees on the pull request, 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 pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@bdraco
Copy link
Member

bdraco commented Jan 4, 2024

I think the problem is that _attr_is_on is defined below ToggleEntity in the inheritance order because FritzBoxBaseSwitch(FritzBoxBaseEntity) doesn't inherit from SwitchEntity

@mib1185
Copy link
Contributor Author

mib1185 commented Jan 4, 2024

uh nice ... this worked well 👍

@mib1185 mib1185 merged commit 9b8f0e1 into home-assistant:dev Jan 4, 2024
23 checks passed
@mib1185 mib1185 deleted the fritz/fix-state-of-switch-entities branch January 4, 2024 22:36
raman325 added a commit to raman325/home-assistant that referenced this pull request Jan 5, 2024
* upstream/dev: (2071 commits)
  Set zwave_js voltage sensor suggested precision (home-assistant#107116)
  Bump bluetooth-adapters to 0.17.0 (home-assistant#107195)
  Disable IPv6 in the opower integration to fix AEP utilities (home-assistant#107203)
  Fix conversation snapshots (home-assistant#107196)
  Report missing entities/areas instead of failing to match in Assist (home-assistant#107151)
  Bump to PyTado 0.17.3 (home-assistant#107181)
  Fix switch states in AVM FRITZ!Box Tools (home-assistant#107183)
  Fix tplink overloading power strips (home-assistant#104208)
  Update sensorpush-ble library to 1.6.1 (home-assistant#107168)
  Bump aiohomekit to 3.1.2 (home-assistant#107177)
  Introduce base entity in streamlabs water (home-assistant#107095)
  Clean up outdated entity replacement logic in Guardian (home-assistant#107160)
  Add conversation_id parameter to conversation.process service (home-assistant#106078)
  Pass aiohttp clientsession to tedee integration (home-assistant#107089)
  Update Home Assistant base image to 2024.01.0 - Python 3.12 (home-assistant#107175)
  Remove precision in streamlabs water (home-assistant#107096)
  Pass down language to hassil (home-assistant#106490)
  Use snapshots in Glances sensor tests (home-assistant#107159)
  Cache homekit_controller supported features (home-assistant#106702)
  Migrate AVM FRITZ!Box Call monitor to has entity name (home-assistant#99752)
  ...
@frenck frenck mentioned this pull request Jan 5, 2024
nrdufour added a commit to nrdufour/home-ops that referenced this pull request Jan 5, 2024
…to v2024.1.1 (#290)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/home-assistant/home-assistant](https://www.home-assistant.io/) ([source](https://github.com/home-assistant/core)) | patch | `2024.1.0` -> `2024.1.1` |

---

### Release Notes

<details>
<summary>home-assistant/core (ghcr.io/home-assistant/home-assistant)</summary>

### [`v2024.1.1`](https://github.com/home-assistant/core/releases/tag/2024.1.1)

[Compare Source](home-assistant/core@2024.1.0...2024.1.1)

-   Enable strict typing for airthings_ble ([@&#8203;cdce8p] - [#&#8203;106815]) ([airthings_ble docs])
-   Fix qBittorrent torrent count when empty ([@&#8203;finder39] - [#&#8203;106903]) ([qbittorrent docs])
-   Bump dropmqttapi to 1.0.2 ([@&#8203;pfrazer] - [#&#8203;106978]) ([drop_connect docs]) (dependency)
-   bump openwebifpy to 4.0.3 ([@&#8203;autinerd] - [#&#8203;106593]) ([enigma2 docs]) (dependency)
-   Close stale connections (Airthings BLE) ([@&#8203;LaStrada] - [#&#8203;106748]) ([airthings_ble docs])
-   Bump openwebifpy to 4.0.4 ([@&#8203;autinerd] - [#&#8203;107000]) ([enigma2 docs]) (dependency)
-   Get Shelly RPC device `gen` from config entry data ([@&#8203;bieniu] - [#&#8203;107019]) ([shelly docs])
-   Fix missing backwards compatiblity layer for humidifier supported_features ([@&#8203;bdraco] - [#&#8203;107026]) ([humidifier docs])
-   Use async_register in streamlabswater ([@&#8203;joostlek] - [#&#8203;107060]) ([streamlabswater docs])
-   Fix data access in streamlabs water ([@&#8203;joostlek] - [#&#8203;107062]) ([streamlabswater docs])
-   Fix mobile_app cloudhook creation ([@&#8203;edenhaus] - [#&#8203;107068]) ([mobile_app docs])
-   Deduplicate handling of duplicated constants ([@&#8203;emontnemery] - [#&#8203;107074])
-   Fix missing backwards compatibility layer for water_heater supported_features ([@&#8203;bdraco] - [#&#8203;107091]) ([water_heater docs])
-   Bump habluetooth to 2.0.2 ([@&#8203;bdraco] - [#&#8203;107097]) ([bluetooth docs]) (dependency)
-   Include deprecated constants in wildcard imports ([@&#8203;emontnemery] - [#&#8203;107114])
-   Update frontend to [`2024010`](https://github.com/home-assistant/core/commit/20240104).0 ([@&#8203;bramkragten] - [#&#8203;107155]) ([frontend docs])
-   Bump Orvibo to 1.1.2 ([@&#8203;emericklaw] - [#&#8203;107162]) ([orvibo docs]) (dependency)
-   Bump aiohomekit to 3.1.2 ([@&#8203;bdraco] - [#&#8203;107177]) ([homekit_controller docs]) (dependency)
-   Bump to PyTado 0.17.3 ([@&#8203;erwindouna] - [#&#8203;107181]) ([tado docs]) (dependency)
-   Fix switch states in AVM FRITZ!Box Tools ([@&#8203;mib1185] - [#&#8203;107183]) ([fritz docs])
-   Hotfix cache logic bug in Tessie ([@&#8203;Bre77] - [#&#8203;107187]) ([tessie docs])
-   Disable IPv6 in the opower integration to fix AEP utilities ([@&#8203;tronikos] - [#&#8203;107203]) ([opower docs])
-   Fix entity property cache creation arguments ([@&#8203;ppetru] - [#&#8203;107221])
-   Use supported_features_compat in update.install service ([@&#8203;ludeeus] - [#&#8203;107224]) ([update docs])
-   Bump zwave-js-server-python to 0.55.3 ([@&#8203;raman325] - [#&#8203;107225]) ([zwave_js docs]) (dependency)

[#&#8203;106593]: home-assistant/core#106593

[#&#8203;106748]: home-assistant/core#106748

[#&#8203;106815]: home-assistant/core#106815

[#&#8203;106903]: home-assistant/core#106903

[#&#8203;106970]: home-assistant/core#106970

[#&#8203;106978]: home-assistant/core#106978

[#&#8203;107000]: home-assistant/core#107000

[#&#8203;107019]: home-assistant/core#107019

[#&#8203;107026]: home-assistant/core#107026

[#&#8203;107060]: home-assistant/core#107060

[#&#8203;107062]: home-assistant/core#107062

[#&#8203;107068]: home-assistant/core#107068

[#&#8203;107074]: home-assistant/core#107074

[#&#8203;107091]: home-assistant/core#107091

[#&#8203;107097]: home-assistant/core#107097

[#&#8203;107114]: home-assistant/core#107114

[#&#8203;107155]: home-assistant/core#107155

[#&#8203;107162]: home-assistant/core#107162

[#&#8203;107177]: home-assistant/core#107177

[#&#8203;107181]: home-assistant/core#107181

[#&#8203;107183]: home-assistant/core#107183

[#&#8203;107187]: home-assistant/core#107187

[#&#8203;107203]: home-assistant/core#107203

[#&#8203;107221]: home-assistant/core#107221

[#&#8203;107224]: home-assistant/core#107224

[#&#8203;107225]: home-assistant/core#107225

[@&#8203;Bre77]: https://github.com/Bre77

[@&#8203;LaStrada]: https://github.com/LaStrada

[@&#8203;autinerd]: https://github.com/autinerd

[@&#8203;bdraco]: https://github.com/bdraco

[@&#8203;bieniu]: https://github.com/bieniu

[@&#8203;bramkragten]: https://github.com/bramkragten

[@&#8203;cdce8p]: https://github.com/cdce8p

[@&#8203;edenhaus]: https://github.com/edenhaus

[@&#8203;emericklaw]: https://github.com/emericklaw

[@&#8203;emontnemery]: https://github.com/emontnemery

[@&#8203;erwindouna]: https://github.com/erwindouna

[@&#8203;finder39]: https://github.com/finder39

[@&#8203;frenck]: https://github.com/frenck

[@&#8203;joostlek]: https://github.com/joostlek

[@&#8203;ludeeus]: https://github.com/ludeeus

[@&#8203;mib1185]: https://github.com/mib1185

[@&#8203;pfrazer]: https://github.com/pfrazer

[@&#8203;ppetru]: https://github.com/ppetru

[@&#8203;raman325]: https://github.com/raman325

[@&#8203;tronikos]: https://github.com/tronikos

[airthings_ble docs]: https://www.home-assistant.io/integrations/airthings_ble/

[bluetooth docs]: https://www.home-assistant.io/integrations/bluetooth/

[drop_connect docs]: https://www.home-assistant.io/integrations/drop_connect/

[enigma2 docs]: https://www.home-assistant.io/integrations/enigma2/

[fritz docs]: https://www.home-assistant.io/integrations/fritz/

[frontend docs]: https://www.home-assistant.io/integrations/frontend/

[homekit_controller docs]: https://www.home-assistant.io/integrations/homekit_controller/

[humidifier docs]: https://www.home-assistant.io/integrations/humidifier/

[mobile_app docs]: https://www.home-assistant.io/integrations/mobile_app/

[opower docs]: https://www.home-assistant.io/integrations/opower/

[orvibo docs]: https://www.home-assistant.io/integrations/orvibo/

[qbittorrent docs]: https://www.home-assistant.io/integrations/qbittorrent/

[shelly docs]: https://www.home-assistant.io/integrations/shelly/

[streamlabswater docs]: https://www.home-assistant.io/integrations/streamlabswater/

[tado docs]: https://www.home-assistant.io/integrations/tado/

[tessie docs]: https://www.home-assistant.io/integrations/tessie/

[update docs]: https://www.home-assistant.io/integrations/update/

[water_heater docs]: https://www.home-assistant.io/integrations/water_heater/

[zwave_js docs]: https://www.home-assistant.io/integrations/zwave_js/

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEyMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Reviewed-on: https://git.home/nrdufour/home-ops/pulls/290
Co-authored-by: Renovate <renovate@ptinem.io>
Co-committed-by: Renovate <renovate@ptinem.io>
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WiFi status not shown correctly in AVM FRITZ!Box Tools
4 participants