markgdev / home-assistant_OctopusAgile

Octopus Agile custom component for Home Assistant
Apache License 2.0
89 stars 32 forks source link

Suggestion - convert to unix timestamp on reading API #21

Closed borpin closed 1 year ago

borpin commented 4 years ago

https://github.com/markgdev/home-assistant_OctopusAgile/blob/51dba6f542304b5200f78abdbde42a99df4bcf87/OctopusAgile/Agile.py#L224

I suggest at this point, convert the datetime from the API to a Unix timestamp (replace Z with +00:00 and use fromISO). It will save lots of strfrtime calls throughout your code and should avoid timezone issues. As a general principle, it is always best to store data with Unix timestamps.