enkama / hass-variables

Home Assistant variables component
89 stars 12 forks source link

Use local timezone in helpers #105

Closed sermayoral closed 8 months ago

sermayoral commented 8 months ago

Partially fixes #104

Snuffy2 commented 8 months ago

I'd advise NOT doing this. Times entered without a timezone should default to UTC. To use a local time, specify the desired timezone in the timestamp. Admittedly the timezone cannot be set when creating the initial value of a timestamp, but we could look to add this if needed.

sermayoral commented 8 months ago

OK. I have done it this way because, when you initialize a time in the helper, your instinct does it in local time. For me it is strange (and wrong) to set 11:00 (local) and finally have that time be different. Internally Home Assistant stores it in UTC, but it matches the local time that you have set.

But it's just an opinion. If you don't agree, that's fine. We are looking for another way to do it :-)