mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-03-10 02:30:09 +00:00
Fix mop set_waterlevel sending setCleanAttr without type field (#1667)
Some checks failed
CI / Perform Lint Checks (3.13) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
Some checks failed
CI / Perform Lint Checks (3.13) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
This commit is contained in:
@@ -85,6 +85,7 @@ class Mop(SmartModule):
|
||||
if mode not in name_to_value:
|
||||
raise ValueError("Invalid waterlevel %s, available %s", mode, name_to_value)
|
||||
|
||||
settings = self._settings.copy()
|
||||
settings["cistern"] = name_to_value[mode]
|
||||
return await self.call("setCleanAttr", settings)
|
||||
return await self.call(
|
||||
"setCleanAttr",
|
||||
{"cistern": name_to_value[mode], "type": "global"},
|
||||
)
|
||||
|
||||
@@ -45,10 +45,9 @@ async def test_mop_waterlevel(dev: SmartDevice, mocker: MockerFixture):
|
||||
new_level = Waterlevel.High
|
||||
await mop_module.set_waterlevel(new_level.name)
|
||||
|
||||
params = mop_module._settings.copy()
|
||||
params["cistern"] = new_level.value
|
||||
|
||||
call.assert_called_with("setCleanAttr", params)
|
||||
call.assert_called_with(
|
||||
"setCleanAttr", {"cistern": new_level.value, "type": "global"}
|
||||
)
|
||||
|
||||
await dev.update()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user