feat: expose device_type on PyViCareDeviceConfig#698
Open
lackas wants to merge 2 commits intoopenviess:masterfrom
Open
feat: expose device_type on PyViCareDeviceConfig#698lackas wants to merge 2 commits intoopenviess:masterfrom
lackas wants to merge 2 commits intoopenviess:masterfrom
Conversation
Pass deviceType from API response through to PyViCareDeviceConfig, allowing users to filter devices by type. Adds: - device_type property on PyViCareDeviceConfig - getDeviceType() method - isGateway() convenience method This helps users who have multiple devices (e.g., gateway + heating) where the API may return them in unpredictable order. Fixes openviess#565
PyViCareDeviceConfig is a data-holding class where the number of constructor parameters is appropriate for its purpose.
Contributor
Author
|
Fixed the pylint failure by adding an inline disable comment. If you'd prefer a different approach, I'm happy to refactor to use a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
deviceTypefrom API response through toPyViCareDeviceConfiggetDeviceType()method anddevice_typepropertyisGateway()convenience methodMotivation
Fixes #565 - The Viessmann API may return devices in unpredictable order. Users with multiple devices (e.g., gateway + heating) using
devices[0]may get unexpected results when the gateway appears first.With this change, users can filter devices by type:
Test plan
getDeviceType()andisGateway()