From 9feabcf36426be4e9bc2c5b9b00996da377f5d14 Mon Sep 17 00:00:00 2001 From: magnuselden Date: Fri, 21 Jun 2024 20:14:06 +0200 Subject: [PATCH] scheduler fixes --- custom_components/peaqev/manifest.json | 2 +- custom_components/peaqev/peaqservice/hub/price_aware_hub.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/peaqev/manifest.json b/custom_components/peaqev/manifest.json index d28e25bb..59c5728d 100644 --- a/custom_components/peaqev/manifest.json +++ b/custom_components/peaqev/manifest.json @@ -26,7 +26,7 @@ "iot_class": "calculated", "issue_tracker": "https://github.com/elden1337/hass-peaq/issues", "requirements": [ - "peaqevcore==19.10.15" + "peaqevcore==19.10.23" ], "version": "3.6.1b0" } diff --git a/custom_components/peaqev/peaqservice/hub/price_aware_hub.py b/custom_components/peaqev/peaqservice/hub/price_aware_hub.py index db37ce26..517e6f8f 100644 --- a/custom_components/peaqev/peaqservice/hub/price_aware_hub.py +++ b/custom_components/peaqev/peaqservice/hub/price_aware_hub.py @@ -27,6 +27,8 @@ def scheduler_options_handler(self) -> SchedulerOptionsHandler: @property def current_peak_dynamic(self): """Dynamically calculated peak to adhere to caution-hours""" + if self.hours.scheduler.active: + return self.sensors.current_peak.observed_peak dynamic_caution_hours: dict = self._request_sensor_lookup().get(LookupKeys.DYNAMIC_CAUTION_HOURS, {})() if len(dynamic_caution_hours) > 0: if self.now_is_caution_hour() and not getattr(self.hours.timer, 'is_override', False):