Add action
attribute to Humidifier entity (#95131)
* Add HumidifierAction StrEnum * Add action attribute to HumidifierEntity * Update strings.json * Add action to demo humidifier * Add tests * Fix imports * Add 'off' humidifier action * Set action to 'off' when state is 'off' * Add 'off' action to strings.json * Test that action sets to "off" when state is "off" * Use is_on instead of state * Fix typo * black
This commit is contained in:
parent
8b6ed9c6b9
commit
ae21ab2945
5 changed files with 44 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
|||
"""Provides the constants needed for component."""
|
||||
from enum import IntFlag
|
||||
|
||||
from homeassistant.backports.enum import StrEnum
|
||||
|
||||
MODE_NORMAL = "normal"
|
||||
MODE_ECO = "eco"
|
||||
MODE_AWAY = "away"
|
||||
|
@ -11,6 +13,17 @@ MODE_SLEEP = "sleep"
|
|||
MODE_AUTO = "auto"
|
||||
MODE_BABY = "baby"
|
||||
|
||||
|
||||
class HumidifierAction(StrEnum):
|
||||
"""Actions for humidifier devices."""
|
||||
|
||||
HUMIDIFYING = "humidifying"
|
||||
DRYING = "drying"
|
||||
IDLE = "idle"
|
||||
OFF = "off"
|
||||
|
||||
|
||||
ATTR_ACTION = "action"
|
||||
ATTR_AVAILABLE_MODES = "available_modes"
|
||||
ATTR_CURRENT_HUMIDITY = "current_humidity"
|
||||
ATTR_HUMIDITY = "humidity"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue