From b22098044a12e725df884789857e4f9dc5903e99 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Wed, 28 Oct 2020 10:30:31 +0100 Subject: [PATCH] cv.positive_float isn't available --- custom_components/xiaomi_miio_plug/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/xiaomi_miio_plug/switch.py b/custom_components/xiaomi_miio_plug/switch.py index 5d65ea6..d5f83ad 100644 --- a/custom_components/xiaomi_miio_plug/switch.py +++ b/custom_components/xiaomi_miio_plug/switch.py @@ -94,7 +94,7 @@ ) SERVICE_SCHEMA_POWER_PRICE = SERVICE_SCHEMA.extend( - {vol.Required(ATTR_PRICE): cv.positive_float} + {vol.Required(ATTR_PRICE): vol.All(vol.Coerce(float), vol.Range(min=0))} ) SERVICE_TO_METHOD = {