From dcbe2136cfe0fdf3bc4096107ca560bc0cb0d7d5 Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Mon, 1 Jun 2020 09:24:56 -0400 Subject: [PATCH] Fix ZHA electrical measurement sensor (#36327) --- .../components/zha/core/channels/homeautomation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/zha/core/channels/homeautomation.py b/homeassistant/components/zha/core/channels/homeautomation.py index b295a567b3d..2601cf47573 100644 --- a/homeassistant/components/zha/core/channels/homeautomation.py +++ b/homeassistant/components/zha/core/channels/homeautomation.py @@ -75,7 +75,6 @@ class ElectricalMeasurementChannel(ZigbeeChannel): async def async_initialize(self, from_cache): """Initialize channel.""" - await self.get_attribute_value("active_power", from_cache=from_cache) await self.fetch_config(from_cache) await super().async_initialize(from_cache) @@ -90,9 +89,11 @@ class ElectricalMeasurementChannel(ZigbeeChannel): ], from_cache=from_cache, ) - self._divisor = results.get("ac_power_divisor", results.get("power_divisor", 1)) + self._divisor = results.get( + "ac_power_divisor", results.get("power_divisor", self._divisor) + ) self._multiplier = results.get( - "ac_power_multiplier", results.get("power_multiplier", 1) + "ac_power_multiplier", results.get("power_multiplier", self._multiplier) ) @property