Skip to content

Pooldose: Add select platform#159240

Merged
joostlek merged 5 commits into
home-assistant:devfrom
lmaertin:pooldose-add-select
Dec 18, 2025
Merged

Pooldose: Add select platform#159240
joostlek merged 5 commits into
home-assistant:devfrom
lmaertin:pooldose-add-select

Conversation

@lmaertin
Copy link
Copy Markdown
Contributor

@lmaertin lmaertin commented Dec 16, 2025

Breaking change

Proposed change

This PR adds a select platform to the pooldose integration with 8 select entities for configuring pool device settings.

  • Added select platform with entities for:
    • Water meter unit (m³, L)
    • Flow rate unit (m³/h, L/s)
    • pH/ORP/Chlorine dosing type (acid/base, dosing set selection)
    • pH/ORP/Chlorine dosing method (proportional, timed, on_off)
  • Implemented unit conversion between HA units (m³) and API values (m3) using `REVERSE_UNIT_MAPPING`
  • Added comprehensive test suite with 9 tests covering all functionality
  • Added translations and icons for all select entities
  • Some config entities are hidden by default (entity_registry_enabled_default=False)

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a select platform to the pooldose integration, introducing 8 select entities for configuring pool device settings such as water meter units, flow rate units, and dosing types/methods for pH, ORP, and chlorine systems. The implementation includes unit conversion between Home Assistant's display units (e.g., m³) and the API's internal values (e.g., m3), comprehensive test coverage with 9 test cases, and proper translations with icons.

Key Changes

  • Added select platform with 8 configurable entities for pool device settings
  • Implemented unit conversion logic using a new REVERSE_UNIT_MAPPING dictionary for translating HA units to API values
  • Refactored sensor platform naming from use_dynamic_unit to use_unit_conversion for consistency

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
homeassistant/components/pooldose/select.py New select platform implementation with 8 entity descriptions and unit conversion support
homeassistant/components/pooldose/const.py Added REVERSE_UNIT_MAPPING for HA-to-API unit conversion and updated comment clarity
homeassistant/components/pooldose/sensor.py Renamed use_dynamic_unit to use_unit_conversion for consistent terminology
homeassistant/components/pooldose/__init__.py Registered SELECT platform in PLATFORMS list
homeassistant/components/pooldose/strings.json Added translations for all 8 select entities with state mappings
homeassistant/components/pooldose/icons.json Added icon mappings for all select entities
tests/components/pooldose/test_select.py Comprehensive test suite with 9 tests covering entity creation, state changes, unavailability, and unit conversion
tests/components/pooldose/snapshots/test_select.ambr Snapshot data for select entity validation
tests/components/pooldose/fixtures/instantvalues.json Added fixture data for all 8 select entities
tests/components/pooldose/conftest.py Added set_select mock method to support testing

Comment thread homeassistant/components/pooldose/select.py Outdated
Comment thread homeassistant/components/pooldose/select.py
Comment thread homeassistant/components/pooldose/select.py
Comment thread tests/components/pooldose/test_select.py Outdated
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant Bot marked this pull request as draft December 18, 2025 16:26
@lmaertin lmaertin marked this pull request as ready for review December 18, 2025 22:12
@home-assistant home-assistant Bot requested a review from joostlek December 18, 2025 22:12
@joostlek joostlek merged commit 74baf44 into home-assistant:dev Dec 18, 2025
36 checks passed
@lmaertin lmaertin deleted the pooldose-add-select branch December 19, 2025 22:26
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants