Skip to content

Improve Device helpers#1932

Merged
iMicknl merged 3 commits intov2/mainfrom
v2/device_improvements
Jan 31, 2026
Merged

Improve Device helpers#1932
iMicknl merged 3 commits intov2/mainfrom
v2/device_improvements

Conversation

@iMicknl
Copy link
Owner

@iMicknl iMicknl commented Jan 31, 2026

Small changes to the helpers to have better naming and more aligned to what Home Assistant needs

@iMicknl iMicknl requested a review from tetienne as a code owner January 31, 2026 22:06
Copilot AI review requested due to automatic review settings January 31, 2026 22:06
Copy link
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 refactors the Device helper methods to provide better naming and clearer semantics for Home Assistant integration. The changes split existing list-based helper methods into two variants: single-item methods (using "get", "has", or "supports" prefixes) and list-based methods (using "select_first" or "any" suffixes).

Changes:

  • Added single-item variants of helper methods that accept a single parameter instead of a list (e.g., get_state_value(state), supports_command(command))
  • Renamed list-based methods to use "select_first" or "any" naming to clearly indicate they work with lists (e.g., select_first_state_value(states), supports_any_command(commands))
  • Updated all tests to use the new method names and added test coverage for the new single-item methods
  • Updated documentation with examples demonstrating both single-item and list-based usage patterns

Reviewed changes

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

File Description
pyoverkiz/models.py Refactored Device class helper methods to split single-item and list-based variants with clearer naming
tests/test_models.py Updated all test cases to use new method names and added comprehensive tests for new single-item methods
docs/device-control.md Updated documentation examples to demonstrate both single-item and list-based helper method usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iMicknl iMicknl merged commit 6d06fff into v2/main Jan 31, 2026
8 checks passed
@iMicknl iMicknl deleted the v2/device_improvements branch January 31, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant