mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2025-03-11 13:21:25 +01:00
Update to use new enum
This commit is contained in:
parent
1ee792ff39
commit
3aa6da676a
@ -184,6 +184,12 @@ class ClimateMode(enum.IntEnum):
|
|||||||
HEAT = 3
|
HEAT = 3
|
||||||
|
|
||||||
|
|
||||||
|
class ClimateAction(enum.IntEnum):
|
||||||
|
OFF = 0
|
||||||
|
COOLING = 2
|
||||||
|
HEATING = 3
|
||||||
|
|
||||||
|
|
||||||
def _convert_climate_modes(value):
|
def _convert_climate_modes(value):
|
||||||
return [ClimateMode(val) for val in value]
|
return [ClimateMode(val) for val in value]
|
||||||
|
|
||||||
@ -197,12 +203,13 @@ class ClimateInfo(EntityInfo):
|
|||||||
visual_max_temperature = attr.ib(type=float)
|
visual_max_temperature = attr.ib(type=float)
|
||||||
visual_temperature_step = attr.ib(type=float)
|
visual_temperature_step = attr.ib(type=float)
|
||||||
supports_away = attr.ib(type=bool)
|
supports_away = attr.ib(type=bool)
|
||||||
|
supports_action = attr.ib(type=bool)
|
||||||
|
|
||||||
|
|
||||||
@attr.s
|
@attr.s
|
||||||
class ClimateState(EntityState):
|
class ClimateState(EntityState):
|
||||||
mode = attr.ib(type=ClimateMode, converter=ClimateMode)
|
mode = attr.ib(type=ClimateMode, converter=ClimateMode)
|
||||||
action = attr.ib(type=ClimateMode, converter=ClimateMode)
|
action = attr.ib(type=ClimateAction, converter=ClimateAction)
|
||||||
current_temperature = attr.ib(type=float)
|
current_temperature = attr.ib(type=float)
|
||||||
target_temperature = attr.ib(type=float)
|
target_temperature = attr.ib(type=float)
|
||||||
target_temperature_low = attr.ib(type=float)
|
target_temperature_low = attr.ib(type=float)
|
||||||
|
Loading…
Reference in New Issue
Block a user