Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
export default {
extends: ["@commitlint/config-conventional"],
ignores: [(msg) => /Signed-off-by: dependabot\[bot]/m.test(msg)],
ignores: [
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated change, but i think worthwhile

(msg) => /Signed-off-by: dependabot\[bot]/m.test(msg),
(msg) => /Co-authored-by:.*Copilot/m.test(msg)
],
rules: {
// Disable the rule that enforces lowercase in subject
"subject-case": [0], // 0 = disable, 1 = warn, 2 = error
Expand Down
3 changes: 3 additions & 0 deletions roborock/data/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def end_time(self) -> datetime.time | None:
else None
)

def as_list(self) -> list:
return [self.start_hour, self.start_minute, self.end_hour, self.end_minute]

def __repr__(self) -> str:
return _attr_repr(self)

Expand Down
17 changes: 4 additions & 13 deletions roborock/devices/traits/v1/do_not_disturb.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def is_on(self) -> bool:

async def set_dnd_timer(self, dnd_timer: DnDTimer) -> None:
"""Set the Do Not Disturb (DND) timer settings of the device."""
await self.rpc_channel.send_command(RoborockCommand.SET_DND_TIMER, params=dnd_timer.as_dict())
await self.rpc_channel.send_command(RoborockCommand.SET_DND_TIMER, params=dnd_timer.as_list())

async def clear_dnd_timer(self) -> None:
"""Clear the Do Not Disturb (DND) timer settings of the device."""
Expand All @@ -27,18 +27,9 @@ async def enable(self) -> None:
"""Set the Do Not Disturb (DND) timer settings of the device."""
await self.rpc_channel.send_command(
RoborockCommand.SET_DND_TIMER,
params={
**self.as_dict(),
_ENABLED_PARAM: 1,
},
params=self.as_list(),
)

async def disable(self) -> None:
"""Set the Do Not Disturb (DND) timer settings of the device."""
await self.rpc_channel.send_command(
RoborockCommand.SET_DND_TIMER,
params={
**self.as_dict(),
_ENABLED_PARAM: 0,
},
)
"""Disable the Do Not Disturb (DND) timer settings of the device."""
await self.rpc_channel.send_command(RoborockCommand.CLOSE_DND_TIMER)
13 changes: 3 additions & 10 deletions roborock/devices/traits/v1/valley_electricity_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def is_on(self) -> bool:

async def set_timer(self, timer: ValleyElectricityTimer) -> None:
"""Set the Valley Electricity Timer settings of the device."""
await self.rpc_channel.send_command(RoborockCommand.SET_VALLEY_ELECTRICITY_TIMER, params=timer.as_dict())
await self.rpc_channel.send_command(RoborockCommand.SET_VALLEY_ELECTRICITY_TIMER, params=timer.as_list())

async def clear_timer(self) -> None:
"""Clear the Valley Electricity Timer settings of the device."""
Expand All @@ -28,18 +28,11 @@ async def enable(self) -> None:
"""Enable the Valley Electricity Timer settings of the device."""
await self.rpc_channel.send_command(
RoborockCommand.SET_VALLEY_ELECTRICITY_TIMER,
params={
**self.as_dict(),
_ENABLED_PARAM: 1,
},
params=self.as_list(),
)

async def disable(self) -> None:
"""Disable the Valley Electricity Timer settings of the device."""
await self.rpc_channel.send_command(
RoborockCommand.SET_VALLEY_ELECTRICITY_TIMER,
params={
**self.as_dict(),
_ENABLED_PARAM: 0,
},
RoborockCommand.CLOSE_VALLEY_ELECTRICITY_TIMER,
)
Loading