Giter Site home page Giter Site logo

Comments (5)

ChristianTremblay avatar ChristianTremblay commented on August 22, 2024 1

Can you try

bacnet = BAC0.lite()
bacnet.timehandler.set_timezone("America/Costa_Rica")

from bac0.

geckotronic avatar geckotronic commented on August 22, 2024

Thanks Christian,

I apologize if I wasn't clear before. I encounter the error when calling BAC0.lite() and cannot proceed to set the timezone.

SCR-20240318-gypz

Here are the steps I'm following to reproduce the error:

  • I set my computer's time zone to either UTC or America/Costa_Rica (a timezone without daylight saving).
  • I set my computer's clock to 2:15 am on March 10, 2024.
  • I attempt to initialize BAC0 with bacnet = BAC0.lite().

I assume the failure occurs because, although my computer's time zone does not depend on daylight saving, initializing the library consider the America/Montreal zone, where that hour (2:15am 10March24) would not exist.

Is there a way to change the timezone before initializing the library, perhaps as a parameter at the start? Or could it possibly take the system's time zone?

If I change the initialization inside the library's code to America/Costa_Rica (inside TimeHandler class), the problem disappears, but I would prefer not to edit the library and instead make the change externally.

Thank you very much.

from bac0.

ChristianTremblay avatar ChristianTremblay commented on August 22, 2024

Can you test cloning the master branch and pip install it ? I just modified it to add the arg timezone

and use :

import BAC0
bacnet = BAC0.lite(timezone="America/Costa_Rica")

from bac0.

ChristianTremblay avatar ChristianTremblay commented on August 22, 2024

By the way, I've added that to the new async version that use bacpypes3 that you can try also. Look for branch Async

This will replace the actual version of BAC0 soon

from bac0.

geckotronic avatar geckotronic commented on August 22, 2024

Omg!, thanks Christian. this works perfect!

from bac0.

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.