From 0e7200e8002f0c172a320860d45451d09b64e039 Mon Sep 17 00:00:00 2001 From: blakadder Date: Wed, 25 Aug 2021 18:32:22 +0200 Subject: [PATCH] Populate fan speed value in vacuum Fan speed value is usually empty until used so I added this to populate it --- custom_components/xiaomi_miot_raw/vacuum.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/xiaomi_miot_raw/vacuum.py b/custom_components/xiaomi_miot_raw/vacuum.py index b937dd2..f295f3a 100644 --- a/custom_components/xiaomi_miot_raw/vacuum.py +++ b/custom_components/xiaomi_miot_raw/vacuum.py @@ -230,3 +230,7 @@ def _handle_platform_specific_attrs(self): self._state = k except: pass + try: + self._fan_speed = self.get_key_by_value(self._ctrl_params['mode'],self._state_attrs.get(self._did_prefix + 'mode')) + except KeyError: + self._fan_speed = None