feat: add set_start_time and set_end_time to V1 timer traits#856
feat: add set_start_time and set_end_time to V1 timer traits#856allenporter wants to merge 2 commits into
Conversation
|
|
||
| async def set_end_time(self, end_time: datetime.time) -> None: | ||
| """Set the end time of the Do Not Disturb (DND) timer.""" | ||
| timer = DnDTimer( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I can play around with some tests later.
There was a problem hiding this comment.
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.
Expose new methods on V1 timer traits to update quiet/off-peak start and end times directly with datetime.time objects.