Skip to content

Commit

Permalink
Merge branch 'feature/acpartner-extended-status-container' into featu…
Browse files Browse the repository at this point in the history
…re/acpartner-socket-power-return-value-fix
  • Loading branch information
syssi committed Jan 5, 2019
2 parents f9864fb + 8b2aa2e commit 24adf7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion miio/airconditioningcompanion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
6 changes: 3 additions & 3 deletions miio/tests/test_airconditioningcompanion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 24adf7e

Please sign in to comment.