mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
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
@ -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…
x
Reference in New Issue
Block a user