feat: Integrate py-opendisplay requirements & introduce library-backed BLEDeviceMetadata#33
Open
stuart-c-ai wants to merge 2 commits into
Open
feat: Integrate py-opendisplay requirements & introduce library-backed BLEDeviceMetadata#33stuart-c-ai wants to merge 2 commits into
stuart-c-ai wants to merge 2 commits into
Conversation
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.
This PR adds the
py-opendisplay==7.3.0library as a dependency and introduces a new implementation of theBLEDeviceMetadataclass that utilizes the library's models, while keeping the original implementation untouched.Context & Motivation
py-opendisplayPython library for BLE communications, allowing the custom component's local BLE implementation to be deprecated and removed in the future.custom_components/opendisplay/ble/metadata.pyfile completely untouched.BLEDeviceMetadataimplementation undercustom_components/opendisplay/metadata.py(outside theble/directory). This class dynamically deserializes the stored OpenDisplay configuration dictionary back intopy-opendisplayconfig dataclasses (GlobalConfig,DisplayConfig,PowerOption, etc.), acting as a seamless wrapper.BLEDeviceMetadatais fully backward-compatible with ATC (flat) devices and utilizesopendisplay.ColorSchemeas its color representation.Verification & Testing
tests/test_ble_metadata.pycomparing the new library-backed implementation side-by-side with the old implementation for both ATC (flat) and OpenDisplay (nested config) devices.