mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Gracefully handle missing preset mode in Tuya fan (#62996)
This commit is contained in:
parent
497bfc1c8f
commit
084e81f827
@ -160,9 +160,9 @@ class TuyaFanEntity(TuyaEntity, FanEntity):
|
||||
return self.ha_preset_modes
|
||||
|
||||
@property
|
||||
def preset_mode(self) -> str:
|
||||
def preset_mode(self) -> str | None:
|
||||
"""Return the current preset_mode."""
|
||||
return self.device.status[DPCode.MODE]
|
||||
return self.device.status.get(DPCode.MODE)
|
||||
|
||||
@property
|
||||
def percentage(self) -> int | None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user