Giter VIP home page Giter VIP logo

Comments (9)

brianmay avatar brianmay commented on August 24, 2024 1

For reference this is the code:

https://github.com/NirKli/teslamate/blob/f18e12a12c0f28dff7244928cbec0d1afa77861b/lib/teslamate_web/live/car_live/summary.html.heex#L153-L157

current_time = Timex.now()
finish_time = Timex.add(current_time, Timex.Duration.from_hours(@summary.time_to_full_charge))
local_timezone = Timex.Timezone.local()
local_finish_time = Timex.Timezone.convert(finish_time, local_timezone)
formatted_finish_time = Timex.format!(local_finish_time, "%Y-%m-%d %H:%M:%S", :strftime)

The documentation for Timex.Timezone.Local says it will use the TZ variable by default.

I believe that Timex.Timezone.local() is just a wrapper for Timex.Timezone.Local.

https://github.com/bitwalker/timex/blob/main/lib/timezone/timezone.ex#L44-L60

All of these explains why it should work. It doesn't explain why it isn't working.

It could be that there is a bug in the Timex.Timezone.Local.localtz(:osx) implementation. But it looks OK to me.

https://github.com/bitwalker/timex/blob/main/lib/timezone/local.ex#L74-L109

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on August 24, 2024 1

All car trips etc are correct times, too.

That's a different story as grafana uses your browser's timezone.

from teslamate.

PoppyS33d avatar PoppyS33d commented on August 24, 2024 1

Yep that was it. I didn't know I had to run:

docker compose up -d

Thanks for all the help. Solved now!

from teslamate.

PoppyS33d avatar PoppyS33d commented on August 24, 2024

I'm not really sure what's going on. I'm getting help over on TMC as well, and it's a very bizarre thing. Still not any closer to figuring out why it's being finicky for me!

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on August 24, 2024

Just to double-check: Your system time is correct?

from teslamate.

PoppyS33d avatar PoppyS33d commented on August 24, 2024

Yes, it's correct. All car trips etc are correct times, too.

from teslamate.

PoppyS33d avatar PoppyS33d commented on August 24, 2024

I see. Well, either way, correct system time. One thing that's peculiar that I can't figure out. I renamed the yml file and rebooted Docker, and TeslaMate still works. That would indicate that the yml I'm using is not the "right" one, yes? Well,

NAME STATUS CONFIG FILES
teslamate running(4) /Users/username/Documents/TeslaMate/docker-compose.yml

That's the only one I have, so.. I just don't get it. :(

from teslamate.

JakobLichterfeld avatar JakobLichterfeld commented on August 24, 2024

I renamed the yml file and rebooted Docker, and TeslaMate still works. That would indicate that the yml I'm using is not the "right" one, yes?

No, as soon as you deployed the docker compose stack you can potentially delete the yml file. Only when you want to change something, restart the containers etc. you need your compose specification.

from teslamate.

PoppyS33d avatar PoppyS33d commented on August 24, 2024

I renamed the yml file and rebooted Docker, and TeslaMate still works. That would indicate that the yml I'm using is not the "right" one, yes?

No, as soon as you deployed the docker compose stack you can potentially delete the yml file. Only when you want to change something, restart the containers etc. you need your compose specification.

I see. So is that why the TZ line change isn't doing anything? I added the line and restarted Docker, but that's apparently not enough.

from teslamate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.