Skip to content

Commit

Permalink
Add particular swing mode values of a chigo air conditioner (Closes: r…
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Jun 6, 2019
1 parent 0f8f608 commit 185dc0c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions miio/airconditioningcompanion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 185dc0c

Please sign in to comment.