Add TURN_OFF/TURN_ON feature flags for fan (#121447)
This commit is contained in:
parent
172778053c
commit
ca4c617d4b
58 changed files with 858 additions and 132 deletions
|
@ -15,9 +15,15 @@ PRESET_MODE_SLEEP = "sleep"
|
|||
PRESET_MODE_ON = "on"
|
||||
|
||||
FULL_SUPPORT = (
|
||||
FanEntityFeature.SET_SPEED | FanEntityFeature.OSCILLATE | FanEntityFeature.DIRECTION
|
||||
FanEntityFeature.SET_SPEED
|
||||
| FanEntityFeature.OSCILLATE
|
||||
| FanEntityFeature.DIRECTION
|
||||
| FanEntityFeature.TURN_OFF
|
||||
| FanEntityFeature.TURN_ON
|
||||
)
|
||||
LIMITED_SUPPORT = (
|
||||
FanEntityFeature.SET_SPEED | FanEntityFeature.TURN_OFF | FanEntityFeature.TURN_ON
|
||||
)
|
||||
LIMITED_SUPPORT = FanEntityFeature.SET_SPEED
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
|
@ -75,7 +81,9 @@ async def async_setup_entry(
|
|||
hass,
|
||||
"fan5",
|
||||
"Preset Only Limited Fan",
|
||||
FanEntityFeature.PRESET_MODE,
|
||||
FanEntityFeature.PRESET_MODE
|
||||
| FanEntityFeature.TURN_OFF
|
||||
| FanEntityFeature.TURN_ON,
|
||||
[
|
||||
PRESET_MODE_AUTO,
|
||||
PRESET_MODE_SMART,
|
||||
|
@ -92,6 +100,7 @@ class BaseDemoFan(FanEntity):
|
|||
|
||||
_attr_should_poll = False
|
||||
_attr_translation_key = "demo"
|
||||
_enable_turn_on_off_backwards_compatibility = False
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue