Open trail-coffee opened 8 months ago
Oh, interesting. I had parsed the time using
timestamp = int.from_bytes(bytes(raw_char_read[1:5]))
self.time = datetime.datetime.fromtimestamp(timestamp, datetime.UTC)
This appears to print the correct time for me.
Oh, yours is basically the exact same thing except with struct_time
rather than datetime
.
It's interesting that the value is stored as epoch but set as a string.
Works for me! I have no problems with using struct_time
here rather than datetime
, so I'm happy to say ship it.
Works for me! I have no problems with using
struct_time
here rather thandatetime
, so I'm happy to say ship it.
I'm new to python so if struct_time is going to be weird to python people, i'll change it.
Added time functions based on these captures
Set command (ignore the "R..", part of packet header):
Packet used in refresh_data function:
0x54 is the time header, 6579 7405 is the time, convert that to decimal is 1702458373, which would be December 13, 2023 9:06:13 AM. Hatch looks like it's in epoch seconds in local time and not UTC, so python is a bit confused by it.