starkillerOG / reolink_aio

Reolink NVR/camera API PyPI package
MIT License
79 stars 16 forks source link

adds timezone processing support to API. #23

Closed xannor closed 1 year ago

xannor commented 1 year ago

This adds parsing of the GetTime results.

get_timezone() provides a timezone from the currently loaded GetTime data, or None if missing.

get_time() provides an approximation of the current device time by using the local system time plus the host offset and then forcing it to be the device timezone

async_get_time() forces a GetTime status call first to ensure time settings are loaded and supported, then returns the results as the device time.

starkillerOG commented 1 year ago

@xannor I will be on vaccation for a week starting tomorrow. So unfortunately I will not be able to respond in the comming week. Hopefully we can merge this today, otherwise it will have to wait 1 week, sorry.

xannor commented 1 year ago

I am working on your suggestions, and I had a question. What are your thoughts on slots, I noticed you do not use them, and I have refrained from it to try to mach your current code style. However, for things like this, where the class could be hit many times, and should never have subclasses, I feel they would be warranted. What are your thoughts?

xannor commented 1 year ago

I am withdrawing this as I want to cleanup/redo this branch with some changed I need in my other branch that deals with the VOD_file and search parts. I should have made the smaller changes first, but hindsight. I will submit a new pull once I have it ready, I will submit the tz pull first then the vod pull when it is ready (it will somewhat depend on the tz changes (but only minor-ly)