[viessmann] refactor channel commands and add units#20300
[viessmann] refactor channel commands and add units#20300lsiepel merged 27 commits intoopenhab:mainfrom
Conversation
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
…turesOfDevice method only in one handler Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
4186d6e to
9cd000f
Compare
|
@rogrun not sure if i asked before, but it would be appreciated if PR's are kept small, by seperating the bug fixes, refactoring and enhancements. This would make it simpler to review, backport, list changes in the release notes seperate and reduces the possibility of regressions. |
There was a problem hiding this comment.
Pull request overview
This PR refactors the command handling for the Viessmann binding's device channels and adds support for several new physical units. It introduces a more generic, data-driven approach to parsing API commands using the new FeatureCommand/FeatureCommandParams DTOs, replacing the previous hard-coded FeatureCommands class with a flexible Map<String, FeatureCommand>. It also adds support for hygiene functions, fixes holiday channel commands, and improves timezone-awareness for scheduling.
Changes:
- Replaces the monolithic
FeatureCommandsDTO with a generic map-basedFeatureCommandmodel and refactors the entire command dispatch pipeline inDeviceHandler - Adds new channel types for
watt-hour,kilowattpeak,volt,ampere,meter,degree,duration-minute,start-hour, andstart-minute; adds newStoredChannelValuesclass for state caching across command calls - Fixes holiday channel command handling and adds hygiene function support; uses openHAB's configured timezone via
ViessmannUtil.getOpenHABZoneId()replacingLocalTime.now()calls
Reviewed changes
Copilot reviewed 57 out of 57 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
thing-types.xml |
Adds new channel types for new units and bumps thing type version to 5 |
viessmann.properties |
Fills in blank i18n entries and adds command labels for hygiene mode values |
ViessmannUtil.java |
Replaces old resource-reading helpers with hyphenToCamel() and timezone-aware getOpenHABZoneId() |
JsonUtil.java + GsonJsonElementSerializer.java |
New Jackson-based JSON utilities for serializing Gson JsonElement trees (used for debug logging) |
ViessmannGatewayHandler.java |
Delegates feature-update logic to ViessmannAccountHandler, makes linkRegistry nullable |
ViessmannBridgeHandler.java |
Uses openHAB timezone for API call reset window |
ViessmannAccountHandler.java |
Centralizes feature-loading logic, injects installationId into FeatureDataDTO |
DeviceHandler.java |
Major refactor of command handling and feature update processing; adds hygiene and holiday support |
FeatureDataDTO.java |
Adds toPrettyJson() for anonymized debug output |
FeatureProperties.java |
Adds custom Gson deserializer for flexible/additional properties; adds new fields |
FeatureCommand.java + FeatureCommandParams.java + FeatureCommandParamType.java |
New generic command model |
StoredChannelValues.java |
New class to cache channel values for multi-param command assembly |
ThingMessageDTO.java |
Updated to use Map<String, FeatureCommand> |
ViessmannBindingConstants.java |
Adds new unit map entries and constants |
BindingServlet.java |
Null-safety fix for User-Agent header |
ViessmannApi.java |
Encoding and logging improvements |
| Various deleted DTO files | Removed granular command/parameter DTOs replaced by generic model |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ann/src/main/java/org/openhab/binding/viessmann/internal/dto/features/FeatureProperties.java
Show resolved
Hide resolved
...nding.viessmann/src/main/java/org/openhab/binding/viessmann/internal/util/ViessmannUtil.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/openhab/binding/viessmann/internal/dto/features/FeatureCommandParamType.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.viessmann/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
.../src/main/java/org/openhab/binding/viessmann/internal/dto/features/FeatureCommandParams.java
Show resolved
Hide resolved
...c/main/java/org/openhab/binding/viessmann/internal/dto/features/FeatureCommandParamType.java
Outdated
Show resolved
Hide resolved
...ng.viessmann/src/main/java/org/openhab/binding/viessmann/internal/handler/DeviceHandler.java
Show resolved
Hide resolved
...ng.viessmann/src/main/java/org/openhab/binding/viessmann/internal/handler/DeviceHandler.java
Show resolved
Hide resolved
bundles/org.openhab.binding.viessmann/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.viessmann/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
…rams Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
@lsiepel Thanks for the reminder. I’ll try to keep future PRs smaller and separate bug fixes, refactorings and enhancements where possible to make reviews and backports easier. |
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
...nn/src/main/java/org/openhab/binding/viessmann/internal/handler/ViessmannGatewayHandler.java
Outdated
Show resolved
Hide resolved
...nding.viessmann/src/main/java/org/openhab/binding/viessmann/internal/util/ViessmannUtil.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
Co-authored-by: lsiepel <leosiepel@gmail.com> Signed-off-by: Ronny Grun <ronny.grun@t-online.de>
This PR has following changes: