Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time zone awareness #25

Open
moeffju opened this issue Apr 8, 2018 · 2 comments
Open

Time zone awareness #25

moeffju opened this issue Apr 8, 2018 · 2 comments

Comments

@moeffju
Copy link

moeffju commented Apr 8, 2018

I’m using eq3bt with home assistant. Home assistant has been using UTC time internally since 2015, and hassbian is also pre-configured for UTC. There is no way to pass a time zone in to eq3bt as far as I can tell, so the times are off by the TZ difference (in my case, UTC vs CEST = 2 hours). Home Assistant configures a time zone and handles time zones correctly internally, but as it cannot pass that data to eq3bt, the thermostats get the system time (which is in UTC). As a result, all programmed schedules are off.

All methods using datetime.now would need to be extended to take a time zone parameter, or time zone could be made global. The callers need to pass in a time zone. If none is given, system timezone could still be used, but a warning should probably be given to the user.

@rytilahti
Copy link
Owner

I think the the constructor could accept an optional timezone, that way it is easier to handle than adjusting it separately per method. Having a warning is also a good idea, I'm open for PRs.

@renarena
Copy link

renarena commented Nov 24, 2021

I have the same problem - wrong time if i integrate thermostats into homeassistant (per bt-mqtt-gateway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants