prueker / METARMap

Raspberry Pi project to visualize flight conditions on a map using WS8211 LEDs addressed via NeoPixel
MIT License
119 stars 72 forks source link

Add Dim Offset Time #29

Closed nesincg closed 1 year ago

nesincg commented 2 years ago

Add a variable to change the amount of time after sunrise and the amount of time before sunset that the lights change brightness. IOW. At sunrise, it's still pretty dark, so leave it dim for DIM_OFFSET_TIME.

lynolamero commented 2 years ago

Need some help with this one:

pi@METAR-MAP:~ $ sudo python3 metar.py Running metar.py at 31/01/2022 15:00 LocationInfo(name='Seattle', region='USA', timezone='US/Pacific', latitude=47.6, longitude=-122.31666666666666)

Traceback (most recent call last): File "metar.py", line 83, in ast = astral.Astral() AttributeError: module 'astral' has no attribute 'Astral'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "metar.py", line 105, in BRIGHT_TIME_START = (sun['sunrise'] + timedelta(minutes=DIM_OFFSET_TIME)).time() NameError: name 'timedelta' is not defined

-----astral was loaded already-------- Requirement already satisfied: astral in /usr/local/lib/python3.7/dist-packages (2.2) Requirement already satisfied: pytz in /usr/local/lib/python3.7/dist-packages (from astral) (2020.4)

Any help would be appreciated. Thanks!

nesincg commented 2 years ago

Crap. I forgot this in the top just under import datetime

from datetime import timedelta

On Mon, Jan 31, 2022, 18:57 lynolamero @.***> wrote:

Need some help with this one:

@.***:~ $ sudo python3 metar.py Running metar.py at 31/01/2022 15:00 LocationInfo(name='Seattle', region='USA', timezone='US/Pacific', latitude=47.6, longitude=-122.31666666666666)

Traceback (most recent call last): File "metar.py", line 83, in ast = astral.Astral() AttributeError: module 'astral' has no attribute 'Astral'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "metar.py", line 105, in BRIGHT_TIME_START = (sun['sunrise'] + timedelta(minutes=DIM_OFFSET_TIME)).time() NameError: name 'timedelta' is not defined

-----astral was loaded already-------- Requirement already satisfied: astral in /usr/local/lib/python3.7/dist-packages (2.2) Requirement already satisfied: pytz in /usr/local/lib/python3.7/dist-packages (from astral) (2020.4)

Any help would be appreciated. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/prueker/METARMap/pull/29#issuecomment-1026330156, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASC3AF52S75VWI53WSGA72LUY4OXPANCNFSM5NDZSZ3Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

lynolamero commented 2 years ago

Updated as described. Works well. Thanks Chris

funk74 commented 1 year ago

Anyone know how to make the lights dim based on each airports sunset time?