diff --git a/miio/airconditioningcompanion.py b/miio/airconditioningcompanion.py index a751bd954..a1c98868e 100644 --- a/miio/airconditioningcompanion.py +++ b/miio/airconditioningcompanion.py @@ -483,4 +483,4 @@ def status(self) -> AirConditioningCompanionStatus: status = self.send("get_model_and_state") power_socket = self.send("get_device_prop", ["lumi.0", "plug_state"]) return AirConditioningCompanionStatus(dict( - model_and_state=status, power_socket=power_socket)) + model_and_state=status, power_socket=power_socket[0])) diff --git a/miio/tests/test_airconditioningcompanion.py b/miio/tests/test_airconditioningcompanion.py index c4f184655..d58d1e311 100644 --- a/miio/tests/test_airconditioningcompanion.py +++ b/miio/tests/test_airconditioningcompanion.py @@ -211,7 +211,7 @@ def test_send_configuration(self): class DummyAirConditioningCompanionV3(AirConditioningCompanionV3): def __init__(self, *args, **kwargs): self.state = ['010507950000257301', '011001160100002573', '807'] - self.device_prop = {'lumi.0': {'plug_state': 'on'}} + self.device_prop = {'lumi.0': {'plug_state': ['on']}} self.model = MODEL_ACPARTNER_V3 self.last_ir_played = None @@ -241,7 +241,7 @@ def _get_device_prop(self, props): def _toggle_plug(self, props): """Toggle the lumi.0 plug state""" - self.device_prop['lumi.0']['plug_state'] = props.pop() + self.device_prop['lumi.0']['plug_state'] = [props.pop()] @pytest.fixture(scope="class") @@ -277,7 +277,7 @@ def test_status(self): assert repr(self.state()) == repr(AirConditioningCompanionStatus(dict( model_and_state=self.device.start_state, - power_socket=self.device.start_device_prop['lumi.0']['plug_state']) + power_socket=self.device.start_device_prop['lumi.0']['plug_state'][0]) )) assert self.is_on() is True