From 3aaa896720e5756e8dc8320a8aa5288d7d82d13e Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Tue, 8 May 2018 21:50:30 +0200 Subject: [PATCH] Air Conditioning Companion led property fixed --- miio/airconditioningcompanion.py | 4 ++-- miio/tests/test_airconditioningcompanion.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/miio/airconditioningcompanion.py b/miio/airconditioningcompanion.py index ddaa8540b..4539f48d4 100644 --- a/miio/airconditioningcompanion.py +++ b/miio/airconditioningcompanion.py @@ -34,7 +34,7 @@ class Power(enum.Enum): class Led(enum.Enum): On = '0' - Off = 'a' + Off = 'A' STORAGE_SLOT_ID = 30 @@ -107,7 +107,7 @@ def power(self) -> str: @property def led(self) -> str: """Current LED state.""" - return 'on' if (int(self.data[1][8:9]) == Led.On.value) else 'off' + return 'on' if (self.data[1][8:9] == Led.On.value) else 'off' @property def is_on(self) -> bool: diff --git a/miio/tests/test_airconditioningcompanion.py b/miio/tests/test_airconditioningcompanion.py index 64ec34f19..2a60cc657 100644 --- a/miio/tests/test_airconditioningcompanion.py +++ b/miio/tests/test_airconditioningcompanion.py @@ -14,7 +14,7 @@ class DummyAirConditioningCompanion(AirConditioningCompanion): def __init__(self, *args, **kwargs): - self.state = ['010500978022222102', '010201190280222221', '2'] + self.state = ['010500978022222102', '01020119A280222221', '2'] self.return_values = { 'get_model_and_state': self._get_state,