Skip to content

Commit

Permalink
fix(binary-sensor): Fixed text of rolling_target to reflect behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
BottlecapDave committed Oct 2, 2022
1 parent 6594ede commit 4840ff3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ You may want your target rate sensors to turn on a period of time before the opt

Depending on how you're going to use the sensor, you might want the best period to be found throughout the day so it's always applicable. For example, you might be using the sensor to turn on a washing machine which you might want to come on at the best time regardless of when you use the washing machine.

However, you might only want the target time to occur once a day so once the best time for that day has passed it won't turn on again. For example, you might be using the sensor to turn on something that isn't time critical and could wait till the next day like a charger.
However, you might also only want the target time to occur once a day so once the best time for that day has passed it won't turn on again. For example, you might be using the sensor to turn on something that isn't time critical and could wait till the next day like a charger.

This feature is toggled on/off by the `Limit to once a day` checkbox.
This feature is toggled on by the `Re-evaluate multiple times a day` checkbox.

### Gas Meters

Expand Down
1 change: 1 addition & 0 deletions custom_components/octopus_energy/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def is_on(self):
if CONFIG_TARGET_END_TIME in self._config:
end_time = self._config[CONFIG_TARGET_END_TIME]

# True by default for backwards compatibility
is_rolling_target = True
if CONFIG_TARGET_ROLLING_TARGET in self._config:
is_rolling_target = self._config[CONFIG_TARGET_ROLLING_TARGET]
Expand Down
1 change: 1 addition & 0 deletions custom_components/octopus_energy/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ async def __async_setup_target_rate_schema(self, config, errors):
if (CONFIG_TARGET_OFFSET in config):
offset = config[CONFIG_TARGET_OFFSET]

# True by default for backwards compatibility
is_rolling_target = True
if (CONFIG_TARGET_ROLLING_TARGET in config):
is_rolling_target = config[CONFIG_TARGET_ROLLING_TARGET]
Expand Down
4 changes: 2 additions & 2 deletions custom_components/octopus_energy/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"Start time": "The minimum time to start the device",
"End time": "The maximum time to stop the device",
"offset": "The offset to apply to the scheduled block to be considered active",
"rolling_target": "Limit to once a day"
"rolling_target": "Re-evaluate multiple times a day"
}
}
},
Expand Down Expand Up @@ -54,7 +54,7 @@
"Start time": "The minimum time to start the device",
"End time": "The maximum time to stop the device",
"offset": "The offset to apply to the scheduled block to be considered active",
"rolling_target": "Limit to once a day"
"rolling_target": "Re-evaluate multiple times a day"
}
}
},
Expand Down

0 comments on commit 4840ff3

Please sign in to comment.