From 72b2e19ecf27120122d6401e62005996bb1595fb Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:44 +0100 Subject: [PATCH 01/54] add devcontainer config to repo --- .devcontainer/devcontainer.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..094eb68 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "Python 3", + "image": "python:3.9-bullseye", + + // This is the settings.json mount + "mounts": ["source=/c/temp/settings_test.json,target=/boot/settings.json,type=bind,consistency=cached"], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip3 install --user -r requirements.txt", + + // We want to connect as root. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root", + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python" + ] + } + } +} From 563154ba358a3fb1c6a2dc8babf04b2c552163db Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:44 +0100 Subject: [PATCH 02/54] small devcontainer cleanup --- .devcontainer/devcontainer.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 094eb68..1b65fe2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,16 +1,14 @@ // For format details, see https://aka.ms/devcontainer.json. { - "name": "Python 3", + "name": "Inkycal-dev", "image": "python:3.9-bullseye", // This is the settings.json mount "mounts": ["source=/c/temp/settings_test.json,target=/boot/settings.json,type=bind,consistency=cached"], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --user -r requirements.txt", + "postCreateCommand": "pip3 install --upgrade pip && pip3 install --user -r requirements.txt", - // We want to connect as root. More info: https://aka.ms/dev-containers-non-root. - "remoteUser": "root", "customizations": { "vscode": { "extensions": [ From 62bb0f600e09300fb31376f40337642d94270793 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:45 +0100 Subject: [PATCH 03/54] first improvements for larger fontsizes --- inkycal/modules/inkycal_weather.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inkycal/modules/inkycal_weather.py b/inkycal/modules/inkycal_weather.py index ec639bf..28d184a 100644 --- a/inkycal/modules/inkycal_weather.py +++ b/inkycal/modules/inkycal_weather.py @@ -243,6 +243,8 @@ class Weather(inkycal_module): # Draw the text in the text-box draw = ImageDraw.Draw(image) + print(f"Box width: {box_width}, Box height: {box_height}") + # TODO: fix ValueError: Width and height must be >= 0 space = Image.new('RGBA', (box_width, box_height)) ImageDraw.Draw(space).text((x, y), text, fill='black', font=font) @@ -272,7 +274,9 @@ class Weather(inkycal_module): else: logger.info('Please consider decreasing the height.') row_height = int((im_height * (1 - im_height / im_width)) / 3) - + + _, text_height = self.font.getsize("Text") + row_height = max(row_height, text_height) logger.debug(f"row_height: {row_height} | col_width: {col_width}") # Calculate spacings for better centering @@ -374,6 +378,7 @@ class Weather(inkycal_module): # Get current time now = arrow.utcnow() + now = now.to("local") if self.forecast_interval == 'hourly': From 7cac3fd19511af860b7c4eff1da5469efd9cec40 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:45 +0100 Subject: [PATCH 04/54] - improve devcontainer setup - add openweather web scraper module --- .devcontainer/Dockerfile | 10 +++ .devcontainer/devcontainer.json | 10 ++- .devcontainer/postCreate.sh | 2 + inkycal/modules/inkycal_openweather_scrape.py | 75 +++++++++++++++++++ requirements.txt | 30 +++++++- 5 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/postCreate.sh create mode 100644 inkycal/modules/inkycal_openweather_scrape.py diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..658ac30 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.9-slim-bullseye +WORKDIR /usr/src/app +RUN apt-get -y update && apt-get install -yqq dos2unix chromium chromium-driver \ + libxi6 libgconf-2-4 python3-selenium \ + tzdata git +RUN git config --global --add safe.directory /usr/src/app +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --user virtualenv +ENV TZ=Europe/Berlin +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1b65fe2..121d9bc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,18 +1,22 @@ // For format details, see https://aka.ms/devcontainer.json. { "name": "Inkycal-dev", - "image": "python:3.9-bullseye", + "build": { + "dockerfile": "Dockerfile" + }, // This is the settings.json mount "mounts": ["source=/c/temp/settings_test.json,target=/boot/settings.json,type=bind,consistency=cached"], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "pip3 install --upgrade pip && pip3 install --user -r requirements.txt", + "postCreateCommand": "chmod +x ./.devcontainer/postCreate.sh && ./.devcontainer/postCreate.sh", "customizations": { "vscode": { "extensions": [ - "ms-python.python" + "ms-python.python", + "ms-python.black-formatter", + "ms-azuretools.vscode-docker" ] } } diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh new file mode 100644 index 0000000..6041923 --- /dev/null +++ b/.devcontainer/postCreate.sh @@ -0,0 +1,2 @@ +#!/bin/bash +source ./venv/Scripts/activate && pip3 install --upgrade pip && pip3 install --user -r requirements.txt \ No newline at end of file diff --git a/inkycal/modules/inkycal_openweather_scrape.py b/inkycal/modules/inkycal_openweather_scrape.py new file mode 100644 index 0000000..1e652fa --- /dev/null +++ b/inkycal/modules/inkycal_openweather_scrape.py @@ -0,0 +1,75 @@ +from PIL import Image +from PIL import ImageEnhance +from selenium import webdriver +from selenium.common.exceptions import ElementClickInterceptedException +from selenium.webdriver.chrome.options import Options +from selenium.webdriver.chrome.service import Service +from selenium.webdriver.common.by import By +from selenium.webdriver.support.wait import WebDriverWait + +import time + +# Set the desired viewport size (width, height) +my_width = 480 +my_height = 850 +mobile_emulation = { + "deviceMetrics": { "width": my_width, "height": my_height, "pixelRatio": 1.0 }, + "userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" +} + +# Create an instance of the webdriver with some pre-configured options +options = Options() +options.add_argument("--no-sandbox") +options.add_argument("--headless=new") +#options.add_argument("--disable-gpu") +options.add_argument("--disable-dev-shm-usage") +options.add_experimental_option("mobileEmulation", mobile_emulation) +service = Service("/usr/bin/chromedriver") +driver = webdriver.Chrome(service=service, options=options) + +# Navigate to webpage +driver.get("https://openweathermap.org/city/2867714") + +# Wait and find the Cookie Button +login_button = driver.find_element(By.XPATH, '//*[@id="stick-footer-panel"]/div/div/div/div/div/button') +# Scroll to it +driver.execute_script("return arguments[0].scrollIntoView();", login_button) +# Click the button +button_clicked = False +while(button_clicked == False): + try: + login_button.click() + button_clicked = True + print("All cookies successfully accepted!") + except ElementClickInterceptedException: + print("Couldn't click the cookie button, retrying...") + time.sleep(10) + +# hacky wait statement for all the page elements to load +WebDriverWait(driver, timeout=20).until(lambda d: d.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]/h2').text != "") + +# Scroll to the start of the forecast +forecast_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]') +driver.execute_script("return arguments[0].scrollIntoView();", forecast_element) + +# remove the map +map_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[2]') +driver.execute_script("arguments[0].remove();", map_element) + +# zoom in a little - not now +#driver.execute_script("document.body.style.zoom='110%'"); + +# Save as a screenshot +image_filename = "openweather_scraped.png" +driver.save_screenshot(image_filename) + +# Close the WebDriver when done +driver.quit() + +# crop, resize, enhance & rotate the image for inky display +im = Image.open(image_filename, mode='r', formats=None) +im = im.crop((0, 50, my_width, my_height)) +#im = im.resize((800, 480), Image.Resampling.LANCZOS) +#im = im.rotate(90, Image.NEAREST, expand = 1) +im = ImageEnhance.Contrast(im).enhance(1.5) +im.save(image_filename) diff --git a/requirements.txt b/requirements.txt index be79521..a21b8be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,30 +1,56 @@ +appdirs==1.4.4 arrow==1.2.3 +attrs==22.2.0 +beautifulsoup4==4.12.2 certifi==2023.7.22 +charset-normalizer==3.2.0 +contourpy==1.1.1 cycler==0.11.0 +distlib==0.3.7 +exceptiongroup==1.1.3 feedparser==6.0.10 +filelock==3.12.4 fonttools==4.40.0 +frozendict==2.3.8 geojson==2.3.0 +h11==0.14.0 +html5lib==1.1 icalendar==5.0.7 +idna==3.4 +importlib-resources==6.1.0 kiwisolver==1.4.4 lxml==4.9.2 matplotlib==3.7.1 multitasking==0.0.11 numpy==1.25.0 +outcome==1.2.0 packaging==23.1 pandas==2.0.2 Pillow==9.5.0 +platformdirs==3.10.0 pyowm==3.3.0 pyparsing==3.1.0 PySocks==1.7.1 python-dateutil==2.8.2 +python-dotenv==1.0.0 pytz==2023.3 recurring-ical-events==2.0.2 requests==2.31.0 +selenium==4.10.0 sgmllib3k==1.0.0 six==1.16.0 +sniffio==1.3.0 +sortedcontainers==2.4.0 +soupsieve==2.5 todoist-api-python==2.0.2 +trio==0.22.2 +trio-websocket==0.10.4 typing_extensions==4.6.3 +tzdata==2023.3 urllib3==2.0.3 +virtualenv==20.24.5 +webencodings==0.5.1 +wsproto==1.2.0 +x-wr-timezone==0.0.5 yfinance==0.2.21 -python-dotenv==1.0.0 -setuptools==68.0.0 +zipp==3.17.0 From a0fa33d5e114b0b4ccf1a1fdab4f2d216d41f12c Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:45 +0100 Subject: [PATCH 05/54] scraping the weather instead of using the API --- inkycal/modules/inkycal_openweather_scrape.py | 113 +++-- inkycal/modules/inkycal_weather.py | 460 +----------------- 2 files changed, 61 insertions(+), 512 deletions(-) diff --git a/inkycal/modules/inkycal_openweather_scrape.py b/inkycal/modules/inkycal_openweather_scrape.py index 1e652fa..db1b516 100644 --- a/inkycal/modules/inkycal_openweather_scrape.py +++ b/inkycal/modules/inkycal_openweather_scrape.py @@ -9,67 +9,72 @@ from selenium.webdriver.support.wait import WebDriverWait import time -# Set the desired viewport size (width, height) -my_width = 480 -my_height = 850 -mobile_emulation = { - "deviceMetrics": { "width": my_width, "height": my_height, "pixelRatio": 1.0 }, - "userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" -} +def get_scraped_weatherforecast_image() -> Image: + # Set the desired viewport size (width, height) + my_width = 480 + my_height = 850 + mobile_emulation = { + "deviceMetrics": { "width": my_width, "height": my_height, "pixelRatio": 1.0 }, + "userAgent": "Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 5 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" + } -# Create an instance of the webdriver with some pre-configured options -options = Options() -options.add_argument("--no-sandbox") -options.add_argument("--headless=new") -#options.add_argument("--disable-gpu") -options.add_argument("--disable-dev-shm-usage") -options.add_experimental_option("mobileEmulation", mobile_emulation) -service = Service("/usr/bin/chromedriver") -driver = webdriver.Chrome(service=service, options=options) + # Create an instance of the webdriver with some pre-configured options + options = Options() + options.add_argument("--no-sandbox") + options.add_argument("--headless=new") + #options.add_argument("--disable-gpu") + options.add_argument("--disable-dev-shm-usage") + options.add_experimental_option("mobileEmulation", mobile_emulation) + service = Service("/usr/bin/chromedriver") + driver = webdriver.Chrome(service=service, options=options) -# Navigate to webpage -driver.get("https://openweathermap.org/city/2867714") + # Navigate to webpage + driver.get("https://openweathermap.org/city/2867714") -# Wait and find the Cookie Button -login_button = driver.find_element(By.XPATH, '//*[@id="stick-footer-panel"]/div/div/div/div/div/button') -# Scroll to it -driver.execute_script("return arguments[0].scrollIntoView();", login_button) -# Click the button -button_clicked = False -while(button_clicked == False): - try: - login_button.click() - button_clicked = True - print("All cookies successfully accepted!") - except ElementClickInterceptedException: - print("Couldn't click the cookie button, retrying...") - time.sleep(10) + # Wait and find the Cookie Button + login_button = driver.find_element(By.XPATH, '//*[@id="stick-footer-panel"]/div/div/div/div/div/button') + # Scroll to it + driver.execute_script("return arguments[0].scrollIntoView();", login_button) + # Click the button + button_clicked = False + while(button_clicked == False): + try: + login_button.click() + button_clicked = True + print("All cookies successfully accepted!") + except ElementClickInterceptedException: + print("Couldn't click the cookie button, retrying...") + time.sleep(10) -# hacky wait statement for all the page elements to load -WebDriverWait(driver, timeout=20).until(lambda d: d.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]/h2').text != "") + # hacky wait statement for all the page elements to load + WebDriverWait(driver, timeout=20).until(lambda d: d.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]/h2').text != "") -# Scroll to the start of the forecast -forecast_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]') -driver.execute_script("return arguments[0].scrollIntoView();", forecast_element) + # Scroll to the start of the forecast + forecast_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]') + driver.execute_script("return arguments[0].scrollIntoView();", forecast_element) -# remove the map -map_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[2]') -driver.execute_script("arguments[0].remove();", map_element) + # remove the map + map_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[2]') + driver.execute_script("arguments[0].remove();", map_element) -# zoom in a little - not now -#driver.execute_script("document.body.style.zoom='110%'"); + # zoom in a little - not now + #driver.execute_script("document.body.style.zoom='110%'"); -# Save as a screenshot -image_filename = "openweather_scraped.png" -driver.save_screenshot(image_filename) + html_element = driver.find_element(By.TAG_NAME, "html") + driver.execute_script("arguments[0].style.fontSize = '16px';", html_element) -# Close the WebDriver when done -driver.quit() + # Save as a screenshot + image_filename = "openweather_scraped.png" + driver.save_screenshot(image_filename) -# crop, resize, enhance & rotate the image for inky display -im = Image.open(image_filename, mode='r', formats=None) -im = im.crop((0, 50, my_width, my_height)) -#im = im.resize((800, 480), Image.Resampling.LANCZOS) -#im = im.rotate(90, Image.NEAREST, expand = 1) -im = ImageEnhance.Contrast(im).enhance(1.5) -im.save(image_filename) + # Close the WebDriver when done + driver.quit() + + # crop, resize, enhance & rotate the image for inky display + im = Image.open(image_filename, mode='r', formats=None) + im = im.crop((0, 50, my_width, my_height)) + #im = im.resize((800, 480), Image.Resampling.LANCZOS) + #im = im.rotate(90, Image.NEAREST, expand = 1) + im = ImageEnhance.Contrast(im).enhance(1.3) + im.save(image_filename) + return im, im diff --git a/inkycal/modules/inkycal_weather.py b/inkycal/modules/inkycal_weather.py index 28d184a..2325f46 100644 --- a/inkycal/modules/inkycal_weather.py +++ b/inkycal/modules/inkycal_weather.py @@ -7,12 +7,10 @@ Copyright by aceinnolab from inkycal.modules.template import inkycal_module from inkycal.custom import * +from inkycal.modules.inkycal_openweather_scrape import get_scraped_weatherforecast_image import math import decimal -import arrow - -from pyowm.owm import OWM logger = logging.getLogger(__name__) @@ -107,462 +105,8 @@ class Weather(inkycal_module): def generate_image(self): """Generate image for this module""" - # Define new image size with respect to padding - im_width = int(self.width - (2 * self.padding_left)) - im_height = int(self.height - (2 * self.padding_top)) - im_size = im_width, im_height - logger.info(f'Image size: {im_size}') - - # Create an image for black pixels and one for coloured pixels - im_black = Image.new('RGB', size=im_size, color='white') - im_colour = Image.new('RGB', size=im_size, color='white') - - # Check if internet is available - if internet_available(): - logger.info('Connection test passed') - else: - raise NetworkNotReachableError - - def get_moon_phase(): - """Calculate the current (approximate) moon phase""" - - dec = decimal.Decimal - diff = now - arrow.get(2001, 1, 1) - days = dec(diff.days) + (dec(diff.seconds) / dec(86400)) - lunations = dec("0.20439731") + (days * dec("0.03386319269")) - position = lunations % dec(1) - index = math.floor((position * dec(8)) + dec("0.5")) - return { - 0: '\uf095', - 1: '\uf099', - 2: '\uf09c', - 3: '\uf0a0', - 4: '\uf0a3', - 5: '\uf0a7', - 6: '\uf0aa', - 7: '\uf0ae'}[int(index) & 7] - - def is_negative(temp): - """Check if temp is below freezing point of water (0°C/30°F) - returns True if temp below freezing point, else False""" - answer = False - - if temp_unit == 'celsius' and round(float(temp.split('°')[0])) <= 0: - answer = True - elif temp_unit == 'fahrenheit' and round(float(temp.split('°')[0])) <= 0: - answer = True - return answer - - # Lookup-table for weather icons and weather codes - weathericons = { - '01d': '\uf00d', - '02d': '\uf002', - '03d': '\uf013', - '04d': '\uf012', - '09d': '\uf01a', - '10d': '\uf019', - '11d': '\uf01e', - '13d': '\uf01b', - '50d': '\uf014', - '01n': '\uf02e', - '02n': '\uf013', - '03n': '\uf013', - '04n': '\uf013', - '09n': '\uf037', - '10n': '\uf036', - '11n': '\uf03b', - '13n': '\uf038', - '50n': '\uf023' - } - - def draw_icon(image, xy, box_size, icon, rotation=None): - """Custom function to add icons of weather font on image - image = on which image should the text be added? - xy = xy-coordinates as tuple -> (x,y) - box_size = size of text-box -> (width,height) - icon = icon-unicode, looks this up in weathericons dictionary - """ - - icon_size_correction = { - '\uf00d': 10 / 60, - '\uf02e': 51 / 150, - '\uf019': 21 / 60, - '\uf01b': 21 / 60, - '\uf0b5': 51 / 150, - '\uf050': 25 / 60, - '\uf013': 51 / 150, - '\uf002': 0, - '\uf031': 29 / 100, - '\uf015': 21 / 60, - '\uf01e': 52 / 150, - '\uf056': 51 / 150, - '\uf053': 14 / 150, - '\uf012': 51 / 150, - '\uf01a': 51 / 150, - '\uf014': 51 / 150, - '\uf037': 42 / 150, - '\uf036': 42 / 150, - '\uf03b': 42 / 150, - '\uf038': 42 / 150, - '\uf023': 35 / 150, - '\uf07a': 35 / 150, - '\uf051': 18 / 150, - '\uf052': 18 / 150, - '\uf0aa': 0, - '\uf095': 0, - '\uf099': 0, - '\uf09c': 0, - '\uf0a0': 0, - '\uf0a3': 0, - '\uf0a7': 0, - '\uf0aa': 0, - '\uf0ae': 0 - } - - x, y = xy - box_width, box_height = box_size - text = icon - font = self.weatherfont - - # Increase fontsize to fit specified height and width of text box - size = 8 - font = ImageFont.truetype(font.path, size) - text_width, text_height = font.getsize(text) - - while (text_width < int(box_width * 0.9) and - text_height < int(box_height * 0.9)): - size += 1 - font = ImageFont.truetype(font.path, size) - text_width, text_height = font.getsize(text) - - text_width, text_height = font.getsize(text) - - # Align text to desired position - x = int((box_width / 2) - (text_width / 2)) - y = int((box_height / 2) - (text_height / 2) - (icon_size_correction[icon] * size) / 2) - - # Draw the text in the text-box - draw = ImageDraw.Draw(image) - print(f"Box width: {box_width}, Box height: {box_height}") - # TODO: fix ValueError: Width and height must be >= 0 - space = Image.new('RGBA', (box_width, box_height)) - ImageDraw.Draw(space).text((x, y), text, fill='black', font=font) - - if rotation != None: - space.rotate(rotation, expand=True) - - # Update only region with text (add text with transparent background) - image.paste(space, xy, space) - - # column1 column2 column3 column4 column5 column6 column7 - # |----------|----------|----------|----------|----------|----------|----------| - # | time | temperat.| moonphase| forecast1| forecast2| forecast3| forecast4| - # | current |----------|----------|----------|----------|----------|----------| - # | weather | humidity | sunrise | icon1 | icon2 | icon3 | icon4 | - # | icon |----------|----------|----------|----------|----------|----------| - # | | windspeed| sunset | temperat.| temperat.| temperat.| temperat.| - # |----------|----------|----------|----------|----------|----------|----------| - - # Calculate size rows and columns - col_width = im_width // 7 - - # Ratio width height - image_ratio = im_width / im_height - - if image_ratio >= 4: - row_height = im_height // 3 - else: - logger.info('Please consider decreasing the height.') - row_height = int((im_height * (1 - im_height / im_width)) / 3) - - _, text_height = self.font.getsize("Text") - row_height = max(row_height, text_height) - logger.debug(f"row_height: {row_height} | col_width: {col_width}") - - # Calculate spacings for better centering - spacing_top = int((im_width % col_width) / 2) - spacing_left = int((im_height % row_height) / 2) - - # Define sizes for weather icons - icon_small = int(col_width / 3) - icon_medium = icon_small * 2 - icon_large = icon_small * 3 - - # Calculate the x-axis position of each col - col1 = spacing_top - col2 = col1 + col_width - col3 = col2 + col_width - col4 = col3 + col_width - col5 = col4 + col_width - col6 = col5 + col_width - col7 = col6 + col_width - - # Calculate the y-axis position of each row - line_gap = int((im_height - spacing_top - 3 * row_height) // 4) - - row1 = line_gap - row2 = row1 + line_gap + row_height - row3 = row2 + line_gap + row_height - - # Draw lines on each row and border - ############################################################################ - ## draw = ImageDraw.Draw(im_black) - ## draw.line((0, 0, im_width, 0), fill='red') - ## draw.line((0, im_height-1, im_width, im_height-1), fill='red') - ## draw.line((0, row1, im_width, row1), fill='black') - ## draw.line((0, row1+row_height, im_width, row1+row_height), fill='black') - ## draw.line((0, row2, im_width, row2), fill='black') - ## draw.line((0, row2+row_height, im_width, row2+row_height), fill='black') - ## draw.line((0, row3, im_width, row3), fill='black') - ## draw.line((0, row3+row_height, im_width, row3+row_height), fill='black') - ############################################################################ - - # Positions for current weather details - weather_icon_pos = (col1, 0) - temperature_icon_pos = (col2, row1) - temperature_pos = (col2 + icon_small, row1) - humidity_icon_pos = (col2, row2) - humidity_pos = (col2 + icon_small, row2) - windspeed_icon_pos = (col2, row3) - windspeed_pos = (col2 + icon_small, row3) - - # Positions for sunrise, sunset, moonphase - moonphase_pos = (col3, row1) - sunrise_icon_pos = (col3, row2) - sunrise_time_pos = (col3 + icon_small, row2) - sunset_icon_pos = (col3, row3) - sunset_time_pos = (col3 + icon_small, row3) - - # Positions for forecast 1 - stamp_fc1 = (col4, row1) - icon_fc1 = (col4, row1 + row_height) - temp_fc1 = (col4, row3) - - # Positions for forecast 2 - stamp_fc2 = (col5, row1) - icon_fc2 = (col5, row1 + row_height) - temp_fc2 = (col5, row3) - - # Positions for forecast 3 - stamp_fc3 = (col6, row1) - icon_fc3 = (col6, row1 + row_height) - temp_fc3 = (col6, row3) - - # Positions for forecast 4 - stamp_fc4 = (col7, row1) - icon_fc4 = (col7, row1 + row_height) - temp_fc4 = (col7, row3) - - # Create current-weather and weather-forecast objects - if self.location.isdigit(): - logging.debug('looking up location by ID') - weather = self.owm.weather_at_id(int(self.location)).weather - forecast = self.owm.forecast_at_id(int(self.location), '3h') - else: - logging.debug('looking up location by string') - weather = self.owm.weather_at_place(self.location).weather - forecast = self.owm.forecast_at_place(self.location, '3h') - - # Set decimals - dec_temp = None if self.round_temperature == True else 1 - dec_wind = None if self.round_windspeed == True else 1 - - # Set correct temperature units - if self.units == 'metric': - temp_unit = 'celsius' - elif self.units == 'imperial': - temp_unit = 'fahrenheit' - - logging.debug(f'temperature unit: {temp_unit}') - logging.debug(f'decimals temperature: {dec_temp} | decimals wind: {dec_wind}') - - # Get current time - now = arrow.utcnow() - now = now.to("local") - - if self.forecast_interval == 'hourly': - - logger.debug("getting hourly forecasts") - - # Forecasts are provided for every 3rd full hour - # find out how many hours there are until the next 3rd full hour - if (now.hour % 3) != 0: - hour_gap = 3 - (now.hour % 3) - else: - hour_gap = 3 - - # Create timings for hourly forcasts - forecast_timings = [now.shift(hours=+ hour_gap + _).floor('hour') - for _ in range(0, 12, 3)] - - # Create forecast objects for given timings - forecasts = [forecast.get_weather_at(forecast_time.datetime) for - forecast_time in forecast_timings] - - # Add forecast-data to fc_data dictionary - fc_data = {} - for forecast in forecasts: - temp = '{}°'.format(round( - forecast.temperature(unit=temp_unit)['temp'], ndigits=dec_temp)) - - icon = forecast.weather_icon_name - fc_data['fc' + str(forecasts.index(forecast) + 1)] = { - 'temp': temp, - 'icon': icon, - 'stamp': forecast_timings[forecasts.index(forecast)].to( - get_system_tz()).format('H.00' if self.hour_format == 24 else 'h a') - } - - elif self.forecast_interval == 'daily': - - logger.debug("getting daily forecasts") - - def calculate_forecast(days_from_today): - """Get temperature range and most frequent icon code for forecast - days_from_today should be int from 1-4: e.g. 2 -> 2 days from today - """ - - # Create a list containing time-objects for every 3rd hour of the day - time_range = list(arrow.Arrow.range('hour', - now.shift(days=days_from_today).floor('day'), - now.shift(days=days_from_today).ceil('day') - ))[::3] - - # Get forecasts for each time-object - forecasts = [forecast.get_weather_at(_.datetime) for _ in time_range] - - # Get all temperatures for this day - daily_temp = [round(_.temperature(unit=temp_unit)['temp'], - ndigits=dec_temp) for _ in forecasts] - # Calculate min. and max. temp for this day - temp_range = f'{max(daily_temp)}°/{min(daily_temp)}°' - - # Get all weather icon codes for this day - daily_icons = [_.weather_icon_name for _ in forecasts] - # Find most common element from all weather icon codes - status = max(set(daily_icons), key=daily_icons.count) - - weekday = now.shift(days=days_from_today).format('ddd', locale= - self.locale) - return {'temp': temp_range, 'icon': status, 'stamp': weekday} - - forecasts = [calculate_forecast(days) for days in range(1, 5)] - - fc_data = {} - for forecast in forecasts: - fc_data['fc' + str(forecasts.index(forecast) + 1)] = { - 'temp': forecast['temp'], - 'icon': forecast['icon'], - 'stamp': forecast['stamp'] - } - - for key, val in fc_data.items(): - logger.debug((key, val)) - - # Get some current weather details - temperature = '{}°'.format(round( - weather.temperature(unit=temp_unit)['temp'], ndigits=dec_temp)) - - weather_icon = weather.weather_icon_name - humidity = str(weather.humidity) - sunrise_raw = arrow.get(weather.sunrise_time()).to(self.timezone) - sunset_raw = arrow.get(weather.sunset_time()).to(self.timezone) - - logger.debug(f'weather_icon: {weather_icon}') - - if self.hour_format == 12: - logger.debug('using 12 hour format for sunrise/sunset') - sunrise = sunrise_raw.format('h:mm a') - sunset = sunset_raw.format('h:mm a') - - elif self.hour_format == 24: - logger.debug('using 24 hour format for sunrise/sunset') - sunrise = sunrise_raw.format('H:mm') - sunset = sunset_raw.format('H:mm') - - # Format the windspeed to user preference - if self.use_beaufort: - logger.debug("using beaufort for wind") - wind = str(weather.wind(unit='beaufort')['speed']) - - else: - - if self.units == 'metric': - logging.debug('getting windspeed in metric unit') - wind = str(weather.wind(unit='meters_sec')['speed']) + 'm/s' - - elif self.units == 'imperial': - logging.debug('getting windspeed in imperial unit') - wind = str(weather.wind(unit='miles_hour')['speed']) + 'miles/h' - - dec = decimal.Decimal - moonphase = get_moon_phase() - - # Fill weather details in col 1 (current weather icon) - draw_icon(im_colour, weather_icon_pos, (col_width, im_height), - weathericons[weather_icon]) - - # Fill weather details in col 2 (temp, humidity, wind) - draw_icon(im_colour, temperature_icon_pos, (icon_small, row_height), - '\uf053') - - if is_negative(temperature): - write(im_black, temperature_pos, (col_width - icon_small, row_height), - temperature, font=self.font) - else: - write(im_black, temperature_pos, (col_width - icon_small, row_height), - temperature, font=self.font) - - draw_icon(im_colour, humidity_icon_pos, (icon_small, row_height), - '\uf07a') - - write(im_black, humidity_pos, (col_width - icon_small, row_height), - humidity + '%', font=self.font) - - draw_icon(im_colour, windspeed_icon_pos, (icon_small, icon_small), - '\uf050') - - write(im_black, windspeed_pos, (col_width - icon_small, row_height), - wind, font=self.font) - - # Fill weather details in col 3 (moonphase, sunrise, sunset) - draw_icon(im_colour, moonphase_pos, (col_width, row_height), moonphase) - - draw_icon(im_colour, sunrise_icon_pos, (icon_small, icon_small), '\uf051') - write(im_black, sunrise_time_pos, (col_width - icon_small, row_height), - sunrise, font=self.font) - - draw_icon(im_colour, sunset_icon_pos, (icon_small, icon_small), '\uf052') - write(im_black, sunset_time_pos, (col_width - icon_small, row_height), sunset, - font=self.font) - - # Add the forecast data to the correct places - for pos in range(1, len(fc_data) + 1): - stamp = fc_data[f'fc{pos}']['stamp'] - - icon = weathericons[fc_data[f'fc{pos}']['icon']] - temp = fc_data[f'fc{pos}']['temp'] - - write(im_black, eval(f'stamp_fc{pos}'), (col_width, row_height), - stamp, font=self.font) - draw_icon(im_colour, eval(f'icon_fc{pos}'), (col_width, row_height + line_gap * 2), - icon) - write(im_black, eval(f'temp_fc{pos}'), (col_width, row_height), - temp, font=self.font) - - border_h = row3 + row_height - border_w = col_width - 3 # leave 3 pixels gap - - # Add borders around each sub-section - draw_border(im_black, (col1, row1), (col_width * 3 - 3, border_h), - shrinkage=(0, 0)) - - for _ in range(4, 8): - draw_border(im_black, (eval(f'col{_}'), row1), (border_w, border_h), - shrinkage=(0, 0)) - # return the images ready for the display - return im_black, im_colour + return get_scraped_weatherforecast_image() if __name__ == '__main__': From 6287affb0c4f702e6972f01491d6012ffe5aeeb3 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:45 +0100 Subject: [PATCH 06/54] call the openweather scraper from the image module --- inkycal/modules/inky_image.py | 2 +- inkycal/modules/inkycal_image.py | 4 ++++ inkycal/modules/inkycal_openweather_scrape.py | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/inkycal/modules/inky_image.py b/inkycal/modules/inky_image.py index e069114..56ef31a 100755 --- a/inkycal/modules/inky_image.py +++ b/inkycal/modules/inky_image.py @@ -55,7 +55,7 @@ class Inkyimage: image = Image.open(path) except FileNotFoundError: logger.error('No image file found', exc_info=True) - raise Exception('Your file could not be found. Please check the filepath') + raise Exception(f'Your file could not be found. Please check the filepath: {path}') except OSError: logger.error('Invalid Image file provided', exc_info=True) diff --git a/inkycal/modules/inkycal_image.py b/inkycal/modules/inkycal_image.py index 37b4a1a..dcd4b8d 100755 --- a/inkycal/modules/inkycal_image.py +++ b/inkycal/modules/inkycal_image.py @@ -6,6 +6,7 @@ Copyright by aceinnolab """ from inkycal.modules.template import inkycal_module +from inkycal.modules.inkycal_openweather_scrape import get_scraped_weatherforecast_image from inkycal.custom import * from inkycal.modules.inky_image import Inkyimage as Images @@ -68,6 +69,9 @@ class Inkyimage(inkycal_module): print(f'{__name__} loaded') def generate_image(self): + """Call the openweather scraper""" + _,_ = get_scraped_weatherforecast_image() + """Generate image for this module""" # Define new image size with respect to padding diff --git a/inkycal/modules/inkycal_openweather_scrape.py b/inkycal/modules/inkycal_openweather_scrape.py index db1b516..2cc6b18 100644 --- a/inkycal/modules/inkycal_openweather_scrape.py +++ b/inkycal/modules/inkycal_openweather_scrape.py @@ -78,3 +78,10 @@ def get_scraped_weatherforecast_image() -> Image: im = ImageEnhance.Contrast(im).enhance(1.3) im.save(image_filename) return im, im + +def main(): + _, _ = get_scraped_weatherforecast_image() + +if __name__ == '__main__': + print(f'running {__name__} in standalone/debug mode') + main() \ No newline at end of file From ba630c381f1802730cb94eec5b31fa5b9ac19d2c Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:45 +0100 Subject: [PATCH 07/54] remove image "optimization" --- inkycal/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inkycal/main.py b/inkycal/main.py index 122a817..153d745 100644 --- a/inkycal/main.py +++ b/inkycal/main.py @@ -518,12 +518,12 @@ class Inkycal: def _optimize_im(image, threshold=220): """Optimize the image for rendering on ePaper displays""" - buffer = numpy.array(image.convert('RGB')) - red, green = buffer[:, :, 0], buffer[:, :, 1] + #buffer = numpy.array(image.convert('RGB')) + #red, green = buffer[:, :, 0], buffer[:, :, 1] # grey->black - buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] - image = Image.fromarray(buffer) + #buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] + #image = Image.fromarray(buffer) return image def calibrate(self): From 5b16fff0bd46f2f1d22b98e2356e55bef50e54e8 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:46 +0100 Subject: [PATCH 08/54] scraper shellscript + dockerfile improvements --- .devcontainer/Dockerfile | 11 +++++++++-- .devcontainer/devcontainer.json | 3 ++- run_weather_scraper.sh | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 run_weather_scraper.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 658ac30..36562fb 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,5 +1,5 @@ -FROM python:3.9-slim-bullseye -WORKDIR /usr/src/app +FROM python:3.9-slim-bullseye as development +WORKDIR /app RUN apt-get -y update && apt-get install -yqq dos2unix chromium chromium-driver \ libxi6 libgconf-2-4 python3-selenium \ tzdata git @@ -8,3 +8,10 @@ RUN python3 -m pip install --upgrade pip RUN python3 -m pip install --user virtualenv ENV TZ=Europe/Berlin RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +FROM development +COPY ../inkycal/modules/inkycal_openweather_scrape.py /app/ +COPY ./run_weather_scraper.sh /app/ + +# Set the entrypoint to the shell script +ENTRYPOINT ["run_weather_scraper.sh"] \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 121d9bc..a05ecbe 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,8 @@ { "name": "Inkycal-dev", "build": { - "dockerfile": "Dockerfile" + "dockerfile": "Dockerfile", + "target": "development" }, // This is the settings.json mount diff --git a/run_weather_scraper.sh b/run_weather_scraper.sh new file mode 100755 index 0000000..8391faf --- /dev/null +++ b/run_weather_scraper.sh @@ -0,0 +1,3 @@ +#!/bin/sh +python3 /home/ubuntu/Inkycal/inkycal/modules/inkycal_openweather_scrape.py +scp ./openweather_scraped.png inky@10.10.9.10:~/Inkycal/ From 0ca272b563b909a079aa75cfa9bcc1b9273252de Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:46 +0100 Subject: [PATCH 09/54] weather scraper improvements --- inkycal/main.py | 8 ++++---- inkycal/modules/inkycal_openweather_scrape.py | 6 +++--- run_weather_scraper.sh | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/inkycal/main.py b/inkycal/main.py index 122a817..153d745 100644 --- a/inkycal/main.py +++ b/inkycal/main.py @@ -518,12 +518,12 @@ class Inkycal: def _optimize_im(image, threshold=220): """Optimize the image for rendering on ePaper displays""" - buffer = numpy.array(image.convert('RGB')) - red, green = buffer[:, :, 0], buffer[:, :, 1] + #buffer = numpy.array(image.convert('RGB')) + #red, green = buffer[:, :, 0], buffer[:, :, 1] # grey->black - buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] - image = Image.fromarray(buffer) + #buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] + #image = Image.fromarray(buffer) return image def calibrate(self): diff --git a/inkycal/modules/inkycal_openweather_scrape.py b/inkycal/modules/inkycal_openweather_scrape.py index 1e345d4..ef56b72 100644 --- a/inkycal/modules/inkycal_openweather_scrape.py +++ b/inkycal/modules/inkycal_openweather_scrape.py @@ -64,7 +64,7 @@ def get_scraped_weatherforecast_image() -> Image: driver.execute_script("arguments[0].style.fontSize = '16px';", html_element) # Save as a screenshot - image_filename = "openweather_scraped.png" + image_filename = "/tmp/openweather_scraped.png" driver.save_screenshot(image_filename) # Close the WebDriver when done @@ -75,7 +75,7 @@ def get_scraped_weatherforecast_image() -> Image: im = im.crop((0, 50, my_width, my_height)) #im = im.resize((800, 480), Image.Resampling.LANCZOS) #im = im.rotate(90, Image.NEAREST, expand = 1) - #im = ImageEnhance.Contrast(im).enhance(1.3) + im = ImageEnhance.Contrast(im).enhance(1.3) im.save(image_filename) return im, im @@ -84,4 +84,4 @@ def main(): if __name__ == '__main__': print(f'running {__name__} in standalone/debug mode') - main() \ No newline at end of file + main() diff --git a/run_weather_scraper.sh b/run_weather_scraper.sh index 8391faf..84480ed 100755 --- a/run_weather_scraper.sh +++ b/run_weather_scraper.sh @@ -1,3 +1,3 @@ #!/bin/sh python3 /home/ubuntu/Inkycal/inkycal/modules/inkycal_openweather_scrape.py -scp ./openweather_scraped.png inky@10.10.9.10:~/Inkycal/ +scp -i /home/ubuntu/.ssh/id_rsa /tmp/openweather_scraped.png inky@10.10.9.10:~/Inkycal/ From 485228e35d22c70a56d47ee2b4463428f8db1197 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:46 +0100 Subject: [PATCH 10/54] another shot for improved image display --- inkycal/main.py | 8 ++++---- inkycal/modules/inkycal_openweather_scrape.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/inkycal/main.py b/inkycal/main.py index 153d745..122a817 100644 --- a/inkycal/main.py +++ b/inkycal/main.py @@ -518,12 +518,12 @@ class Inkycal: def _optimize_im(image, threshold=220): """Optimize the image for rendering on ePaper displays""" - #buffer = numpy.array(image.convert('RGB')) - #red, green = buffer[:, :, 0], buffer[:, :, 1] + buffer = numpy.array(image.convert('RGB')) + red, green = buffer[:, :, 0], buffer[:, :, 1] # grey->black - #buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] - #image = Image.fromarray(buffer) + buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] + image = Image.fromarray(buffer) return image def calibrate(self): diff --git a/inkycal/modules/inkycal_openweather_scrape.py b/inkycal/modules/inkycal_openweather_scrape.py index 2cc6b18..1e345d4 100644 --- a/inkycal/modules/inkycal_openweather_scrape.py +++ b/inkycal/modules/inkycal_openweather_scrape.py @@ -75,7 +75,7 @@ def get_scraped_weatherforecast_image() -> Image: im = im.crop((0, 50, my_width, my_height)) #im = im.resize((800, 480), Image.Resampling.LANCZOS) #im = im.rotate(90, Image.NEAREST, expand = 1) - im = ImageEnhance.Contrast(im).enhance(1.3) + #im = ImageEnhance.Contrast(im).enhance(1.3) im.save(image_filename) return im, im From 2f494eab9e39fed933965d9b8d5d425275027335 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:46 +0100 Subject: [PATCH 11/54] revert original weather module back to master --- inkycal/modules/inkycal_weather.py | 455 ++++++++++++++++++++++++++++- 1 file changed, 453 insertions(+), 2 deletions(-) diff --git a/inkycal/modules/inkycal_weather.py b/inkycal/modules/inkycal_weather.py index 2325f46..ec639bf 100644 --- a/inkycal/modules/inkycal_weather.py +++ b/inkycal/modules/inkycal_weather.py @@ -7,10 +7,12 @@ Copyright by aceinnolab from inkycal.modules.template import inkycal_module from inkycal.custom import * -from inkycal.modules.inkycal_openweather_scrape import get_scraped_weatherforecast_image import math import decimal +import arrow + +from pyowm.owm import OWM logger = logging.getLogger(__name__) @@ -105,8 +107,457 @@ class Weather(inkycal_module): def generate_image(self): """Generate image for this module""" + # Define new image size with respect to padding + im_width = int(self.width - (2 * self.padding_left)) + im_height = int(self.height - (2 * self.padding_top)) + im_size = im_width, im_height + logger.info(f'Image size: {im_size}') + + # Create an image for black pixels and one for coloured pixels + im_black = Image.new('RGB', size=im_size, color='white') + im_colour = Image.new('RGB', size=im_size, color='white') + + # Check if internet is available + if internet_available(): + logger.info('Connection test passed') + else: + raise NetworkNotReachableError + + def get_moon_phase(): + """Calculate the current (approximate) moon phase""" + + dec = decimal.Decimal + diff = now - arrow.get(2001, 1, 1) + days = dec(diff.days) + (dec(diff.seconds) / dec(86400)) + lunations = dec("0.20439731") + (days * dec("0.03386319269")) + position = lunations % dec(1) + index = math.floor((position * dec(8)) + dec("0.5")) + return { + 0: '\uf095', + 1: '\uf099', + 2: '\uf09c', + 3: '\uf0a0', + 4: '\uf0a3', + 5: '\uf0a7', + 6: '\uf0aa', + 7: '\uf0ae'}[int(index) & 7] + + def is_negative(temp): + """Check if temp is below freezing point of water (0°C/30°F) + returns True if temp below freezing point, else False""" + answer = False + + if temp_unit == 'celsius' and round(float(temp.split('°')[0])) <= 0: + answer = True + elif temp_unit == 'fahrenheit' and round(float(temp.split('°')[0])) <= 0: + answer = True + return answer + + # Lookup-table for weather icons and weather codes + weathericons = { + '01d': '\uf00d', + '02d': '\uf002', + '03d': '\uf013', + '04d': '\uf012', + '09d': '\uf01a', + '10d': '\uf019', + '11d': '\uf01e', + '13d': '\uf01b', + '50d': '\uf014', + '01n': '\uf02e', + '02n': '\uf013', + '03n': '\uf013', + '04n': '\uf013', + '09n': '\uf037', + '10n': '\uf036', + '11n': '\uf03b', + '13n': '\uf038', + '50n': '\uf023' + } + + def draw_icon(image, xy, box_size, icon, rotation=None): + """Custom function to add icons of weather font on image + image = on which image should the text be added? + xy = xy-coordinates as tuple -> (x,y) + box_size = size of text-box -> (width,height) + icon = icon-unicode, looks this up in weathericons dictionary + """ + + icon_size_correction = { + '\uf00d': 10 / 60, + '\uf02e': 51 / 150, + '\uf019': 21 / 60, + '\uf01b': 21 / 60, + '\uf0b5': 51 / 150, + '\uf050': 25 / 60, + '\uf013': 51 / 150, + '\uf002': 0, + '\uf031': 29 / 100, + '\uf015': 21 / 60, + '\uf01e': 52 / 150, + '\uf056': 51 / 150, + '\uf053': 14 / 150, + '\uf012': 51 / 150, + '\uf01a': 51 / 150, + '\uf014': 51 / 150, + '\uf037': 42 / 150, + '\uf036': 42 / 150, + '\uf03b': 42 / 150, + '\uf038': 42 / 150, + '\uf023': 35 / 150, + '\uf07a': 35 / 150, + '\uf051': 18 / 150, + '\uf052': 18 / 150, + '\uf0aa': 0, + '\uf095': 0, + '\uf099': 0, + '\uf09c': 0, + '\uf0a0': 0, + '\uf0a3': 0, + '\uf0a7': 0, + '\uf0aa': 0, + '\uf0ae': 0 + } + + x, y = xy + box_width, box_height = box_size + text = icon + font = self.weatherfont + + # Increase fontsize to fit specified height and width of text box + size = 8 + font = ImageFont.truetype(font.path, size) + text_width, text_height = font.getsize(text) + + while (text_width < int(box_width * 0.9) and + text_height < int(box_height * 0.9)): + size += 1 + font = ImageFont.truetype(font.path, size) + text_width, text_height = font.getsize(text) + + text_width, text_height = font.getsize(text) + + # Align text to desired position + x = int((box_width / 2) - (text_width / 2)) + y = int((box_height / 2) - (text_height / 2) - (icon_size_correction[icon] * size) / 2) + + # Draw the text in the text-box + draw = ImageDraw.Draw(image) + space = Image.new('RGBA', (box_width, box_height)) + ImageDraw.Draw(space).text((x, y), text, fill='black', font=font) + + if rotation != None: + space.rotate(rotation, expand=True) + + # Update only region with text (add text with transparent background) + image.paste(space, xy, space) + + # column1 column2 column3 column4 column5 column6 column7 + # |----------|----------|----------|----------|----------|----------|----------| + # | time | temperat.| moonphase| forecast1| forecast2| forecast3| forecast4| + # | current |----------|----------|----------|----------|----------|----------| + # | weather | humidity | sunrise | icon1 | icon2 | icon3 | icon4 | + # | icon |----------|----------|----------|----------|----------|----------| + # | | windspeed| sunset | temperat.| temperat.| temperat.| temperat.| + # |----------|----------|----------|----------|----------|----------|----------| + + # Calculate size rows and columns + col_width = im_width // 7 + + # Ratio width height + image_ratio = im_width / im_height + + if image_ratio >= 4: + row_height = im_height // 3 + else: + logger.info('Please consider decreasing the height.') + row_height = int((im_height * (1 - im_height / im_width)) / 3) + + logger.debug(f"row_height: {row_height} | col_width: {col_width}") + + # Calculate spacings for better centering + spacing_top = int((im_width % col_width) / 2) + spacing_left = int((im_height % row_height) / 2) + + # Define sizes for weather icons + icon_small = int(col_width / 3) + icon_medium = icon_small * 2 + icon_large = icon_small * 3 + + # Calculate the x-axis position of each col + col1 = spacing_top + col2 = col1 + col_width + col3 = col2 + col_width + col4 = col3 + col_width + col5 = col4 + col_width + col6 = col5 + col_width + col7 = col6 + col_width + + # Calculate the y-axis position of each row + line_gap = int((im_height - spacing_top - 3 * row_height) // 4) + + row1 = line_gap + row2 = row1 + line_gap + row_height + row3 = row2 + line_gap + row_height + + # Draw lines on each row and border + ############################################################################ + ## draw = ImageDraw.Draw(im_black) + ## draw.line((0, 0, im_width, 0), fill='red') + ## draw.line((0, im_height-1, im_width, im_height-1), fill='red') + ## draw.line((0, row1, im_width, row1), fill='black') + ## draw.line((0, row1+row_height, im_width, row1+row_height), fill='black') + ## draw.line((0, row2, im_width, row2), fill='black') + ## draw.line((0, row2+row_height, im_width, row2+row_height), fill='black') + ## draw.line((0, row3, im_width, row3), fill='black') + ## draw.line((0, row3+row_height, im_width, row3+row_height), fill='black') + ############################################################################ + + # Positions for current weather details + weather_icon_pos = (col1, 0) + temperature_icon_pos = (col2, row1) + temperature_pos = (col2 + icon_small, row1) + humidity_icon_pos = (col2, row2) + humidity_pos = (col2 + icon_small, row2) + windspeed_icon_pos = (col2, row3) + windspeed_pos = (col2 + icon_small, row3) + + # Positions for sunrise, sunset, moonphase + moonphase_pos = (col3, row1) + sunrise_icon_pos = (col3, row2) + sunrise_time_pos = (col3 + icon_small, row2) + sunset_icon_pos = (col3, row3) + sunset_time_pos = (col3 + icon_small, row3) + + # Positions for forecast 1 + stamp_fc1 = (col4, row1) + icon_fc1 = (col4, row1 + row_height) + temp_fc1 = (col4, row3) + + # Positions for forecast 2 + stamp_fc2 = (col5, row1) + icon_fc2 = (col5, row1 + row_height) + temp_fc2 = (col5, row3) + + # Positions for forecast 3 + stamp_fc3 = (col6, row1) + icon_fc3 = (col6, row1 + row_height) + temp_fc3 = (col6, row3) + + # Positions for forecast 4 + stamp_fc4 = (col7, row1) + icon_fc4 = (col7, row1 + row_height) + temp_fc4 = (col7, row3) + + # Create current-weather and weather-forecast objects + if self.location.isdigit(): + logging.debug('looking up location by ID') + weather = self.owm.weather_at_id(int(self.location)).weather + forecast = self.owm.forecast_at_id(int(self.location), '3h') + else: + logging.debug('looking up location by string') + weather = self.owm.weather_at_place(self.location).weather + forecast = self.owm.forecast_at_place(self.location, '3h') + + # Set decimals + dec_temp = None if self.round_temperature == True else 1 + dec_wind = None if self.round_windspeed == True else 1 + + # Set correct temperature units + if self.units == 'metric': + temp_unit = 'celsius' + elif self.units == 'imperial': + temp_unit = 'fahrenheit' + + logging.debug(f'temperature unit: {temp_unit}') + logging.debug(f'decimals temperature: {dec_temp} | decimals wind: {dec_wind}') + + # Get current time + now = arrow.utcnow() + + if self.forecast_interval == 'hourly': + + logger.debug("getting hourly forecasts") + + # Forecasts are provided for every 3rd full hour + # find out how many hours there are until the next 3rd full hour + if (now.hour % 3) != 0: + hour_gap = 3 - (now.hour % 3) + else: + hour_gap = 3 + + # Create timings for hourly forcasts + forecast_timings = [now.shift(hours=+ hour_gap + _).floor('hour') + for _ in range(0, 12, 3)] + + # Create forecast objects for given timings + forecasts = [forecast.get_weather_at(forecast_time.datetime) for + forecast_time in forecast_timings] + + # Add forecast-data to fc_data dictionary + fc_data = {} + for forecast in forecasts: + temp = '{}°'.format(round( + forecast.temperature(unit=temp_unit)['temp'], ndigits=dec_temp)) + + icon = forecast.weather_icon_name + fc_data['fc' + str(forecasts.index(forecast) + 1)] = { + 'temp': temp, + 'icon': icon, + 'stamp': forecast_timings[forecasts.index(forecast)].to( + get_system_tz()).format('H.00' if self.hour_format == 24 else 'h a') + } + + elif self.forecast_interval == 'daily': + + logger.debug("getting daily forecasts") + + def calculate_forecast(days_from_today): + """Get temperature range and most frequent icon code for forecast + days_from_today should be int from 1-4: e.g. 2 -> 2 days from today + """ + + # Create a list containing time-objects for every 3rd hour of the day + time_range = list(arrow.Arrow.range('hour', + now.shift(days=days_from_today).floor('day'), + now.shift(days=days_from_today).ceil('day') + ))[::3] + + # Get forecasts for each time-object + forecasts = [forecast.get_weather_at(_.datetime) for _ in time_range] + + # Get all temperatures for this day + daily_temp = [round(_.temperature(unit=temp_unit)['temp'], + ndigits=dec_temp) for _ in forecasts] + # Calculate min. and max. temp for this day + temp_range = f'{max(daily_temp)}°/{min(daily_temp)}°' + + # Get all weather icon codes for this day + daily_icons = [_.weather_icon_name for _ in forecasts] + # Find most common element from all weather icon codes + status = max(set(daily_icons), key=daily_icons.count) + + weekday = now.shift(days=days_from_today).format('ddd', locale= + self.locale) + return {'temp': temp_range, 'icon': status, 'stamp': weekday} + + forecasts = [calculate_forecast(days) for days in range(1, 5)] + + fc_data = {} + for forecast in forecasts: + fc_data['fc' + str(forecasts.index(forecast) + 1)] = { + 'temp': forecast['temp'], + 'icon': forecast['icon'], + 'stamp': forecast['stamp'] + } + + for key, val in fc_data.items(): + logger.debug((key, val)) + + # Get some current weather details + temperature = '{}°'.format(round( + weather.temperature(unit=temp_unit)['temp'], ndigits=dec_temp)) + + weather_icon = weather.weather_icon_name + humidity = str(weather.humidity) + sunrise_raw = arrow.get(weather.sunrise_time()).to(self.timezone) + sunset_raw = arrow.get(weather.sunset_time()).to(self.timezone) + + logger.debug(f'weather_icon: {weather_icon}') + + if self.hour_format == 12: + logger.debug('using 12 hour format for sunrise/sunset') + sunrise = sunrise_raw.format('h:mm a') + sunset = sunset_raw.format('h:mm a') + + elif self.hour_format == 24: + logger.debug('using 24 hour format for sunrise/sunset') + sunrise = sunrise_raw.format('H:mm') + sunset = sunset_raw.format('H:mm') + + # Format the windspeed to user preference + if self.use_beaufort: + logger.debug("using beaufort for wind") + wind = str(weather.wind(unit='beaufort')['speed']) + + else: + + if self.units == 'metric': + logging.debug('getting windspeed in metric unit') + wind = str(weather.wind(unit='meters_sec')['speed']) + 'm/s' + + elif self.units == 'imperial': + logging.debug('getting windspeed in imperial unit') + wind = str(weather.wind(unit='miles_hour')['speed']) + 'miles/h' + + dec = decimal.Decimal + moonphase = get_moon_phase() + + # Fill weather details in col 1 (current weather icon) + draw_icon(im_colour, weather_icon_pos, (col_width, im_height), + weathericons[weather_icon]) + + # Fill weather details in col 2 (temp, humidity, wind) + draw_icon(im_colour, temperature_icon_pos, (icon_small, row_height), + '\uf053') + + if is_negative(temperature): + write(im_black, temperature_pos, (col_width - icon_small, row_height), + temperature, font=self.font) + else: + write(im_black, temperature_pos, (col_width - icon_small, row_height), + temperature, font=self.font) + + draw_icon(im_colour, humidity_icon_pos, (icon_small, row_height), + '\uf07a') + + write(im_black, humidity_pos, (col_width - icon_small, row_height), + humidity + '%', font=self.font) + + draw_icon(im_colour, windspeed_icon_pos, (icon_small, icon_small), + '\uf050') + + write(im_black, windspeed_pos, (col_width - icon_small, row_height), + wind, font=self.font) + + # Fill weather details in col 3 (moonphase, sunrise, sunset) + draw_icon(im_colour, moonphase_pos, (col_width, row_height), moonphase) + + draw_icon(im_colour, sunrise_icon_pos, (icon_small, icon_small), '\uf051') + write(im_black, sunrise_time_pos, (col_width - icon_small, row_height), + sunrise, font=self.font) + + draw_icon(im_colour, sunset_icon_pos, (icon_small, icon_small), '\uf052') + write(im_black, sunset_time_pos, (col_width - icon_small, row_height), sunset, + font=self.font) + + # Add the forecast data to the correct places + for pos in range(1, len(fc_data) + 1): + stamp = fc_data[f'fc{pos}']['stamp'] + + icon = weathericons[fc_data[f'fc{pos}']['icon']] + temp = fc_data[f'fc{pos}']['temp'] + + write(im_black, eval(f'stamp_fc{pos}'), (col_width, row_height), + stamp, font=self.font) + draw_icon(im_colour, eval(f'icon_fc{pos}'), (col_width, row_height + line_gap * 2), + icon) + write(im_black, eval(f'temp_fc{pos}'), (col_width, row_height), + temp, font=self.font) + + border_h = row3 + row_height + border_w = col_width - 3 # leave 3 pixels gap + + # Add borders around each sub-section + draw_border(im_black, (col1, row1), (col_width * 3 - 3, border_h), + shrinkage=(0, 0)) + + for _ in range(4, 8): + draw_border(im_black, (eval(f'col{_}'), row1), (border_w, border_h), + shrinkage=(0, 0)) + # return the images ready for the display - return get_scraped_weatherforecast_image() + return im_black, im_colour if __name__ == '__main__': From 0d8cb6c42a09a4624dc8f8efdb4ac0add2f074a0 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:46 +0100 Subject: [PATCH 12/54] no image processing on main remove the weather scraper call from the inky image module --- inkycal/main.py | 8 ++++---- inkycal/modules/inkycal_image.py | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/inkycal/main.py b/inkycal/main.py index 122a817..153d745 100644 --- a/inkycal/main.py +++ b/inkycal/main.py @@ -518,12 +518,12 @@ class Inkycal: def _optimize_im(image, threshold=220): """Optimize the image for rendering on ePaper displays""" - buffer = numpy.array(image.convert('RGB')) - red, green = buffer[:, :, 0], buffer[:, :, 1] + #buffer = numpy.array(image.convert('RGB')) + #red, green = buffer[:, :, 0], buffer[:, :, 1] # grey->black - buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] - image = Image.fromarray(buffer) + #buffer[numpy.logical_and(red <= threshold, green <= threshold)] = [0, 0, 0] + #image = Image.fromarray(buffer) return image def calibrate(self): diff --git a/inkycal/modules/inkycal_image.py b/inkycal/modules/inkycal_image.py index dcd4b8d..37b4a1a 100755 --- a/inkycal/modules/inkycal_image.py +++ b/inkycal/modules/inkycal_image.py @@ -6,7 +6,6 @@ Copyright by aceinnolab """ from inkycal.modules.template import inkycal_module -from inkycal.modules.inkycal_openweather_scrape import get_scraped_weatherforecast_image from inkycal.custom import * from inkycal.modules.inky_image import Inkyimage as Images @@ -69,9 +68,6 @@ class Inkyimage(inkycal_module): print(f'{__name__} loaded') def generate_image(self): - """Call the openweather scraper""" - _,_ = get_scraped_weatherforecast_image() - """Generate image for this module""" # Define new image size with respect to padding From f146949249aad1e66c7c46a6252db3caf2013f36 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 20 Nov 2023 17:29:46 +0100 Subject: [PATCH 13/54] latest best guess at scraping the weather --- inkycal/modules/inkycal_openweather_scrape.py | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/inkycal/modules/inkycal_openweather_scrape.py b/inkycal/modules/inkycal_openweather_scrape.py index ef56b72..42185d7 100644 --- a/inkycal/modules/inkycal_openweather_scrape.py +++ b/inkycal/modules/inkycal_openweather_scrape.py @@ -1,12 +1,13 @@ from PIL import Image from PIL import ImageEnhance from selenium import webdriver -from selenium.common.exceptions import ElementClickInterceptedException +from selenium.common.exceptions import ElementClickInterceptedException, TimeoutException, NoSuchElementException from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait +import sys import time def get_scraped_weatherforecast_image() -> Image: @@ -47,7 +48,14 @@ def get_scraped_weatherforecast_image() -> Image: time.sleep(10) # hacky wait statement for all the page elements to load - WebDriverWait(driver, timeout=20).until(lambda d: d.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]/h2').text != "") + page_loaded = False + while(page_loaded == False): + try: + WebDriverWait(driver, timeout=45).until(lambda d: d.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]/h2').text != "") + page_loaded = True + except TimeoutException: + print("Couldn't get the page to load, retrying...") + time.sleep(60) # Scroll to the start of the forecast forecast_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[1]/div[1]') @@ -57,8 +65,12 @@ def get_scraped_weatherforecast_image() -> Image: map_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[1]/div[2]') driver.execute_script("arguments[0].remove();", map_element) + # remove the hourly forecast + #map_element = driver.find_element(By.XPATH, '//*[@id="weather-widget"]/div[2]/div[2]/div[1]') + #driver.execute_script("arguments[0].remove();", map_element) + # zoom in a little - not now - #driver.execute_script("document.body.style.zoom='110%'"); + driver.execute_script("document.body.style.zoom='110%'"); html_element = driver.find_element(By.TAG_NAME, "html") driver.execute_script("arguments[0].style.fontSize = '16px';", html_element) @@ -72,10 +84,10 @@ def get_scraped_weatherforecast_image() -> Image: # crop, resize, enhance & rotate the image for inky display im = Image.open(image_filename, mode='r', formats=None) - im = im.crop((0, 50, my_width, my_height)) - #im = im.resize((800, 480), Image.Resampling.LANCZOS) + im = im.crop((0, 100, (my_width-50), (my_height-50))) + im = im.resize((480, 800), resample=Image.LANCZOS) #im = im.rotate(90, Image.NEAREST, expand = 1) - im = ImageEnhance.Contrast(im).enhance(1.3) + im = ImageEnhance.Contrast(im).enhance(1.0) im.save(image_filename) return im, im @@ -83,5 +95,6 @@ def main(): _, _ = get_scraped_weatherforecast_image() if __name__ == '__main__': - print(f'running {__name__} in standalone/debug mode') + now = time.asctime() + print(f"It's {now} - running {__name__} in standalone/debug mode") main() From b885105147079a2f36b0c286d464ff6ca8f8f120 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Sun, 26 Nov 2023 20:29:02 +0100 Subject: [PATCH 14/54] bump devcontainer to bookworm, add documentation --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 11 +- README.md | 290 +----------------- inkycal/modules/inkycal_openweather_scrape.py | 40 ++- run_weather_scraper.sh | 2 +- 5 files changed, 37 insertions(+), 308 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 36562fb..7143502 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim-bullseye as development +FROM python:3.11-slim-bookworm as development WORKDIR /app RUN apt-get -y update && apt-get install -yqq dos2unix chromium chromium-driver \ libxi6 libgconf-2-4 python3-selenium \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 03b1ec4..1bf5540 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,17 +1,16 @@ // For format details, see https://aka.ms/devcontainer.json. { "name": "Inkycal-dev", - "build": { - "dockerfile": "Dockerfile", - "target": "development" - }, - + "build": { + "dockerfile": "Dockerfile", + "target": "development" + }, // This is the settings.json mount "mounts": ["source=/c/temp/settings_test.json,target=/boot/settings.json,type=bind,consistency=cached"], // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "chmod +x ./.devcontainer/postCreate.sh && ./.devcontainer/postCreate.sh", + "postCreateCommand": "dos2unix ./.devcontainer/postCreate.sh && chmod +x ./.devcontainer/postCreate.sh && ./.devcontainer/postCreate.sh", "customizations": { "vscode": { diff --git a/README.md b/README.md index 4608ede..8a482a2 100644 --- a/README.md +++ b/README.md @@ -1,287 +1,9 @@ -# Welcome to inkycal v2.0.3! +# Inkycal-based full screen weather display (scraper solution) -
-
-
-
-
hd2cTtUX0aaI!TN9@b}3mvm64ILe*L<%vSK0-Zz zKj@tU&uwOA!YVKN_3OW3!}p^{kLJC#SXEUel}f$5JTXg1myEuB`$k3mEHC=r69oYT z_(_wjSZ{A&HjNzlm8q%e#EBwU6GRkWxw*N=jzz`B#-ygE(qRjrnhy_;pl|8EKMDd- zQAh3V?Rb}TW4>TwHf`GM>C-2Q-rs85wp~a_2}i2A&NpO?Rig6hos=A_k5qk@#ss30XYDo6>93KB#^<9`rQ8}va& R&&dD)002ovPDHLkV1k-)`LO^1 literal 0 HcmV?d00001 diff --git a/icons/ui-icons/humidity.bmp b/icons/ui-icons/humidity.bmp new file mode 100644 index 0000000000000000000000000000000000000000..7248bbb0f859b9f522b238a320062ab711a70042 GIT binary patch literal 1216 zcmcJOF>Zx042FrQl%WGsFOapTXr%7FLvNC(OUHL5I&lr8cLBOFAl(1A9Ue=EN_`Q5 z4=45?8}s@$K6E->aDT>p_ZhkX>beiCKRw!1gWp8t{CYn==|qva31yM3G0xHs)00PA z!1lu-kyo>4vO5>qahYAD1`iZyD^j@-=$DLpnadJQAj+34FmTTxQI-xDc~5|%oVE jC}DgF2x{5N^=GV8|!uj3aV#(8e_m`k@P)YiNv~@>XJLW^XYHFN4d%aZN6ZfLnGc z2<^qCAa=Al#aehCo+;SCPck+}$JfT)@f*QXj_|ikxG{Mq GnS&ot;c+3#`s{BZPOQDM)0h!M)Sdu0A z{^*agd^cUMYR}Dr1SOHT{=b}8TZC-^z}t45KkhpKFWa1e!8iiNI02J!2K=z*>j@L9 zOLuyhxnB=6YbX!KtYJOy-k9_J#e7F*u8GWdw0bgUs%@g0b1#~3iQenjgzGHD@(=GU opRud;VV+XeeQZUzM>;5j^_p3Sqc@%3pbm%0BJ@tB8>`-wzSUq2)&Kwi literal 0 HcmV?d00001 diff --git a/icons/ui-icons/rain-chance.bmp b/icons/ui-icons/rain-chance.bmp new file mode 100644 index 0000000000000000000000000000000000000000..dacb1fe08128b6f81a92df23f3ba1e6ec8c2d7d6 GIT binary patch literal 12064 zcmeI1JB}nb42F9!!3GWn@CD@1fnndk1#Ip!Nk^-r2tI*B2Md?^lOjburv{$&0*fhN zyY%?<^C6b1r}y(8KmGRL>v#J6ng0FqB>$cs)S&CnUmuSje~^DXP(H5f^4*X2M+UxS z23~Tp{``-+aU^ZId;Gg}!d0f9uI%PZ^XXEVL#IDoy42y%_7ueHFByNizBr&XKV53> zQkh^T9R6}$CwHGNl{w6W -1Li2ieIa(}wLG>u0iQY{P&WPTjdKCDmcb9`Rq8C+<0w49jNuKu{oDq&1lD|N$ z)29yY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_Em~bWFIs;E?&)g{i*BNlb*`!a6D>!6e!j(Yk4#0qm$_yVg?lZgM zN+7ll{h40bk)&WC?$nOIN1AX`hwpe!3}+pR#3k+cyKJ$gg0MOF2$<4D^C~an+L1Ud zB@WBY`6fKnL?eCL_6*vXQ=bAgRlDcd)+wXMYg`GKFpH_z;}|7i*X*fMTjD&sYPsxD z7?VH(TDhOsezaL`ojTs%4{*qa6wi_i;80D{NVH;l$@CX}wWTRUgQcb+O4n-J%Ek$_ z Qa$gb1eCT5*J zGUWW*q@_tr-uUN#hdy_l3pnk#S_!*weZZS4fT5@nZ^LyzsGmFcT 5#_+!lebY&hGxWdldw4LLmR`#oD)_?Y;}!1tJee*wHh1yKM1 literal 0 HcmV?d00001 diff --git a/icons/ui-icons/uv.bmp b/icons/ui-icons/uv.bmp new file mode 100644 index 0000000000000000000000000000000000000000..12294b710ef64d6f56b3e63690259d7b3efbe500 GIT binary patch literal 64080 zcmeHQ30xIb+ke0Xj8V`?a@Slw6v2%I!7ULHC33+f6`@3MUoyiqHA~G@ESGYZOi %vqi}Gk5OX#fslg=bUH#|7Y% MIyHa3I`z>#gwX zufM|3p+ligojUN%H{Za=AAbyyk&!Te{(LAZDuR0T>cO|)ehUp6G=N)fxdpm+?+(+Z zO@pyx$HJ;rt6<~Cjj& c^?c2A9 z+i$-e?z!h4$j!}#UcGuj)22 G1yh??ZTaIK2M) z>ktwW0{7l~FU*@a5B~k{e?wec9CYi}4gUD!4`|-JIsE58|AF}Uc<9if1C*AQ!q%-@ z;kVy@gN_|LLXRFjAR;0HE?&F{RjXEox88aSR;*Y7qehK_yu3WP@4oxslTSW@va&LG z@WBUR$&w|oZQC|z(V_*!#Kb`B)~(^^pMQp3yLQ2zJ$vAT4?ciCefmH~Mh1)+F#=wD z?KP-Yts0b Yu~va+(^%{SkKx8Hsno_+RNSi5#DEL*k=?!NnO*uQ^2 z)U8_=8aHkX>({S`F=NKSrcImRi!Z)_Hf`F#=bwKLix)43S6+Dq`u6P$6D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?`5tlIE nQUZV)@NhaLz<&AIm3PKbJ50 llqGB_vT3cY z !pOj~8;p#b^4nS2QBBni zV1_$jJA+EnG~Hz0F~~)K->%mmFEquy4!Xs9LJjY5(~F9)l9-_924IT2#;zj%`NkKF zQNMR;sk&&EvFo&$<36^!nnf**)A>EszY=CF;;}CIFe82P=D0&X)@Pd+X9l~cKDS{l z3}SJ#c6^iE(RHVJmW+66W5qQikl~^X^-VXplS68j`^XISvo4o%as`RJrixFK^Q%W< zO}-$nS?+MFnn^AV6ZHlQFnFlq?>$+A423k!eNdK6Svd~&&oD)@0zfVdFht$tZ=5~$ z06CL#6m^LjLu1OSYlecrS-3gVSRB*W9WrlWQuY&cavB3;(yBKNq_fdZB=g*%1G5yc zuSw{hyY(c=ry5&=X3OdUcj!gkVe5L%!EA(X-PM-dP3)>@?Vz4;hYx&or-7N0b=9Yv~AbE zgHD#fRC~%jFj*Nx^$&OQH$oEk&l@|XSB2Hz`MSG3CUsR@QDY#HvB;*zJg rrxqjtmI%oy3k+2_ZJHl=Rh!?cc;b zU*-)JJ7GRzT-z9E01@4=e%RGf9BpD||N6fivuPjrZanhCc*{@Yz5DKoIq8Duz&xwJ zupBNdEbxa^IY)4Iyc8x9zv>WH9TMAk6ow`)<~h+8_fq|dMq{Eu8F9wQXN;Q0&?T(q zS#qjLEw!!()lC~1HL9K!qn`Qk?Z(-0>Wq|MTg#axuyHxr#wDfJb$iOKs( Image: + """ + Gets the requested weather icon as Image and returns it in the requested size + :param icon_name: + icon_name for the weather + :param size: + size of the icon in pixels + :return: + the resized weather icon + """ + weatherdir = os.path.dirname(os.path.abspath(__file__)) + iconpath = os.path.join(weatherdir, "owm_icons_cache", f"{icon_name}.png") + + if not os.path.exists(iconpath): + urllib.request.urlretrieve( + url=f"https://openweathermap.org/img/wn/{icon_name}@2x.png", filename=f"{iconpath}" + ) + icon = Image.open(iconpath) + + icon = icon.resize((size, size)) + + return icon diff --git a/inkycal/__init__.py b/inkycal/__init__.py index 1ae709a..0c6a244 100644 --- a/inkycal/__init__.py +++ b/inkycal/__init__.py @@ -13,6 +13,7 @@ import inkycal.modules.inkycal_slideshow import inkycal.modules.inkycal_stocks import inkycal.modules.inkycal_webshot import inkycal.modules.inkycal_xkcd +import inkycal.modules.inkycal_fullweather # Main file from inkycal.main import Inkycal diff --git a/inkycal/custom/functions.py b/inkycal/custom/functions.py index 8eddd4e..cf2b1ed 100644 --- a/inkycal/custom/functions.py +++ b/inkycal/custom/functions.py @@ -35,7 +35,7 @@ for path, dirs, files in os.walk(fonts_location): if _.endswith('.ttf'): name = _.split('.ttf')[0] fonts[name] = os.path.join(path, _) - +logs.debug(f"Found fonts: {json.dumps(fonts, indent=4, sort_keys=True)}") available_fonts = [key for key, values in fonts.items()] diff --git a/inkycal/custom/owm_forecasts.py b/inkycal/custom/owm_forecasts.py new file mode 100644 index 0000000..4e864b0 --- /dev/null +++ b/inkycal/custom/owm_forecasts.py @@ -0,0 +1,141 @@ +import logging +from datetime import datetime +from datetime import timedelta + +import arrow +from dateutil import tz +from pyowm import OWM +from pyowm.utils.config import get_default_config + +from inkycal.custom.functions import get_system_tz + +## Configure logger instance for local logging +logger = logging.getLogger(__name__) +logger.setLevel(logging.DEBUG) + + +def is_timestamp_within_range(timestamp, start_time, end_time): + # Check if the timestamp is within the range + return start_time <= timestamp <= end_time + + +def get_owm_data(city_id: int, token: str, temp_units: str, wind_units: str, language: str): + config_dict = get_default_config() + config_dict["language"] = language + + tz_zone = tz.gettz(get_system_tz()) + + owm = OWM(token, config_dict) + + mgr = owm.weather_manager() + + current_observation = mgr.weather_at_id(id=city_id) + current_weather = current_observation.weather + hourly_forecasts = mgr.forecast_at_id(id=city_id, interval="3h") + + # Forecasts are provided for every 3rd full hour + # - find out how many hours there are until the next 3rd full hour + now = arrow.utcnow() + if (now.hour % 3) != 0: + hour_gap = 3 - (now.hour % 3) + else: + hour_gap = 3 + + # Create timings for hourly forcasts + steps = [i * 3 for i in range(40)] + forecast_timings = [now.shift(hours=+hour_gap + step).floor("hour") for step in steps] + + # Create forecast objects for given timings + forecasts = [hourly_forecasts.get_weather_at(forecast_time.datetime) for forecast_time in forecast_timings] + + # Add forecast-data to fc_data list of dictionaries + hourly_data_dict = [] + for forecast in forecasts: + temp = forecast.temperature(unit=temp_units)["temp"] + min_temp = forecast.temperature(unit=temp_units)["temp_min"] + max_temp = forecast.temperature(unit=temp_units)["temp_max"] + wind = forecast.wind(unit=wind_units)["speed"] + wind_gust = forecast.wind(unit=wind_units)["gust"] + # combined precipitation (snow + rain) + precip_mm = 0.0 + if "3h" in forecast.rain.keys(): + precip_mm = +forecast.rain["3h"] + if "3h" in forecast.snow.keys(): + precip_mm = +forecast.snow["3h"] + + icon = forecast.weather_icon_name + hourly_data_dict.append( + { + "temp": temp, + "min_temp": min_temp, + "max_temp": max_temp, + "precip_3h_mm": precip_mm, + "wind": wind, + "wind_gust": wind_gust, + "icon": icon, + "datetime": forecast_timings[forecasts.index(forecast)].datetime.astimezone(tz=tz_zone), + } + ) + + return (current_weather, hourly_data_dict) + + +def get_forecast_for_day(days_from_today: int, hourly_forecasts: list) -> dict: + """Get temperature range, rain and most frequent icon code for forecast + days_from_today should be int from 0-4: e.g. 2 -> 2 days from today + """ + # Calculate the start and end times for the specified number of days from now + current_time = datetime.now() + tz_zone = tz.gettz(get_system_tz()) + start_time = ( + (current_time + timedelta(days=days_from_today)) + .replace(hour=0, minute=0, second=0, microsecond=0) + .astimezone(tz=tz_zone) + ) + end_time = (start_time + timedelta(days=1)).astimezone(tz=tz_zone) + + # Get all the forecasts for that day's time range + forecasts = [ + f + for f in hourly_forecasts + if is_timestamp_within_range(timestamp=f["datetime"], start_time=start_time, end_time=end_time) + ] + + # if all the forecasts are from the next day, at least use the first one in the list to be able to return something + if forecasts == []: + forecasts.append(hourly_forecasts[0]) + + # Get rain and temperatures for that day + temps = [f["temp"] for f in forecasts] + rain = sum([f["precip_3h_mm"] for f in forecasts]) + + # Get all weather icon codes for this day + icons = [f["icon"] for f in forecasts] + day_icons = [icon for icon in icons if "d" in icon] + + # Use the day icons if possible + icon = max(set(day_icons), key=icons.count) if len(day_icons) > 0 else max(set(icons), key=icons.count) + + # Return a dict with that day's data + day_data = { + "datetime": start_time.timestamp(), + "icon": icon, + "temp_min": min(temps), + "temp_max": max(temps), + "precip_mm": rain, + } + + return day_data + + +def main(): + config_dict = get_default_config() + config_dict["language"] = "en" + token = "daa8543f445b602da5d827e90f1d22b3" + city_id = 2867714 + + print(get_owm_data(city_id=city_id, token=token, temp_units="fahrenheit", wind_units="knots", language="en")) + + +if __name__ == "__main__": + main() diff --git a/inkycal/modules/__init__.py b/inkycal/modules/__init__.py index 3c0d809..7eb656d 100755 --- a/inkycal/modules/__init__.py +++ b/inkycal/modules/__init__.py @@ -10,3 +10,4 @@ from .inkycal_slideshow import Slideshow from .inkycal_textfile_to_display import TextToDisplay from .inkycal_webshot import Webshot from .inkycal_xkcd import Xkcd +from .inkycal_fullweather import Fullweather diff --git a/inkycal/modules/inkycal_fullweather.py b/inkycal/modules/inkycal_fullweather.py new file mode 100644 index 0000000..f98a6eb --- /dev/null +++ b/inkycal/modules/inkycal_fullweather.py @@ -0,0 +1,442 @@ +""" +Inkycal fullscreen weather module +Copyright by mrbwburns +""" +import locale +import logging +import math +import os +from datetime import datetime + +import matplotlib.dates as mdates +import matplotlib.pyplot as plt +import matplotlib.ticker as ticker +import numpy as np +from PIL import Image +from PIL import ImageDraw +from PIL import ImageFont +from PIL import ImageOps + +from icons.weather_icons.weather_icons import get_weather_icon +from inkycal.custom import owm_forecasts +from inkycal.custom.functions import fonts +from inkycal.custom.functions import internet_available +from inkycal.custom.functions import top_level +from inkycal.custom.inkycal_exceptions import NetworkNotReachableError +from inkycal.modules.template import inkycal_module + +logger = logging.getLogger(__name__) +logger.setLevel("DEBUG") + +icons_dir = os.path.join(top_level, "icons", "ui-icons") + + +def outline(image: Image, size: int, color: tuple) -> Image: + # Create a canvas for the outline image + outlined = Image.new("RGBA", image.size, (0, 0, 0, 0)) + + # Make a black outline + for x in range(image.width): + for y in range(image.height): + pixel = image.getpixel((x, y)) + if pixel[0] != 0 or pixel[1] != 0 or pixel[2] != 0: + outlined.putpixel((x, y), color) + + # Enlarge the outlined image, and paste the original image on top to create a shadow effect + outlined = outlined.resize((outlined.width + size, outlined.height + size)) + paste_position = ((outlined.width - image.width) // 2, (outlined.height - image.height) // 2) + outlined.paste(image, paste_position, image) + + # Create a mask to prevent transparent pixels from overwriting + mask = Image.new("L", outlined.size, 255) + outlined = Image.composite(outlined, Image.new("RGBA", outlined.size, (0, 0, 0, 0)), mask) + + return outlined + + +class Fullweather(inkycal_module): + """Fullscreen Weather class + gets weather details from openweathermap and plots a nice fullscreen forecast picture + """ + + name = "Fullscreen weather (openweathermap) - Get weather forecasts from openweathermap" + + requires = { + "api_key": { + "label": "Please enter openweathermap api-key. You can create one for free on openweathermap", + }, + "location": { + "label": "Please enter your location ID found in the url " + + "e.g. https://openweathermap.org/city/4893171 -> ID is 4893171" + }, + } + + optional = { + "temp_units": { + "label": "Which temperature unit should be used?", + "options": ["celsius", "fahrenheit"], + }, + "wind_units": { + "label": "Which wind speed unit should be used?", + "options": ["beaufort", "knots", "miles_hour", "km_hour", "meters_sec"], + }, + "wind_gusts": { + "label": "Should current wind gust speed also be displayed?", + "options": [True, False], + }, + "keep_history": { + "label": "Should the weather data be written to local json files (one per query)?", + "options": [True, False], + }, + "min_max_annotations": { + "label": "Should the temperature plot have min/max annotation labels?", + "options": [True, False], + }, + "locale": { + "label": "Your locale", + "options": ["de_DE.UTF-8", "en_GB.UTF-8"], + }, + "tz": { + "label": "Your timezone", + "options": ["Europe/Berlin", "UTC"], + }, + "font_family": { + "label": "Font family to use for the entire screen", + "options": ["Roboto", "NotoSans", "Poppins"], + }, + "chart_title": { + "label": "Title of the temperature and precipitation plot", + "options": ["Temperatur und Niederschlag", "Temperature and precipitation"], + }, + "weekly_title": { + "label": "Title of the weekly weather forecast", + "options": ["Tageswerte", "Weekly forecast"], + }, + "icon_outline": { + "label": "Should the weather icons have outlines?", + "options": [True, False], + }, + } + + def __init__(self, config): + """Initialize inkycal_weather module""" + + super().__init__(config) + + config = config["config"] + + # Check if all required parameters are present + for param in self.requires: + if not param in config: + raise Exception(f"config is missing {param}") + + # required parameters + self.api_key = config["api_key"] + self.location = int(config["location"]) + self.font_size = int(config["fontsize"]) + + # optional parameters + if "wind_units" in config: + self.wind_units = config["wind_units"] + else: + self.wind_units = "meters_sec" + if self.wind_units == "beaufort": + self.windDispUnit = "bft" + elif self.wind_units == "knots": + self.windDispUnit = "kn" + elif self.wind_units == "km_hour": + self.windDispUnit = "km/h" + elif self.wind_units == "miles_hour": + self.windDispUnit = "mph" + else: + self.windDispUnit = "m/s" + + if "wind_gusts" in config: + self.wind_gusts = bool(config["wind_gusts"]) + else: + self.wind_gusts = True + + if "temp_units" in config: + self.temp_units = config["temp_units"] + else: + self.temp_units = "celsius" + if self.temp_units == "fahrenheit": + self.tempDispUnit = "F" + elif self.temp_units == "celsius": + self.tempDispUnit = "°" + + if "weekly_title" in config: + self.weekly_title = config["weekly_title"] + else: + self.weekly_title = "Weekly forecast" + + if "chart_title" in config: + self.chart_title = config["chart_title"] + else: + self.chart_title = "Temperature and precipitation" + + if "keep_history" in config: + self.keep_history = config["keep_history"] + else: + self.keep_history = False + + if "min_max_annotations" in config: + self.min_max_annotations = bool(config["min_max_annotations"]) + else: + self.min_max_annotations = False + + if "locale" in config: + self.locale = config["locale"] + else: + self.locale = "en_GB.UTF-8" + locale.setlocale(locale.LC_TIME, self.locale) + self.language = self.locale.split("_")[0] + + if "tz" in config: + self.tz = config["tz"] + else: + self.tz = "UTC" + + if "icon_outline" in config: + self.icon_outline = config["icon_outline"] + else: + self.icon_outline = True + + if "font_family" in config: + self.font_family = config["font_family"] + else: + self.font_family = "Roboto" + + # some calculations for scalability + # TODO: make this work for all sizes + self.screen_width_in = 163 / 25.4 # 163 mm for 7in5 + self.screen_height_in = 98 / 25.4 # 98 mm for 7in5 + self.dpi = math.sqrt( + (float(self.width) ** 2 + float(self.height) ** 2) + / (self.screen_width_in**2 + self.screen_height_in**2) + ) + self.left_section_width = int(self.width / 4) + + # give an OK message + print(f"{__name__} loaded") + + def createBaseImage(self): + """ + Creates background and adds current date + """ + # Create white image + self.image = Image.new("RGB", (self.width, self.height), (255, 255, 255)) + image_draw = ImageDraw.Draw(self.image) + + # Create black rectangle for the current weather section + rect_width = int(self.width / 4) + image_draw.rectangle((0, 0, rect_width, self.height), fill=0) + + # Add text with current date + now = datetime.now() + dateString = now.strftime("%d. %B") + dateFont = self.get_font(family=self.font_family, style="Bold", size=self.font_size) + # Get the width of the text + dateStringbbox = dateFont.getbbox(dateString) + dateW = dateStringbbox[2] - dateStringbbox[0] + # Draw the current date centered + image_draw.text(((rect_width - dateW) / 2, 5), dateString, font=dateFont, fill=(255, 255, 255)) + + def addUserSection(self): + """ + Adds user-defined section to the given image + """ + ## Create drawing object for image + image_draw = ImageDraw.Draw(self.image) + + if False: # self.mqtt_sub == True: + # Add icon for Home + homeTempIcon = Image.open(os.path.join(icons_dir, "home_temp.png")) + homeTempIcon = ImageOps.invert(homeTempIcon) + homeTempIcon = homeTempIcon.resize((40, 40)) + homeTemp_y = int(self.height * 0.8125) + self.image.paste(homeTempIcon, (15, homeTemp_y)) + + # Home temperature + # my_home = mqtt_temperature(host=mqtt_host, port=mqtt_port, user=mqtt_user, password=mqtt_pass, topic=mqtt_topic) + # homeTemp = None + # while homeTemp == None: + # homeTemp = my_home.get_temperature() + # homeTempString = f"{homeTemp:.1f} {tempDispUnit}" + # homeTempFont = font.font(font_family, "Bold", 28) + # image_draw.text((65, homeTemp_y), homeTempString, font=homeTempFont, fill=(255, 255, 255)) + + # Add icon for rH + humidityIcon = Image.open(os.path.join(icons_dir, "humidity.bmp")) + humidityIcon = humidityIcon.resize((40, 40)) + humidity_y = int(self.height * 0.90625) + self.image.paste(humidityIcon, (15, humidity_y)) + + # rel. humidity + # rH = None + # while rH == None: + # rH = my_home.get_rH() + # humidityString = f"{rH:.0f} %" + # humidityFont = font.font(font_family, "Bold", 28) + # image_draw.text((65, humidity_y), humidityString, font=humidityFont, fill=(255, 255, 255)) + else: + # Add icon for Humidity + humidityIcon = Image.open(os.path.join(icons_dir, "humidity.bmp")) + humidityIcon = humidityIcon.resize((40, 40)) + humidity_y = int(self.height * 0.8125) + self.image.paste(humidityIcon, (15, humidity_y)) + + # Humidity + humidityString = f"{self.current_weather.humidity} %" + humidityFont = self.get_font(self.font_family, "Bold", 28) + image_draw.text((65, humidity_y), humidityString, font=humidityFont, fill=(255, 255, 255)) + + # Add icon for uv + uvIcon = Image.open(os.path.join(icons_dir, "uv.bmp")) + uvIcon = uvIcon.resize((40, 40)) + ux_y = int(self.height * 0.90625) + self.image.paste(uvIcon, (15, ux_y)) + + # uvindex + uvString = f"{self.current_weather.uvi if self.current_weather.uvi else '0'}" + uvFont = self.get_font(self.font_family, "Bold", 28) + image_draw.text((65, ux_y), uvString, font=uvFont, fill=(255, 255, 255)) + + def addCurrentWeather(self): + """ + Adds current weather situation to the left section of the image + """ + ## Create drawing object for image + image_draw = ImageDraw.Draw(self.image) + + ## Add detailed weather status text to the image + sumString = self.current_weather.detailed_status.replace(" ", "\n ") + sumFont = self.get_font(self.font_family, "Regular", self.font_size + 8) + maxW = 0 + totalH = 0 + for word in sumString.split("\n "): + sumStringbbox = sumFont.getbbox(word) + sumW = sumStringbbox[2] - sumStringbbox[0] + sumH = sumStringbbox[3] - sumStringbbox[1] + maxW = max(maxW, sumW) + totalH += sumH + sumtext_x = int((self.left_section_width - maxW) / 2) + sumtext_y = int(self.height * 0.19) - totalH + image_draw.multiline_text((sumtext_x, sumtext_y), sumString, font=sumFont, fill=(255, 255, 255), align="center") + logger.debug(f"Added current weather detailed status text: {sumString} at x:{sumtext_x}/y:{sumtext_y}.") + + ## Add current weather icon to the image + icon = get_weather_icon(icon_name=self.current_weather.weather_icon_name, size=150) + # Create a mask from the alpha channel of the weather icon + if len(icon.split()) == 4: + mask = icon.split()[-1] + else: + mask = None + # Paste the foreground of the icon onto the background with the help of the mask + icon_x = int((self.left_section_width - icon.width) / 2) + icon_y = int(self.height * 0.2) + self.image.paste(icon, (icon_x, icon_y), mask) + + ## Add current temperature to the image + tempString = f"{self.current_weather.temperature(self.temp_units)['feels_like']:.0f}{self.tempDispUnit}" + tempFont = self.get_font(self.font_family, "Bold", 68) + # Get the width of the text + tempStringbbox = tempFont.getbbox(tempString) + tempW = tempStringbbox[2] - tempStringbbox[0] + temp_x = int((self.left_section_width - tempW) / 2) + temp_y = int(self.height * 0.4375) + # Draw the current temp centered + image_draw.text((temp_x, temp_y), tempString, font=tempFont, fill=(255, 255, 255)) + + # Add icon for rain forecast + rainIcon = Image.open(os.path.join(icons_dir, "rain-chance.bmp")) + rainIcon = rainIcon.resize((40, 40)) + rain_y = int(self.height * 0.625) + self.image.paste(rainIcon, (15, rain_y)) + + # Amount of precipitation within next 3h + rain = self.hourly_forecasts[0]["precip_3h_mm"] + precipString = f"{rain:.1g} mm" if rain > 0.0 else "0 mm" + precipFont = self.get_font(self.font_family, "Bold", 28) + image_draw.text((65, rain_y), precipString, font=precipFont, fill=(255, 255, 255)) + + # Add icon for wind speed + windIcon = Image.open(os.path.join(icons_dir, "wind.bmp")) + windIcon = windIcon.resize((40, 40)) + wind_y = int(self.height * 0.719) + self.image.paste(windIcon, (15, wind_y)) + + # Max. wind speed within next 3h + wind_gust = f"{self.hourly_forecasts[0]['wind_gust']:.0f}" + wind = f"{self.hourly_forecasts[0]['wind']:.0f}" + if self.wind_gusts: + if wind == wind_gust: + windString = f"{wind} {self.windDispUnit}" + else: + windString = f"{wind} - {wind_gust} {self.windDispUnit}" + else: + windString = f"{wind} {self.windDispUnit}" + + windFont = self.get_font(self.font_family, "Bold", 28) + image_draw.text((65, wind_y), windString, font=windFont, fill=(255, 255, 255)) + + def generate_image(self): + """Generate image for this module""" + + # Define new image size with respect to padding + im_width = int(self.width - (2 * self.padding_left)) + im_height = int(self.height - (2 * self.padding_top)) + im_size = im_width, im_height + logger.info(f"Image size: {im_size}") + + # Check if internet is available + if internet_available(): + logger.info("Connection test passed") + else: + raise NetworkNotReachableError + + # Get the weather + (self.current_weather, self.hourly_forecasts) = owm_forecasts.get_owm_data( + token=self.api_key, + city_id=self.location, + temp_units=self.temp_units, + wind_units=self.wind_units, + language=self.language, + ) + + ## Create Base Image + self.createBaseImage() + + ## Add Current Weather to the left section + self.addCurrentWeather() + + ## Add user-configurable section to the bottom left corner + self.addUserSection() + + ## Add Hourly Forecast + # my_image = addHourlyForecast(display=display, image=my_image, hourly_forecasts=hourly_forecasts) + + ## Add Daily Forecast + # my_image = addDailyForecast(display=display, image=my_image, hourly_forecasts=hourly_forecasts) + + self.image.save("./openweather_full.png") + + logger.info("Fullscreen weather forecast generated successfully.") + # Return the images ready for the display + # tbh, I have no idea why I need to return two separate images here + return self.image, self.image + + @staticmethod + def get_font(family, style, size): + # Returns the TrueType font object with the given characteristics + if family == "Roboto" and style == "ExtraBold": + style = "Black" + elif family == "Ubuntu" and style in ["ExtraBold", "Black"]: + style = "Bold" + elif family == "OpenSans" and style == "Black": + style = "ExtraBold" + return ImageFont.truetype(fonts[f"{family}-{style}"], size=size) + + +if __name__ == "__main__": + print(f"running {__name__} in standalone mode") diff --git a/requirements.txt b/requirements.txt index 9a2a652..bd22fa7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,33 +1,52 @@ +appdirs==1.4.4 arrow==1.3.0 +asyncio==3.4.3 +beautifulsoup4==4.12.2 certifi==2023.7.22 +charset-normalizer==3.3.2 +colorzero==2.0 +contourpy==1.2.0 cycler==0.12.1 feedparser==6.0.10 fonttools==4.45.1 +frozendict==2.4.0 +geojson==2.5.0 gpiozero==2.0 +html2text==2020.1.16 +html5lib==1.1 +htmlwebshot==0.1.2 icalendar==5.0.11 +idna==3.6 kiwisolver==1.4.5 lgpio==0.0.0.2 lxml==4.9.3 matplotlib==3.8.2 +multitasking==0.0.11 numpy==1.26.2 packaging==23.2 +pandas==2.1.4 +peewee==3.17.0 Pillow==10.1.0 +pyowm==3.3.0 pyparsing==3.1.1 PySocks==1.7.1 python-dateutil==2.8.2 +python-dotenv==1.0.0 pytz==2023.3.post1 recurring-ical-events==2.1.1 requests==2.31.0 RPi.GPIO==0.7.1 sgmllib3k==1.0.0 six==1.16.0 +soupsieve==2.5 spidev==3.5 todoist-api-python==2.1.3 +types-python-dateutil==2.8.19.20240106 typing_extensions==4.8.0 +tzdata==2023.4 +tzlocal==5.2 urllib3==2.1.0 -python-dotenv==1.0.0 -setuptools==69.0.2 -html2text==2020.1.16 -yfinance==0.2.32 -htmlwebshot~=0.1.2 +webencodings==0.5.1 +x-wr-timezone==0.0.6 xkcd==2.4.2 +yfinance==0.2.32 From e80387f66ab5d20ca178a03c4e5245b961b21e99 Mon Sep 17 00:00:00 2001 From: mrbwburns <> Date: Mon, 15 Jan 2024 19:09:24 +0100 Subject: [PATCH 18/54] some more fonts --- fonts/Poppins/OFL.txt | 93 ++++++++++ fonts/Poppins/Poppins-Black.ttf | Bin 0 -> 151396 bytes fonts/Poppins/Poppins-BlackItalic.ttf | Bin 0 -> 171604 bytes fonts/Poppins/Poppins-Bold.ttf | Bin 0 -> 153944 bytes fonts/Poppins/Poppins-BoldItalic.ttf | Bin 0 -> 176588 bytes fonts/Poppins/Poppins-ExtraBold.ttf | Bin 0 -> 152764 bytes fonts/Poppins/Poppins-ExtraBoldItalic.ttf | Bin 0 -> 173916 bytes fonts/Poppins/Poppins-ExtraLight.ttf | Bin 0 -> 161456 bytes fonts/Poppins/Poppins-ExtraLightItalic.ttf | Bin 0 -> 186168 bytes fonts/Poppins/Poppins-Italic.ttf | Bin 0 -> 182012 bytes fonts/Poppins/Poppins-Light.ttf | Bin 0 -> 159892 bytes fonts/Poppins/Poppins-LightItalic.ttf | Bin 0 -> 184460 bytes fonts/Poppins/Poppins-Medium.ttf | Bin 0 -> 156520 bytes fonts/Poppins/Poppins-MediumItalic.ttf | Bin 0 -> 180444 bytes fonts/Poppins/Poppins-Regular.ttf | Bin 0 -> 158240 bytes fonts/Poppins/Poppins-SemiBold.ttf | Bin 0 -> 155232 bytes fonts/Poppins/Poppins-SemiBoldItalic.ttf | Bin 0 -> 178584 bytes fonts/Poppins/Poppins-Thin.ttf | Bin 0 -> 161652 bytes fonts/Poppins/Poppins-ThinItalic.ttf | Bin 0 -> 187044 bytes fonts/Roboto/LICENSE.txt | 202 +++++++++++++++++++++ fonts/Roboto/Roboto-Black.ttf | Bin 0 -> 168060 bytes fonts/Roboto/Roboto-BlackItalic.ttf | Bin 0 -> 174108 bytes fonts/Roboto/Roboto-Bold.ttf | Bin 0 -> 167336 bytes fonts/Roboto/Roboto-BoldItalic.ttf | Bin 0 -> 171508 bytes fonts/Roboto/Roboto-Italic.ttf | Bin 0 -> 170504 bytes fonts/Roboto/Roboto-Light.ttf | Bin 0 -> 167000 bytes fonts/Roboto/Roboto-LightItalic.ttf | Bin 0 -> 173172 bytes fonts/Roboto/Roboto-Medium.ttf | Bin 0 -> 168644 bytes fonts/Roboto/Roboto-MediumItalic.ttf | Bin 0 -> 173416 bytes fonts/Roboto/Roboto-Regular.ttf | Bin 0 -> 168260 bytes fonts/Roboto/Roboto-Thin.ttf | Bin 0 -> 168488 bytes fonts/Roboto/Roboto-ThinItalic.ttf | Bin 0 -> 172860 bytes 32 files changed, 295 insertions(+) create mode 100644 fonts/Poppins/OFL.txt create mode 100644 fonts/Poppins/Poppins-Black.ttf create mode 100644 fonts/Poppins/Poppins-BlackItalic.ttf create mode 100644 fonts/Poppins/Poppins-Bold.ttf create mode 100644 fonts/Poppins/Poppins-BoldItalic.ttf create mode 100644 fonts/Poppins/Poppins-ExtraBold.ttf create mode 100644 fonts/Poppins/Poppins-ExtraBoldItalic.ttf create mode 100644 fonts/Poppins/Poppins-ExtraLight.ttf create mode 100644 fonts/Poppins/Poppins-ExtraLightItalic.ttf create mode 100644 fonts/Poppins/Poppins-Italic.ttf create mode 100644 fonts/Poppins/Poppins-Light.ttf create mode 100644 fonts/Poppins/Poppins-LightItalic.ttf create mode 100644 fonts/Poppins/Poppins-Medium.ttf create mode 100644 fonts/Poppins/Poppins-MediumItalic.ttf create mode 100644 fonts/Poppins/Poppins-Regular.ttf create mode 100644 fonts/Poppins/Poppins-SemiBold.ttf create mode 100644 fonts/Poppins/Poppins-SemiBoldItalic.ttf create mode 100644 fonts/Poppins/Poppins-Thin.ttf create mode 100644 fonts/Poppins/Poppins-ThinItalic.ttf create mode 100644 fonts/Roboto/LICENSE.txt create mode 100644 fonts/Roboto/Roboto-Black.ttf create mode 100644 fonts/Roboto/Roboto-BlackItalic.ttf create mode 100644 fonts/Roboto/Roboto-Bold.ttf create mode 100644 fonts/Roboto/Roboto-BoldItalic.ttf create mode 100644 fonts/Roboto/Roboto-Italic.ttf create mode 100644 fonts/Roboto/Roboto-Light.ttf create mode 100644 fonts/Roboto/Roboto-LightItalic.ttf create mode 100644 fonts/Roboto/Roboto-Medium.ttf create mode 100644 fonts/Roboto/Roboto-MediumItalic.ttf create mode 100644 fonts/Roboto/Roboto-Regular.ttf create mode 100644 fonts/Roboto/Roboto-Thin.ttf create mode 100644 fonts/Roboto/Roboto-ThinItalic.ttf diff --git a/fonts/Poppins/OFL.txt b/fonts/Poppins/OFL.txt new file mode 100644 index 0000000..76df3b5 --- /dev/null +++ b/fonts/Poppins/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/fonts/Poppins/Poppins-Black.ttf b/fonts/Poppins/Poppins-Black.ttf new file mode 100644 index 0000000000000000000000000000000000000000..71c0f995ee64396f29a3d9ef283b5050f45d6e0f GIT binary patch literal 151396 zcmdSCcX(CB6F ;?Mklv&VNJkM6q}wZCgWUHsd(J(%;#YsZzvp@Xc*(Ofvu$>EcedWy1LKUb25cHr zSYCQsm#!8MOB2R;AA}~Q=jG=6^$vNNvEU@e8gEO_@0Idohq+@I>-!30p%ZiS+eTgd zZE670&qw;fLo13$$67kL!T%d$;`H$HNyGSl*BgvYtIzm}J|jwtOPYKdG8OU2!{SCD z!08E-3+VfBAtNekCjL}&`y0kwH!{{}R(aLX;aRby+~?;i0wSc6~CT!y--!R$p=pH(t5e1iD{Ggbnpz(?`k zwQsQ!%g6__f4gR>p%D9jYLE<3xtYDOr$v!-$Gc2XzN8fAm#scQ_@YPL;RmxHJa4H{ ztKfA2SM48hf@JcaVD*?6Yl1@TagzY%<_f{3&b>{uD7l6afww<$z W%Ii=7U%i?@3%8C2IoH91Idfw}P&@Y!7393axHxl^7eq7 8SX?Y_mgbfSOSGk(rHiGTCEJo`8DuH7R9Qw_s{Nnz-|7F0|L*|}0^9<; z1N;Mm0zv~K0@??p1*{5K8?Y^4XJF&Npuo_;@E{Rn4ss514RR0i4)PCb6_gP)IH Z^yIvAU;CMc3*f&*$zUs^N@{OOq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