METARMap icon indicating copy to clipboard operation
METARMap copied to clipboard

Add Dim Offset Time

Open nesincg opened this issue 3 years ago • 3 comments

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.

nesincg avatar Jan 30 '22 05:01 nesincg

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!

lynolamero avatar Jan 31 '22 23:01 lynolamero

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: @.***>

nesincg avatar Feb 01 '22 00:02 nesincg

Updated as described. Works well. Thanks Chris

lynolamero avatar Feb 01 '22 19:02 lynolamero

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

funk74 avatar Mar 01 '23 00:03 funk74