Skip to content
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

Enhance generic_thermostat with min/max run time and cooldown time. #136298

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from

Conversation

esand
Copy link

@esand esand commented Jan 23, 2025

Proposed change

The generic_thermostat has a minimum cycle duration that only reacts to temp change events and doesn't prevent the thermostat from being toggled without delay. The description provided with said setting is also misleading and doesn't convey that it is only effective for temp changes.

These changes repurposes and enhances the minimum cycle duration setting (renamed to minimum run time) and introduces two new settings to the generic_thermostat. In all, the three main changes are that there is now a minimum run time, maximum run time, and a cooldown time setting.

The minimum run time setting ensures that once the generic_thermostat is on, it must stay on until at least the specified time has passed. The maximum run time setting does something similar and ensures that the thermostat cannot stay on for more than the configured time. Finally, the cooldown time setting ensures that the specified amount of time is passed in an off state before being turned on again.

The purpose to these settings is to introduce duty cycle type features to the generic_thermostat, as all sorts of devices could be attached to it that may require such control (to ensure safety and lifespan of the devices).

Finally, these changes are backwards compatible - it will automatically migrate an existing minimum cycle duration setting to the new minimum run time and cooldown time (effectively providing the exact same functionality). As well, these settings only affect the generic_thermostat control itself for changing state between on and off; it does not prevent the attached switch device from being manually controlled if required.

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • 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.

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

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

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

Hi @esand

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@esand esand marked this pull request as ready for review January 25, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant