From 8e44d797a33e78c65c9c8202b11b44ea421d97bf Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Thu, 11 Jun 2020 22:37:07 -0400 Subject: [PATCH] Fix ZHA Metering channel formatting method (#36697) Since zigpy change to support bitmap classes, formatting string was incorrectly generated for the newly joined devices with SmartEnergy metering clusters. --- homeassistant/components/zha/core/channels/smartenergy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/zha/core/channels/smartenergy.py b/homeassistant/components/zha/core/channels/smartenergy.py index 525ba45c806..2e9b69be069 100644 --- a/homeassistant/components/zha/core/channels/smartenergy.py +++ b/homeassistant/components/zha/core/channels/smartenergy.py @@ -128,7 +128,7 @@ class Metering(ZigbeeChannel): "demand_formatting", 0xF9 ) # 1 digit to the right, 15 digits to the left - r_digits = fmting & 0x07 # digits to the right of decimal point + r_digits = int(fmting & 0x07) # digits to the right of decimal point l_digits = (fmting >> 3) & 0x0F # digits to the left of decimal point if l_digits == 0: l_digits = 15