Skip to content

Conversation

@joostlek
Copy link

https://docs.astral.sh/ruff/rules/call-datetime-now-without-tzinfo/

Not 100% sure of this fix, feel free to propose something else

Signed-off-by: Joostlek <[email protected]>
@pschmitt
Copy link
Owner

hm, while this might look good on paper but this has the potential of breaking roomba commands. I'd rather keep this on the ignore list.

These are different objects in the end as you can see here (GMT+1 here):

In [1]: import datetime

In [2]: datetime.datetime.now(tz=datetime.timezone.utc)
Out[2]: datetime.datetime(2024, 2, 21, 17, 22, 1, 48913, tzinfo=datetime.timezone.utc)

In [3]: datetime.datetime.now()
Out[3]: datetime.datetime(2024, 2, 21, 18, 22, 6, 525941)

@pschmitt
Copy link
Owner

So: this needs to get tested with (ideally several) roombas, I don't expect them to deal well with request from the future or the distant past.

@joostlek
Copy link
Author

As long as the timestamp is the same I don't really see any problem tbf

@joostlek
Copy link
Author

But I am just not sure what the roomba itself expects

@pschmitt
Copy link
Owner

yeah I glanced over the fact that we are timestamps here in the first place. My bad.
The ts should be same w/ or w/o tz.

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