jabesq-org / pyatmo

Simple API to access Netatmo weather station data from any python script (for Netatmo information, see www.netatmo.com)
MIT License
27 stars 29 forks source link

Enhance schedule handling and cooling #511

Closed cgtobi closed 2 months ago

cgtobi commented 2 months ago

Summary by Sourcery

Enhance the schedule handling and cooling features by introducing new properties and methods for managing boiler status, setpoint modes, and HVAC actions. Implement a new ScheduleType enum and improve schedule selection logic. Refactor code for better readability and update pre-commit configuration.

New Features:

Enhancements:

Build:

Tests:

sourcery-ai[bot] commented 2 months ago

Reviewer's Guide by Sourcery

This pull request enhances schedule handling and cooling functionality in the pyatmo library. It introduces new properties and methods for better management of schedules, improves type hinting, and removes unnecessary comments. The changes also include updates to constants, error handling, and minor refactoring across multiple files.

File-Level Changes

Change Details Files
Enhanced schedule handling with new ScheduleType enum and related properties
  • Added ScheduleType enum to represent different schedule types
  • Updated Schedule class with new attributes like type, default, and cooling_away_temp
  • Implemented get_available_schedules method in Home class
  • Modified get_selected_schedule method to consider temperature control mode
src/pyatmo/schedule.py
src/pyatmo/home.py
Improved cooling functionality and HVAC action determination
  • Added new properties to Room class: boiler_status, setpoint_mode, setpoint_temperature, and hvac_action
  • Implemented logic to determine HVAC action based on various conditions
  • Added new constants for HEATING, COOLING, and IDLE states
src/pyatmo/room.py
src/pyatmo/const.py
Refactored and improved type hinting across multiple files
  • Removed unnecessary type comments and noqa statements
  • Updated function signatures with proper type hints
  • Simplified boolean parameter defaults
src/pyatmo/modules/module.py
src/pyatmo/account.py
src/pyatmo/auth.py
src/pyatmo/modules/base_class.py
src/pyatmo/helpers.py
src/pyatmo/modules/device_types.py
src/pyatmo/modules/netatmo.py
Updated constants and removed redundant definitions
  • Added new constants for schedule types and HVAC states
  • Removed redundant ON and OFF constants
  • Reorganized and grouped related constants
src/pyatmo/const.py
Minor improvements and updates
  • Updated ruff-pre-commit hook version
  • Modified test fixture to use 'cooling' type for a schedule
  • Removed unnecessary comments in testing_main_template.py
.pre-commit-config.yaml
fixtures/homesdata.json
tests/testing_main_template.py

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.