From 3aa6da676a9c143810f2d8cc41b489c6156ce396 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Thu, 17 Oct 2019 21:25:54 +0200 Subject: [PATCH] Update to use new enum --- aioesphomeapi/model.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aioesphomeapi/model.py b/aioesphomeapi/model.py index f985865..a8d7a45 100644 --- a/aioesphomeapi/model.py +++ b/aioesphomeapi/model.py @@ -184,6 +184,12 @@ class ClimateMode(enum.IntEnum): HEAT = 3 +class ClimateAction(enum.IntEnum): + OFF = 0 + COOLING = 2 + HEATING = 3 + + def _convert_climate_modes(value): return [ClimateMode(val) for val in value] @@ -197,12 +203,13 @@ class ClimateInfo(EntityInfo): visual_max_temperature = attr.ib(type=float) visual_temperature_step = attr.ib(type=float) supports_away = attr.ib(type=bool) + supports_action = attr.ib(type=bool) @attr.s class ClimateState(EntityState): 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) target_temperature = attr.ib(type=float) target_temperature_low = attr.ib(type=float)