Consolidating shared device logic and adding new entities. - #207
Closed
dn5qMDW3 wants to merge 7 commits into
Closed
Consolidating shared device logic and adding new entities.#207dn5qMDW3 wants to merge 7 commits into
dn5qMDW3 wants to merge 7 commits into
Conversation
…nfigurations. - Added `diagnostics.py` with diagnostic support for PETLIBRO. - Introduced `create_platform_setup` for reducing boilerplate in platform setups. - Consolidated duplicate setup code across select, text, updates, and number platforms. - Refined imports and removed redundant imports for cleaner code structure. - Added `reconfigure` flow and dependencies to `strings.json` and `manifest.json`. - Simplified platform specification in `__init__.py`.
… updated action versions
…into a base class (`Feeder`) and removing redundant code.
…ndling, and add new properties/sensors for fountains.
…sed attributes and adding `configuration_url`.
…ew sensors for Polar Wet Food Feeder, and refactor device-specific properties.
…device properties, and update translations.
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.
Proposed change:
This PR consolidates shared device logic into base classes, adds new entities, introduces diagnostics support, and removes unused code
DRY refactor:
Feederbase class and shared fountain properties intoFountainbase class._cached_request()helper inapi.pywith 10s TTL deduplication (9 methods reduced to 2-3 lines each).Device.refresh()now namespaces results (realInfo,getAttributeSetting) to eliminate redundant API calls.create_platform_setup()factory to reduce boilerplate across all 8 entity platforms.New entities:
Bug fixes:
availableproperty referencing non-existentself.devicein 10 device subclasses.set_child_lock,set_light_enable,set_sound_enablecalling.raise_for_status()on parsed JSON.set_light_on/set_light_offdefinitions inapi.py(second used wrong field names).child_lock_switchin OneRFIDSmartFeeder (inverted logic removed).set_feeding_planin 3 feeder files.power_statenot handlingpowerType=1(DC adapter) in Dockstream 2 fountains.["DRINK"]).Device.refresh()overwriting device name with empty string frombaseInfo.datetime.utcnow()withdatetime.now(timezone.utc)(12 occurrences).Other improvements:
diagnostics.pyfor device debugging support.configuration_url, and minimum HA version (2025.4.0).entity_pictureon all entities.validate.ymlCI with scheduled runs and updated action versions.Closes # (issue)
Type of change:
Major codebase refactor: consolidated shared device logic into base classes, removed dead code/modules, modernized API layer.
Checklist:
Additional notes:
2025.4.0._cached_request()with 10-second TTL to reduce duplicate calls.entity_picturenow shows device product icons on all entities.