Skip to content

Conversation

@Le-Syl21
Copy link

This change adds two new ways to configure off-peak hours:

  1. Time ranges format: Allows specifying multiple time slots using a comma-separated format like "13:00-14:00,22:00-06:00" (similar to printer page selection)

  2. Entity-based detection: Allows using a binary_sensor, input_boolean, sensor, or calendar entity to dynamically determine off-peak periods. When the entity state is 'on', it's considered off-peak time.

The legacy single time format (e.g., "23:00") remains fully supported for backward compatibility.

Changes:

  • Add CONF_OFFPEAK_ENTITY_ID constant and time range parsing utilities
  • Update config schema to accept both new options
  • Refactor should_be_forced_offpeak to use new _is_currently_offpeak method
  • Add is_offpeak property for easy status checking
  • Update strings.json with new field descriptions
  • Add comprehensive tests for new functionality

This change adds two new ways to configure off-peak hours:

1. Time ranges format: Allows specifying multiple time slots using
   a comma-separated format like "13:00-14:00,22:00-06:00"
   (similar to printer page selection)

2. Entity-based detection: Allows using a binary_sensor, input_boolean,
   sensor, or calendar entity to dynamically determine off-peak periods.
   When the entity state is 'on', it's considered off-peak time.

The legacy single time format (e.g., "23:00") remains fully supported
for backward compatibility.

Changes:
- Add CONF_OFFPEAK_ENTITY_ID constant and time range parsing utilities
- Update config schema to accept both new options
- Refactor should_be_forced_offpeak to use new _is_currently_offpeak method
- Add is_offpeak property for easy status checking
- Update strings.json with new field descriptions
- Add comprehensive tests for new functionality
@jmcollin78
Copy link
Owner

Hello @Le-Syl21, thank you for this ! I will look at your PR later because I have many work to do with the Versatile Thermostat at this moment. Be patient and thank you, this look like promising.

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.

3 participants