From 28da8c474cf6802f1bc8628d5bd20f15407440d2 Mon Sep 17 00:00:00 2001 From: cvroque <65680394+cvroque@users.noreply.github.com> Date: Tue, 23 Nov 2021 19:32:03 -0300 Subject: [PATCH] Check if Tuya Vacuum (sd) is able to report status directly before using pause switch (#59888) --- homeassistant/components/tuya/vacuum.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/tuya/vacuum.py b/homeassistant/components/tuya/vacuum.py index 25596da01b5..5602413615c 100644 --- a/homeassistant/components/tuya/vacuum.py +++ b/homeassistant/components/tuya/vacuum.py @@ -131,7 +131,9 @@ class TuyaVacuumEntity(TuyaEntity, StateVacuumEntity): @property def state(self) -> str | None: """Return Tuya vacuum device state.""" - if self.device.status.get(DPCode.PAUSE): + if self.device.status.get(DPCode.PAUSE) and not ( + self.device.status.get(DPCode.STATUS) + ): return STATE_PAUSED if not (status := self.device.status.get(DPCode.STATUS)): return None