Skip to content

feat: add set_start_time and set_end_time to V1 timer traits#856

Draft
allenporter wants to merge 2 commits into
Python-roborock:mainfrom
allenporter:feat/start-time-timer-traits
Draft

feat: add set_start_time and set_end_time to V1 timer traits#856
allenporter wants to merge 2 commits into
Python-roborock:mainfrom
allenporter:feat/start-time-timer-traits

Conversation

@allenporter

Copy link
Copy Markdown
Contributor

Expose new methods on V1 timer traits to update quiet/off-peak start and end times directly with datetime.time objects.

@allenporter allenporter marked this pull request as draft June 26, 2026 16:04
@allenporter allenporter marked this pull request as ready for review June 26, 2026 16:07

async def set_end_time(self, end_time: datetime.time) -> None:
"""Set the end time of the Do Not Disturb (DND) timer."""
timer = DnDTimer(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we be checking if by chance self.start_hour or minute is None here? That's the root of the bug Paulus was having right? same thing above?

@allenporter allenporter Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, sure. Once we check them for None what are you expecting to happen? Send in zeros or nulls? (i believe this is current behavior) or send nothing? lie to the caller and set end time on the trait without sending the RPC?

@Lash-L Lash-L Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So I think it shouldn't be possible to set a DND end time without passing in a start time. I'd have to test it but it seems like it would be wrong. i.e. if DND is somehow None, then the start time should be set before the end time.

Although, start time would be broken then, as the same issue could happen there.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I can play around with some tests later.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Okay confirmed @allenporter

Vacuum will respond with '-10005: At least 1 parameter is not number' if any of the keys are None.

So we have to make sure we don't send None, maybe we need one more function that allows setting start and end time at the same time? I'm not sure if start/end will ever be None? My gut assumption would be that they default to some value, but I don't have proof for that.

@allenporter allenporter marked this pull request as draft July 4, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants