Add deprecation database to prevent use of deprecated API paths #707
+1,377
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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