From e1d48de157062a23759f0f6600ca36ef651b26ae Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sat, 29 Jun 2019 20:57:25 +0200 Subject: [PATCH] Add particular swing mode values of a chigo air conditioner (Closes: #518) (#519) --- miio/airconditioningcompanion.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/miio/airconditioningcompanion.py b/miio/airconditioningcompanion.py index a1c98868e..c330a1017 100644 --- a/miio/airconditioningcompanion.py +++ b/miio/airconditioningcompanion.py @@ -35,10 +35,12 @@ class FanSpeed(enum.Enum): class SwingMode(enum.Enum): - On = 0 - Off = 1 - Unknown2 = 2 - Unknown7 = 7 + On = '0' + Off = '1' + Unknown2 = '2' + Unknown7 = '7' + ChigoOn = 'C' + ChigoOff = 'D' class Power(enum.Enum): @@ -212,7 +214,7 @@ def target_temperature(self) -> Optional[int]: def swing_mode(self) -> Optional[SwingMode]: """Current swing mode.""" try: - mode = int(self.state[5:6]) + mode = self.state[5:6] return SwingMode(mode) except TypeError: return None