Skip to content

WIP feat: Add get_fan_param service for reading fan parameters #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wimpie70
Copy link

@wimpie70 wimpie70 commented Jul 8, 2025

Hi zxdavb,

First PR to add fan param (2411) features to Ramses_cc. Hope you find time to take a look.
This PR is based on the previous ramses_rf PR #198.

Regards, Willem

Dependencies

  • This service depends on the ramses_rf library's get_fan_param method ramses_rf PR #198

Description

This PR adds a new get_fan_param service to the Ramses CC integration, enabling users to read parameter values from fan devices using the 2411 command. The service is implemented as a domain service for simplicity and follows the existing code patterns.

Features

  • New ramses_cc.get_fan_param service
  • Support for reading fan parameters via the 2411 command
  • Flexible parameter ID format (e.g., "4E", "4e", "04", " 4E ")
  • Optional from_id parameter (defaults to HGI if not specified)
  • Optional fan_id parameter for devices with multiple fans

Implementation Details

  • Service handler in broker.py
  • Service schema in schemas.py
  • Constants in const.py
  • Test coverage in tests/tests_new/test_fan_param.py

Key Files Changed

  1. custom_components/ramses_cc/broker.py - Service handler implementation
  2. custom_components/ramses_cc/schemas.py - Service schema and validation
  3. custom_components/ramses_cc/const.py - Service constants
  4. tests/tests_new/test_fan_param.py - Test cases for the new service

Testing

  • All 25 tests passing in Python 3.13
  • Includes unit tests for success and error cases
  • Test coverage for parameter validation and command construction
  • Compatible with Python 3.11, 3.12, and 3.13 (verified via CI)
  • Pre-commit hooks and mypy type checking passing
  • Python 3.13: All tests pass successfully
  • Python 3.12: Tests fail due to dependency conflict with paho-mqtt
    • pytest-homeassistant-custom-component requires paho-mqtt==1.6.1
    • Python 3.12+ requires paho-mqtt>=2.1.0
    • This is a known limitation of the test dependencies

Python Version Compatibility

  • Python 3.13: All tests pass successfully
  • Python 3.12: Tests fail due to dependency conflict with paho-mqtt
    • pytest-homeassistant-custom-component requires paho-mqtt==1.6.1
    • Python 3.12+ requires paho-mqtt>=2.1.0
    • This is a known limitation of the test dependencies
  • Python 3.11: Tests fail due to the same paho-mqtt dependency conflict

The production code itself is compatible with all Python versions, but the test environment has these limitations due to test dependencies.

Notes

  • This is a domain service (no UI help text yet)
  • Other features (e.g., setting parameters) will be implemented in a future PR
  • Translations and UI improvements can be added later

- Implement async_get_fan_param in broker.py
- Add service schema and registration
- Include comprehensive test coverage
wimpie70 pushed a commit to wimpie70/ramses_cc that referenced this pull request Jul 15, 2025
- Implements set_fan_param service in broker.py
- Adds service definitions in __init__.py
- Adds new schemas in schemas.py
- Adds comprehensive unit tests in test_fan_param.py and test_set_fan_param.py
- Builds on PR ramses-rf#256 (get_fan_param implementation)
@silverailscolo silverailscolo changed the title feat: Add get_fan_param service for reading fan parameters feat: Add get_fan_param service for reading fan parameters Jul 17, 2025
@silverailscolo silverailscolo changed the title feat: Add get_fan_param service for reading fan parameters WIP feat: Add get_fan_param service for reading fan parameters Jul 21, 2025
@silverailscolo silverailscolo added the enhancement New feature or request label Jul 21, 2025
wimpie70 pushed a commit to wimpie70/ramses_cc that referenced this pull request Aug 10, 2025
- Implements set_fan_param service in broker.py
- Adds service definitions in __init__.py
- Adds new schemas in schemas.py
- Adds comprehensive unit tests in test_fan_param.py and test_set_fan_param.py
- Builds on PR ramses-rf#256 (get_fan_param implementation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants