mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-03-10 10:39:57 +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:
|
if mode not in name_to_value:
|
||||||
raise ValueError("Invalid waterlevel %s, available %s", mode, name_to_value)
|
raise ValueError("Invalid waterlevel %s, available %s", mode, name_to_value)
|
||||||
|
|
||||||
settings = self._settings.copy()
|
return await self.call(
|
||||||
settings["cistern"] = name_to_value[mode]
|
"setCleanAttr",
|
||||||
return await self.call("setCleanAttr", settings)
|
{"cistern": name_to_value[mode], "type": "global"},
|
||||||
|
)
|
||||||
|
|||||||
@@ -45,10 +45,9 @@ async def test_mop_waterlevel(dev: SmartDevice, mocker: MockerFixture):
|
|||||||
new_level = Waterlevel.High
|
new_level = Waterlevel.High
|
||||||
await mop_module.set_waterlevel(new_level.name)
|
await mop_module.set_waterlevel(new_level.name)
|
||||||
|
|
||||||
params = mop_module._settings.copy()
|
call.assert_called_with(
|
||||||
params["cistern"] = new_level.value
|
"setCleanAttr", {"cistern": new_level.value, "type": "global"}
|
||||||
|
)
|
||||||
call.assert_called_with("setCleanAttr", params)
|
|
||||||
|
|
||||||
await dev.update()
|
await dev.update()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user