From e7168e41ff1d0462ccbbaf481d3ddca649f11b1e Mon Sep 17 00:00:00 2001 From: BottlecapDave Date: Mon, 26 Aug 2024 19:36:11 +0100 Subject: [PATCH] fix: Fixed issue where target rate sensor could not be reconfigured if min/max rate were set (15 minutes dev time) --- _docs/setup/account.md | 2 +- _docs/setup/target_rate.md | 2 +- custom_components/octopus_energy/config_flow.py | 4 ++-- custom_components/octopus_energy/translations/en.json | 10 ++++++++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/_docs/setup/account.md b/_docs/setup/account.md index 69736cec..08e8fe3a 100644 --- a/_docs/setup/account.md +++ b/_docs/setup/account.md @@ -36,7 +36,7 @@ When calculating gas costs, a calorific value is included in the calculation. Un ## Pricing Caps -There has been inconsistencies across tariffs on whether government pricing caps are included or not. Therefore the ability to configure pricing caps has been added within you account. +There has been inconsistencies across tariffs on whether government pricing caps are included or not. Therefore the ability to configure pricing caps has been added within you account. This is configured in pounds and pence format (e.g. 0.12 for 12p). !!! info diff --git a/_docs/setup/target_rate.md b/_docs/setup/target_rate.md index d1429dcd..ab1b8037 100644 --- a/_docs/setup/target_rate.md +++ b/_docs/setup/target_rate.md @@ -116,7 +116,7 @@ If this is checked, then the normal behaviour of the sensor will be reversed. Th ### Minimum/Maximum Rates -There may be times that you want the target rate sensors to not take into account rates that are above or below a certain value (e.g. you don't want the sensor to turn on when rates go crazy or where it would be more beneficial to export). +There may be times that you want the target rate sensors to not take into account rates that are above or below a certain value (e.g. you don't want the sensor to turn on when rates go crazy or where it would be more beneficial to export). This is configured in pounds and pence format (e.g. 0.12 for 12p). !!! info diff --git a/custom_components/octopus_energy/config_flow.py b/custom_components/octopus_energy/config_flow.py index dc67e481..bc654271 100644 --- a/custom_components/octopus_energy/config_flow.py +++ b/custom_components/octopus_energy/config_flow.py @@ -534,8 +534,8 @@ async def __async_setup_target_rate_schema__(self, config, errors): CONFIG_TARGET_ROLLING_TARGET: is_rolling_target, CONFIG_TARGET_LAST_RATES: find_last_rates, CONFIG_TARGET_INVERT_TARGET_RATES: invert_target_rates, - CONFIG_TARGET_MIN_RATE: config[CONFIG_TARGET_MIN_RATE] if CONFIG_TARGET_MIN_RATE in config else None, - CONFIG_TARGET_MAX_RATE: config[CONFIG_TARGET_MAX_RATE] if CONFIG_TARGET_MAX_RATE in config else None, + CONFIG_TARGET_MIN_RATE: f'{config[CONFIG_TARGET_MIN_RATE]}' if CONFIG_TARGET_MIN_RATE in config else None, + CONFIG_TARGET_MAX_RATE: f'{config[CONFIG_TARGET_MAX_RATE]}' if CONFIG_TARGET_MAX_RATE in config else None, CONFIG_TARGET_WEIGHTING: config[CONFIG_TARGET_WEIGHTING] if CONFIG_TARGET_WEIGHTING in config else None, } ), diff --git a/custom_components/octopus_energy/translations/en.json b/custom_components/octopus_energy/translations/en.json index c8c8a1d4..756b0076 100644 --- a/custom_components/octopus_energy/translations/en.json +++ b/custom_components/octopus_energy/translations/en.json @@ -46,6 +46,11 @@ "minimum_rate": "The optional minimum rate for target hours", "maximum_rate": "The optional maximum rate for target hours", "weighting": "The optional weighting to apply to the discovered rates" + }, + "data_description": { + "hours": "This has to be a multiple of 0.5.", + "minimum_rate": "This is in pounds and pence (e.g. 0.12)", + "maximum_rate": "This is in pounds and pence (e.g. 0.12)" } }, "target_rate_account": { @@ -162,6 +167,11 @@ "minimum_rate": "The optional minimum rate for target hours", "maximum_rate": "The optional maximum rate for target hours", "weighting": "The optional weighting to apply to the discovered rates" + }, + "data_description": { + "hours": "This has to be a multiple of 0.5.", + "minimum_rate": "This is in pounds and pence (e.g. 0.12)", + "maximum_rate": "This is in pounds and pence (e.g. 0.12)" } }, "cost_tracker": {