From d6f464b4aef32ec6304c948529481b3c7da66efe Mon Sep 17 00:00:00 2001 From: Chaoscontrol Date: Mon, 2 Dec 2024 14:23:37 +0000 Subject: [PATCH] Checking for 1 as a string to fix the binary sensor --- custom_components/leafspy/binary_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/leafspy/binary_sensor.py b/custom_components/leafspy/binary_sensor.py index 9ef6de8..52b6af8 100644 --- a/custom_components/leafspy/binary_sensor.py +++ b/custom_components/leafspy/binary_sensor.py @@ -31,7 +31,7 @@ class LeafSpyBinarySensorDescription(BinarySensorEntityDescription): translation_key="power_switch_state", device_class=BinarySensorDeviceClass.POWER, value_fn=lambda data: data.get("PwrSw"), - transform_fn=lambda x: x == 1, + transform_fn=lambda x: x == '1', icon="mdi:power", ) ]