Check if Tuya Vacuum (sd) is able to report status directly before using pause switch (#59888)
This commit is contained in:
parent
ac3dc0b090
commit
28da8c474c
1 changed files with 3 additions and 1 deletions
|
@ -131,7 +131,9 @@ class TuyaVacuumEntity(TuyaEntity, StateVacuumEntity):
|
||||||
@property
|
@property
|
||||||
def state(self) -> str | None:
|
def state(self) -> str | None:
|
||||||
"""Return Tuya vacuum device state."""
|
"""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
|
return STATE_PAUSED
|
||||||
if not (status := self.device.status.get(DPCode.STATUS)):
|
if not (status := self.device.status.get(DPCode.STATUS)):
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Reference in a new issue