Skip to content

Commit

Permalink
Re-add mapping parameter to MiotDevice ctor (rytilahti#985)
Browse files Browse the repository at this point in the history
Note that the method signature is different from previous versions to accommodate the compatibility with Device ctor
Fixes rytilahti#982
  • Loading branch information
rytilahti authored and xvlady committed May 9, 2021
1 parent 924b695 commit e32d87f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions miio/tests/test_miotdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ def dev(module_mocker):
return device


def test_ctor_mapping():
"""Make sure the constructor accepts the mapping parameter."""
dev = MiotDevice("127.0.0.1", "68ffffffffffffffffffffffffffffff")
assert dev.mapping is None

test_mapping = {}
dev2 = MiotDevice(
"127.0.0.1", "68ffffffffffffffffffffffffffffff", mapping=test_mapping
)
assert dev2.mapping == test_mapping


def test_get_property_by(dev):
siid = 1
piid = 2
Expand Down

0 comments on commit e32d87f

Please sign in to comment.