Migrate Duco to python-duco-connectivity and remove temperature sensors#170237
Conversation
There was a problem hiding this comment.
Pull request overview
Migrates the Duco integration from python-duco-client to the newer python-duco-connectivity library and intentionally removes Duco temperature sensor entities to avoid exposing misleading readings.
Changes:
- Switch Duco integration imports/API usage to
python-duco-connectivity==0.2.0and update diagnostics/system health accordingly. - Remove node and box temperature sensor entities (and related translations/snapshots).
- Update Duco tests/fixtures to reflect the new library and the removed entities.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/duco/__init__.py |
Create the Duco client via duco_connectivity (no SSL context construction). |
homeassistant/components/duco/config_flow.py |
Update config flow validation to use the new client API. |
homeassistant/components/duco/coordinator.py |
Migrate coordinator to duco_connectivity client/exceptions/models. |
homeassistant/components/duco/diagnostics.py |
Update diagnostics collection to new exception + write-quota API name. |
homeassistant/components/duco/entity.py |
Update base entity typing to duco_connectivity Node model. |
homeassistant/components/duco/fan.py |
Update fan platform imports to new library modules. |
homeassistant/components/duco/manifest.json |
Swap requirement/loggers to python-duco-connectivity / duco_connectivity. |
homeassistant/components/duco/sensor.py |
Remove temperature sensor descriptions; adjust ventilation-state enum options. |
homeassistant/components/duco/strings.json |
Remove sensor translation key for the removed box temperature entity. |
homeassistant/components/duco/system_health.py |
Update system health to new exception + write-quota API name. |
requirements_all.txt |
Replace python-duco-client with python-duco-connectivity. |
requirements_test_all.txt |
Replace python-duco-client with python-duco-connectivity. |
tests/components/duco/conftest.py |
Update fixtures/models and remove SSL-context patching; update quota API name. |
tests/components/duco/test_config_flow.py |
Update config flow tests to new client construction (no SSL context). |
tests/components/duco/test_diagnostics.py |
Update diagnostics tests to new API name and imports. |
tests/components/duco/test_fan.py |
Update fan tests to new exception import locations. |
tests/components/duco/test_init.py |
Update setup tests to new client construction and quota API name. |
tests/components/duco/test_sensor.py |
Remove expectations for temperature entities; update imports/models. |
tests/components/duco/test_system_health.py |
Update system health test for renamed quota method and exception import. |
tests/components/duco/snapshots/test_sensor.ambr |
Remove snapshot entries for removed temperature sensors. |
|
Hi @ronaldvdmeer, @joostlek and HA maintainers, I'm Thomas Phil, the author of ducopy — the library that the python-duco-client dependency being replaced here is based on. I want to flag a licensing issue for the record before this PR merges, because it affects the dependency that has been live in Home Assistant releases to date. The relevant facts: python-duco-client versions 0.3.7 through 0.5.0 (the version currently pinned in manifest.json as python-duco-client==0.5.0) included a direct copy of the API key generation code from ducopy's apikeygenerator.py, which was first committed to ducopy on 2024-11-02, over 17 months before python-duco-client existed. The commit that introduced this code into python-duco-client (95717af) contains the message "same algorithm as used in the official ducopy reference library" — an acknowledgment that the code was taken from my library. Ducopy is licensed under MIT + Commons Clause v1.0. The Commons Clause restricts commercial distribution without written permission from the licensor, and requires that the license notice (including the Commons Clause) be preserved. Neither condition was met in python-duco-client 0.3.7–0.5.0: the Commons Clause was not included, and no permission was sought. An ACKNOWLEDGEMENTS.md was added to the python-duco-client repository only after the code was removed, and only to the git repository — it was never part of any PyPI tarball. I am not asking this PR to be blocked. Migrating away from python-duco-client is the right outcome, and I support that direction. However, I want the HA maintainers to be aware that: Every HA release that shipped with python-duco-client==0.5.0 distributed code from my library without a valid license. This is a historical fact that the cleanroom rewrite (python-duco-client==0.5.0 -> python-duco-connectivity==0.2.0 in the manifest file) does not retroactively cure. Sincerely, Thomas Phil (@Sikerdebaard) Further references: |
Bump aiotankerkoenig to 0.5.3 (home-assistant#170224) Fix entities refresh for UptimeRobot (home-assistant#170217) Update easyEnergy exception and icon translations (home-assistant#170218) Add more Gen1 sensors to indevolt (home-assistant#170191) Bump letpot to 0.7.0 (home-assistant#169868) Migrate Thermo Beacon to config entry runtime data (home-assistant#170226) Migrate Sensirion BLE to config entry runtime data (home-assistant#170227) Co-authored-by: Josef Zweck <josef@zweck.dev> Bump imgw-pib to 2.1.2 (home-assistant#170274) Bump serialx to 1.7.2 (home-assistant#170272) Bump aioamazondevices to 13.5.0 (home-assistant#170258) Update upb-lib to 0.7.0 (home-assistant#170051) Bump qbittorrent-api to 2026.5.1 (home-assistant#170181) Use VERSION from PrusaLinkConfigFlow in prusalink (home-assistant#170200) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Migrate Duco to python-duco-connectivity and remove temperature sensors (home-assistant#170237) fix: Do not forget segments from state when a new config arrives (home-assistant#170265) Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Complete icon translations for Indevolt (home-assistant#170292) Align Indevolt quality scale with documentation (home-assistant#170289) Apply strict typing to Indevolt integration (home-assistant#170288) iaqualink: set system specific polling interval (home-assistant#170279) Use standby for HDMI-CEC turn off (home-assistant#170206) prusalink: add continue-job button for ATTENTION state (home-assistant#170193) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> data grand lyon: implement diagnostics (home-assistant#170184) Set serial port description from `description`, not `product` (home-assistant#170160) Co-authored-by: Paulus Schoutsen <balloob@gmail.com> Update infrared-protocols to 4.0.0 (home-assistant#170297) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> data grand lyon: use test fixture instead of manual patching (home-assistant#170294) Handle empty BSB-LAN heating circuits (home-assistant#170249) Add diagnostics platform to Home Assistant Connect ZBT-2 (home-assistant#170158) Fix deprecated_class to work with inheritance (home-assistant#170137) Skip offline devices instead of aborting ViCare diagnostics (home-assistant#170106) Fix local API incorrectly marking devices as unavailable in Overkiz (home-assistant#170118) Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Add RepairsFlowResult TypeAlias (home-assistant#170263) Fix flaky diagnostics test for Novy Cooker Hood (home-assistant#170299) Fix spelling of RS-232 in Denon RS-232 integration (home-assistant#170298) data grand lyon: implement reconfiguration flow (home-assistant#170210) Add shared test mocks for the Infrared integration (home-assistant#170296) Co-authored-by: Claude <noreply@anthropic.com> Bump renault-api to 0.5.8 (home-assistant#170309) Bump indevolt api to 1.7.2 (home-assistant#170310) Update IQS to platinum for UptimeRobot (home-assistant#170260) Add player specific sensor to nintendo_parental_controls (home-assistant#155786) Co-authored-by: Joshua Peisach (ItzSwirlz) <itzswirlz2020@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Erik Montnemery <erik@montnemery.com> Fix hassio.backup_partial AttributeError when folders are specified (home-assistant#170312) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Add backoff to forbidden packages (home-assistant#170242) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Add tuya water timer data points (home-assistant#170314) Add more entities for Tuya camera (home-assistant#169966) Co-authored-by: mik-laj <12058428+mik-laj@users.noreply.github.com> Co-authored-by: Norbert Rittel <norbert@rittel.de> Add Tuya DLQ fixture (home-assistant#169585) Update rf-protocols to 3.0.0 (home-assistant#170301) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Add Message Expire Interval option to MQTT publish service (home-assistant#169317) Co-authored-by: Copilot <copilot@github.com> Add new CentriConnect component (home-assistant#166933) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Watts: add HVAC action + preset mode (home-assistant#169546) Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Joostlek <joostlek@outlook.com> Add quality scale for airnow integration (home-assistant#169709) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Fix nobo_hub NoboProfileSelector class-level mutable defaults (home-assistant#170119) Add cover support to control4 (home-assistant#169417) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Add Mitsubishi brand (home-assistant#169924) Co-authored-by: Nikolai Rahimi <nikolairahimi@users.noreply.github.com> Co-authored-by: Paulus Schoutsen <balloob@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Fix coordinator data mutation in YouTube diagnostics (home-assistant#170300) Co-authored-by: FIls0010 <a1867444@adelaide.edu.au> Bump aiovodafone to 3.2.0 (home-assistant#170322) Add countdown number for Tuya sfkzq single-valve timers (home-assistant#170318) Allow setting hvac_mode in generic_thermostat.set_temperature (home-assistant#168062) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Z-Wave.me: Allow updating entities (home-assistant#167839) Fix MQTT device discovery not using shared QoS and encoding options (home-assistant#170195) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Google assistant temperature setting active thermostat mode (home-assistant#166448) Co-authored-by: Lucas Sanchez Sagrado <lucas.sansag@educa.jcyl.es> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Add quality scale to Tesla Fleet integration (home-assistant#160475) Co-authored-by: Claude <noreply@anthropic.com> Only use SmartThings switch for light if it should (home-assistant#166424) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Add quality scale file to Ness Alarm (home-assistant#163425) Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Fix Shelly media player availability (home-assistant#170319) Update discovery description wording (home-assistant#170325) Bump teltasync to 0.3.0, fix discovery for older devices (home-assistant#169660) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Complete exception translations for Indevolt (home-assistant#170291) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Add Kiosker switch platform (home-assistant#168858) Add `ZWaveNodeBaseEntity` for Z-Wave node-level entities (home-assistant#170124) Add number platform to eurotronic_cometblue (home-assistant#168119) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Bump aiotankerkoenig to 0.5.3 (home-assistant#170224) Fix entities refresh for UptimeRobot (home-assistant#170217) Update easyEnergy exception and icon translations (home-assistant#170218) Add more Gen1 sensors to indevolt (home-assistant#170191) Bump letpot to 0.7.0 (home-assistant#169868) Migrate Thermo Beacon to config entry runtime data (home-assistant#170226) Migrate Sensirion BLE to config entry runtime data (home-assistant#170227) Co-authored-by: Josef Zweck <josef@zweck.dev> Bump imgw-pib to 2.1.2 (home-assistant#170274) Bump serialx to 1.7.2 (home-assistant#170272) Bump aioamazondevices to 13.5.0 (home-assistant#170258) Update upb-lib to 0.7.0 (home-assistant#170051) Bump qbittorrent-api to 2026.5.1 (home-assistant#170181) Use VERSION from PrusaLinkConfigFlow in prusalink (home-assistant#170200) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Migrate Duco to python-duco-connectivity and remove temperature sensors (home-assistant#170237) fix: Do not forget segments from state when a new config arrives (home-assistant#170265) Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Complete icon translations for Indevolt (home-assistant#170292) Align Indevolt quality scale with documentation (home-assistant#170289) Apply strict typing to Indevolt integration (home-assistant#170288) iaqualink: set system specific polling interval (home-assistant#170279) Use standby for HDMI-CEC turn off (home-assistant#170206) prusalink: add continue-job button for ATTENTION state (home-assistant#170193) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> data grand lyon: implement diagnostics (home-assistant#170184) Set serial port description from `description`, not `product` (home-assistant#170160) Co-authored-by: Paulus Schoutsen <balloob@gmail.com> Update infrared-protocols to 4.0.0 (home-assistant#170297) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> data grand lyon: use test fixture instead of manual patching (home-assistant#170294) Handle empty BSB-LAN heating circuits (home-assistant#170249) Add diagnostics platform to Home Assistant Connect ZBT-2 (home-assistant#170158) Fix deprecated_class to work with inheritance (home-assistant#170137) Skip offline devices instead of aborting ViCare diagnostics (home-assistant#170106) Fix local API incorrectly marking devices as unavailable in Overkiz (home-assistant#170118) Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> Add RepairsFlowResult TypeAlias (home-assistant#170263) Fix flaky diagnostics test for Novy Cooker Hood (home-assistant#170299) Fix spelling of RS-232 in Denon RS-232 integration (home-assistant#170298) data grand lyon: implement reconfiguration flow (home-assistant#170210) Add shared test mocks for the Infrared integration (home-assistant#170296) Co-authored-by: Claude <noreply@anthropic.com> Bump renault-api to 0.5.8 (home-assistant#170309) Bump indevolt api to 1.7.2 (home-assistant#170310) Update IQS to platinum for UptimeRobot (home-assistant#170260) Add player specific sensor to nintendo_parental_controls (home-assistant#155786) Co-authored-by: Joshua Peisach (ItzSwirlz) <itzswirlz2020@outlook.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Erik Montnemery <erik@montnemery.com> Fix hassio.backup_partial AttributeError when folders are specified (home-assistant#170312) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Add backoff to forbidden packages (home-assistant#170242) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Add tuya water timer data points (home-assistant#170314) Add more entities for Tuya camera (home-assistant#169966) Co-authored-by: mik-laj <12058428+mik-laj@users.noreply.github.com> Co-authored-by: Norbert Rittel <norbert@rittel.de> Add Tuya DLQ fixture (home-assistant#169585) Update rf-protocols to 3.0.0 (home-assistant#170301) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Add Message Expire Interval option to MQTT publish service (home-assistant#169317) Co-authored-by: Copilot <copilot@github.com> Add new CentriConnect component (home-assistant#166933) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Watts: add HVAC action + preset mode (home-assistant#169546) Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Joostlek <joostlek@outlook.com> Add quality scale for airnow integration (home-assistant#169709) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Fix nobo_hub NoboProfileSelector class-level mutable defaults (home-assistant#170119) Add cover support to control4 (home-assistant#169417) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Add Mitsubishi brand (home-assistant#169924) Co-authored-by: Nikolai Rahimi <nikolairahimi@users.noreply.github.com> Co-authored-by: Paulus Schoutsen <balloob@gmail.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Fix coordinator data mutation in YouTube diagnostics (home-assistant#170300) Co-authored-by: FIls0010 <a1867444@adelaide.edu.au> Bump aiovodafone to 3.2.0 (home-assistant#170322) Add countdown number for Tuya sfkzq single-valve timers (home-assistant#170318) Allow setting hvac_mode in generic_thermostat.set_temperature (home-assistant#168062) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Z-Wave.me: Allow updating entities (home-assistant#167839) Fix MQTT device discovery not using shared QoS and encoding options (home-assistant#170195) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Google assistant temperature setting active thermostat mode (home-assistant#166448) Co-authored-by: Lucas Sanchez Sagrado <lucas.sansag@educa.jcyl.es> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Add quality scale to Tesla Fleet integration (home-assistant#160475) Co-authored-by: Claude <noreply@anthropic.com> Only use SmartThings switch for light if it should (home-assistant#166424) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Add quality scale file to Ness Alarm (home-assistant#163425) Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Fix Shelly media player availability (home-assistant#170319) Update discovery description wording (home-assistant#170325) Bump teltasync to 0.3.0, fix discovery for older devices (home-assistant#169660) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Complete exception translations for Indevolt (home-assistant#170291) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Add Kiosker switch platform (home-assistant#168858) Add `ZWaveNodeBaseEntity` for Z-Wave node-level entities (home-assistant#170124) Add number platform to eurotronic_cometblue (home-assistant#168119) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Note
This PR was created in alignment with @joostlek, who is aware of the changes and indicated that the PR could be submitted in its current form for review.
Breaking change
This PR removes the Duco temperature sensors from Home Assistant. If you currently use the removed temperature entities in dashboards, automations, statistics, or templates, you will need to remove or replace them with a more reliable temperature source. Although the previous integration exposed temperature values, further analysis showed that these readings can differ significantly from the actual room temperature because the sensors can sit close to heat-producing components or be mounted in walls where the surrounding material affects the measurement. Presenting those values as room temperatures is therefore misleading, so the entities are being removed.
Proposed change
This PR migrates the Duco integration from
python-duco-client==0.5.0topython-duco-connectivity==0.2.0and updates the integration code, diagnostics, system health, and tests to the new library API.It also removes the Duco box and node temperature entities on purpose. During further analysis it became clear that these values are not reliable enough to present as actual room temperatures because the physical sensor position can skew the readings, for example when a sensor is close to a chip that emits heat or when a unit is built into a wall that influences the measured value.
Removing those entities makes the integration less misleading for users, and the library migration establishes the cleaner, structured base that future Duco work in Home Assistant will build on.
Dependency release notes: https://github.com/ronaldvdmeer/python-duco-connectivity/releases/tag/v0.2.0
Type of change
Additional information
Checklist
ruff format 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.To help with the load of incoming pull requests: