diff --git a/miio/airconditioningcompanion.py b/miio/airconditioningcompanion.py index 2c0c18db1..04c49d23e 100644 --- a/miio/airconditioningcompanion.py +++ b/miio/airconditioningcompanion.py @@ -144,32 +144,32 @@ def air_condition_brand(self) -> int: """ Brand of the air conditioner. - Known brand ids (int) are 0182, 0097, 0037, 0202, 02782, 0197, 0192. + Known brand ids are 0x0182, 0x0097, 0x0037, 0x0202, 0x02782, 0x0197, 0x0192. """ - return int(self.air_condition_model[2:4].hex()) + return int(self.air_condition_model[2:4].hex(), 16) @property def air_condition_remote(self) -> int: """ - Known remote ids (int): + Known remote ids: - 80111111, 80111112 (brand: 182) - 80222221 (brand: 97) - 80333331 (brand: 37) - 80444441 (brand: 202) - 80555551 (brand: 2782) - 80777771 (brand: 197) - 80666661 (brand: 192) + 0x80111111, 0x80111112 (brand: 0x0182) + 0x80222221 (brand: 0x0097) + 0x80333331 (brand: 0x0037) + 0x80444441 (brand: 0x0202) + 0x80555551 (brand: 0x2782) + 0x80777771 (brand: 0x0197) + 0x80666661 (brand: 0x0192) """ - return int(self.air_condition_model[4:8].hex()) + return int(self.air_condition_model[4:8].hex(), 16) @property def state_format(self) -> int: """ Version number of the state format. - Known values (int) are: 01, 02, 03 + Known values are: 1, 2, 3 """ return int(self.air_condition_model[8]) diff --git a/miio/tests/test_airconditioningcompanion.py b/miio/tests/test_airconditioningcompanion.py index f5c6d0173..c4f184655 100644 --- a/miio/tests/test_airconditioningcompanion.py +++ b/miio/tests/test_airconditioningcompanion.py @@ -138,8 +138,8 @@ def test_status(self): bytes.fromhex('010500978022222102') assert self.state().model_format == 1 assert self.state().device_type == 5 - assert self.state().air_condition_brand == 97 - assert self.state().air_condition_remote == 80222221 + assert self.state().air_condition_brand == int('0097', 16) + assert self.state().air_condition_remote == int('80222221', 16) assert self.state().state_format == 2 assert self.state().air_condition_configuration == '020119A2' assert self.state().target_temperature == 25 @@ -287,8 +287,8 @@ def test_status(self): bytes.fromhex('010507950000257301') assert self.state().model_format == 1 assert self.state().device_type == 5 - assert self.state().air_condition_brand == 795 - assert self.state().air_condition_remote == 2573 + assert self.state().air_condition_brand == int('0795', 16) + assert self.state().air_condition_remote == int('00002573', 16) assert self.state().state_format == 1 assert self.state().air_condition_configuration == '10011601' assert self.state().target_temperature == 22