chore: add deprecation database to prevent use of deprecated API paths#707
Conversation
Maintain a persistent database (tests/deprecated_features.json) of known deprecated Viessmann API features, merged from test response data and fresh device dumps. This prevents us from accidentally adding new code that uses deprecated API paths. - check_deprecations.py: reports deprecated features used in code, keeps the database up to date, and ingests fresh device dumps - test_deprecatedProperties now also checks the database, catching deprecations not marked in test data (e.g. heating.cop.green) - Each entry records firstSeenIn/firstSeenOn for provenance tracking
|
Is data that is added on a PR validated (--update) automatically? Maybe we can have something similar to this: https://github.com/openviess/PyViCare/blob/master/.github/workflows/format.yml |
|
Not yet, but good idea — I'll add a CI workflow similar to |
Add a job to the format workflow that runs check_deprecations.py --update and verifies the database stays in sync when test data changes.
|
The CI job is failing because |
|
Good point! Fixed — |
|
The git diff issue is fixed now. The remaining CI failure is from the 5 deprecated ventilation features still used in code (tracked in #708) — |

Summary
This adds a deprecation database and tooling to prevent accidentally adding code that uses deprecated Viessmann API paths — saving review effort by catching these issues before a PR is submitted.
Background
During review of #689, @CFenner pointed out that some features might be deprecated. Looking into it, I found that I had accidentally added a getter for
heating.cop.green, which is deprecated (replaced byheating.cop.photovoltaic, removal 2025-12-31). The existingtest_deprecatedPropertiestest didn't warn me because the test response data for that device doesn't include thedeprecatedmarker — it was only visible in a fresh API dump. I wanted to improve this so deprecated features are caught automatically before submitting a PR.What this adds
tests/deprecated_features.json— A persistent database of 106 known deprecated features, merged from all test response files and fresh device dumps. Each entry records:removalDateand replacement info from the APIfirstSeenIn/firstSeenOn— provenance tracking (which file first reported it, when)sources— all files that confirm the deprecationcheck_deprecations.py— A developer tool that:--update)--update dump.json) and highlights newly discovered deprecationsrooms.*.sensors.window.openState (24x))Enhanced
test_deprecatedProperties— Now also checks the database, so deprecations known from any source (not just what's marked in test data) are caught in CI.How fresh dumps help
A feature deprecated in one API response is deprecated everywhere — but not all test data files include the
deprecatedmarker (older dumps, or devices that don't expose it). Fresh dumps, even for devices that already have test data, can reveal deprecations missing from existing data. You don't need to commit the full dump — just run:This extracts only the deprecation info into the database. I checked all dumps attached to open PRs (#645, #667, #695, #696) and they don't contain new deprecation info beyond what's already in the database.
Example output