From 1f1ca6f0b25b4b8cb6ec78f70fc0d48cc57baba1 Mon Sep 17 00:00:00 2001 From: dala318 Date: Mon, 29 Jan 2024 18:26:00 +0000 Subject: [PATCH] Allow negative accept cost and rate --- custom_components/nordpool_planner/binary_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/nordpool_planner/binary_sensor.py b/custom_components/nordpool_planner/binary_sensor.py index 1d8259c..1088954 100644 --- a/custom_components/nordpool_planner/binary_sensor.py +++ b/custom_components/nordpool_planner/binary_sensor.py @@ -51,10 +51,10 @@ def optional_entity_id(value: Any) -> str: ), vol.Optional(VAR_DURATION_ENTITY, default=""): optional_entity_id, vol.Optional(ACCEPT_COST, default=0.0): vol.All( - vol.Coerce(float), vol.Range(min=0.0, max=10000.0) + vol.Coerce(float), vol.Range(min=-10000.0, max=10000.0) ), vol.Optional(ACCEPT_RATE, default=0.0): vol.All( - vol.Coerce(float), vol.Range(min=0.0, max=10000.0) + vol.Coerce(float), vol.Range(min=-10000.0, max=10000.0) ), # Moving planner exclusives vol.Exclusive(MOVING, TYPE_GROUP, msg=TYPE_DUPLICATE_MSG): {