diff --git a/config.yaml b/config.yaml index 7e992f47..c55201f6 100644 --- a/config.yaml +++ b/config.yaml @@ -1,15 +1,14 @@ ---- config: # Configuration values to set up basic communication # Set your COM port e.g. COM3 for Windows, /dev/ttyACM0 for Linux... # Use AUTO for COM port auto-discovery (may not work on every setup) # COM_PORT: "/dev/ttyACM0" # COM_PORT: "COM3" - COM_PORT: "AUTO" + COM_PORT: AUTO # Theme to use (located in res/themes) # Use the name of the folder as value - THEME: 3.5inchTheme2 + THEME: ColoredFlat # Hardware sensors reading # Choose the appropriate method for reading your hardware sensors: @@ -23,8 +22,21 @@ config: # Linux/MacOS interfaces are named "eth0", "wlan0", "wlp1s0", "enp2s0"... # For Windows use the interfaces pretty name: "Ethernet 2", "Wi-Fi", ... # Leave the fields empty if the card does not exist on your setup - ETH: "" # Ethernet Card - WLO: "" # Wi-Fi Card + ETH: Ethernet # Ethernet Card + WLO: Wi-Fi # Wi-Fi Card + + # Used to calculate your ping. + PING: 8.8.8.8 + + # For weather, you can use for example https://www.latlong.net/ + LATITUDE: 45.75 + LONGITUDE: 4.85 + # OpenWeatherMap API KEY. Can be obtained by creating a free account on https://home.openweathermap.org/users/sign_up. You need to subscreibe to the 3.0 OneCallAPI that has 1000 free daily calls + API_KEY: abcdef + # Units used to display temperatures (metric - °C, imperial - °F, standard - °K) + WEATHER_UNITS: metric + # Language is used by the API. Find more here https://openweathermap.org/api/one-call-3#multi + LANGUAGE: fr display: # Display revision: @@ -35,7 +47,7 @@ display: # - SIMU for 3.5" simulated LCD (image written in screencap.png) # - SIMU5 for 5" simulated LCD # To identify your smart screen: https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions - REVISION: A + REVISION: C # Display Brightness # Set this as the desired %, 0 being completely dark and 100 being max brightness diff --git a/library/scheduler.py b/library/scheduler.py index c36812f6..3a29c43a 100644 --- a/library/scheduler.py +++ b/library/scheduler.py @@ -161,6 +161,12 @@ def CustomStats(): stats.Custom.stats() +@async_job("Weather_Stats") +@schedule(timedelta(seconds=config.THEME_DATA['STATS'].get('WEATHER', {}).get("INTERVAL", 0)).total_seconds()) +def WeatherStats(): + # logger.debug("Refresh Weather data") + stats.Weather.stats() + @async_job("Queue_Handler") @schedule(timedelta(milliseconds=1).total_seconds()) def QueueHandler(): diff --git a/library/sensors/sensors_custom.py b/library/sensors/sensors_custom.py index 0605f802..972fe233 100644 --- a/library/sensors/sensors_custom.py +++ b/library/sensors/sensors_custom.py @@ -21,8 +21,12 @@ import math import platform +import requests from abc import ABC, abstractmethod from typing import List +from ping3 import ping, verbose_ping +from datetime import datetime +import library.config as config # Custom data classes must be implemented in this file, inherit the CustomDataSource and implement its 2 methods @@ -47,6 +51,37 @@ def last_values(self) -> List[float]: # If you do not want to draw a line graph or if your custom data has no numeric values, keep this function empty pass +# Custom data class to measure ping to google.fr +class Ping(CustomDataSource): + # This list is used to store the last 500 values to display a line graph + last_val = [math.nan] * 500 # By default, it is filed with math.nan values to indicate there is no data stored + + def as_numeric(self) -> float: + # Measure the ping + try: + result = ping(config.CONFIG_DATA['config'].get('PING', "8.8.8.8"))*1000 + if result is not None: + # Store the value to the history list that will be used for line graph + self.last_val.append(result) + # Also remove the oldest value from history list + self.last_val.pop(0) + return result + else: + self.last_val.append(9999) + self.last_val.pop(0) + return 9999 # Return 0 if ping fails + except Exception as e: + self.last_val.append(9999) + self.last_val.pop(0) + return 9999 + + def as_string(self) -> str: + # Format the ping result as a string + return f'{self.as_numeric():4.0f} ms' + + def last_values(self) -> List[float]: + # Since there is no historical data for ping, return an empty list + return self.last_val # Example for a custom data class that has numeric and text values class ExampleCustomNumericData(CustomDataSource): @@ -95,4 +130,4 @@ def as_string(self) -> str: def last_values(self) -> List[float]: # If a custom data class only has text values, it won't be possible to display line graph - pass + pass \ No newline at end of file diff --git a/library/stats.py b/library/stats.py index 0617ff2e..7a9fa38e 100644 --- a/library/stats.py +++ b/library/stats.py @@ -30,6 +30,7 @@ import babel.dates from psutil._common import bytes2human +import requests import library.config as config from library.display import display @@ -767,3 +768,77 @@ def stats(): theme_data = config.THEME_DATA['STATS']['CUSTOM'][custom_stat].get("LINE_GRAPH", None) if theme_data is not None and last_values is not None: display_themed_line_graph(theme_data=theme_data, values=last_values) + +class Weather: + @staticmethod + def stats(): + WEATHER_UNITS = {'metric': '°C', 'imperial': '°F', 'standard': '°K'} + + weather_theme_data = config.THEME_DATA['STATS'].get('WEATHER', {}) + wtemperature_theme_data = weather_theme_data.get('TEMPERATURE', {}).get('TEXT', {}) + wfelt_theme_data = weather_theme_data.get('TEMPERATURE_FELT', {}).get('TEXT', {}) + wupdatetime_theme_data = weather_theme_data.get('UPDATE_TIME', {}).get('TEXT', {}) + wdescription_theme_data = weather_theme_data.get('WEATHER_DESCRIPTION', {}).get('TEXT', {}) + whumidity_theme_data = weather_theme_data.get('HUMIDITY', {}).get('TEXT', {}) + + # Retrieve information used to center description, if needed + center_description_length = 40 + if 'CENTER_LENGTH' in wdescription_theme_data: + center_description_length = wdescription_theme_data['CENTER_LENGTH'] + + activate = True if wtemperature_theme_data.get("SHOW") or wfelt_theme_data.get("SHOW") or wupdatetime_theme_data.get("SHOW") or wdescription_theme_data.get("SHOW") or whumidity_theme_data.get("SHOW") else False + + if activate: + if HW_SENSORS in ["STATIC", "STUB"]: + temp = "17.5°C" + feel = "(17.2°C)" + desc = "Cloudy" + time = "@15:33" + humidity = "45%" + if wdescription_theme_data['CENTER_LENGTH']: + desc = "x"*center_description_length + else: + # API Parameters + lat = config.CONFIG_DATA['config'].get('LATITUDE', "") + lon = config.CONFIG_DATA['config'].get('LONGITUDE', "") + api_key = config.CONFIG_DATA['config'].get('API_KEY', "") + units = config.CONFIG_DATA['config'].get('WEATHER_UNITS', "metric") + lang = config.CONFIG_DATA['config'].get('LANGUAGE', "en") + deg = WEATHER_UNITS.get(units, '°?') + if api_key: + url = f'https://api.openweathermap.org/data/3.0/onecall?lat={lat}&lon={lon}&exclude=minutely,hourly,daily,alerts&appid={api_key}&units={units}&lang={lang}' + try: + response = requests.get(url) + if response.status_code == 200: + try: + data = response.json() + temp = f"{data['current']['temp']:.1f}{deg}" + feel = f"({data['current']['feels_like']:.1f}{deg})" + desc = data['current']['weather'][0]['description'].capitalize() + if wdescription_theme_data['CENTER_LENGTH']: + desc = desc.center(center_description_length) + humidity = f"{data['current']['humidity']:.0f}%" + now = datetime.datetime.now() + time = f"@{now.hour:02d}:{now.minute:02d}" + except Exception as e: + logger.error(str(e)) + desc = "Error fetching weather" + else: + print(f"Failed to fetch weather data. Status code: {response.status_code}") + print(f"Response content: {response.content}") + logger.error(response.text) + desc = response.json().get('message') + except: + desc = "Connection error" + + if activate: + # Display Temperature + display_themed_value(theme_data=wtemperature_theme_data, value=temp) + # Display Temperature Felt + display_themed_value(theme_data=wfelt_theme_data, value=feel) + # Display Update Time + display_themed_value(theme_data=wupdatetime_theme_data, value=time) + # Display Humidity + display_themed_value(theme_data=whumidity_theme_data, value=humidity) + # Display Weather Description + display_themed_value(theme_data=wdescription_theme_data, value=desc) diff --git a/main.py b/main.py index 9d710124..7645ab1e 100755 --- a/main.py +++ b/main.py @@ -209,6 +209,7 @@ def on_win32_wm_event(hWnd, msg, wParam, lParam): scheduler.NetStats() scheduler.DateStats() scheduler.CustomStats() + scheduler.WeatherStats() scheduler.QueueHandler() if tray_icon and platform.system() == "Darwin": # macOS-specific diff --git a/requirements.txt b/requirements.txt index 9a97481c..59008661 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Python packages requirements -Pillow~=10.3.0 # Image generation +Pillow~=10.2.0 # Image generation pyserial~=3.5 # Serial link to communicate with the display PyYAML~=6.0.1 # For themes files psutil~=5.9.8 # CPU / disk / network metrics @@ -8,9 +8,10 @@ babel~=2.14.0 # Date/time formatting ruamel.yaml~=0.18.6 # For configuration editor sv-ttk~=2.6.0 # Tk Sun Valley theme for configuration editor + # Efficient image serialization numpy~=1.24.4; python_version < "3.9" # For Python 3.8 max. -numpy~=1.26.4; python_version >= "3.9" # For Python 3.9+ +numpy~=1.26.0; python_version >= "3.9" # For Python 3.9+ # For Nvidia GPU on all platforms GPUtil~=1.4.0; python_version < "3.12" @@ -27,3 +28,9 @@ pyadl~=0.1; sys_platform=="win32" # Following packages are for LibreHardwareMonitor integration on Windows pythonnet~=3.0.3; sys_platform=="win32" pywin32>=306; sys_platform=="win32" + +# for weather +requests + +# for ping +ping3~=4.0.4 \ No newline at end of file diff --git a/res/themes/ColoredFlat/background.png b/res/themes/ColoredFlat/background.png new file mode 100644 index 00000000..2e6b4ed1 Binary files /dev/null and b/res/themes/ColoredFlat/background.png differ diff --git a/res/themes/ColoredFlat/background.xcf b/res/themes/ColoredFlat/background.xcf new file mode 100644 index 00000000..e8b0ba5f Binary files /dev/null and b/res/themes/ColoredFlat/background.xcf differ diff --git a/res/themes/ColoredFlat/preview.png b/res/themes/ColoredFlat/preview.png new file mode 100644 index 00000000..1b98ede4 Binary files /dev/null and b/res/themes/ColoredFlat/preview.png differ diff --git a/res/themes/ColoredFlat/telecharger-arrow.png b/res/themes/ColoredFlat/telecharger-arrow.png new file mode 100644 index 00000000..691717a4 Binary files /dev/null and b/res/themes/ColoredFlat/telecharger-arrow.png differ diff --git a/res/themes/ColoredFlat/theme.yaml b/res/themes/ColoredFlat/theme.yaml new file mode 100644 index 00000000..b066fcc7 --- /dev/null +++ b/res/themes/ColoredFlat/theme.yaml @@ -0,0 +1,569 @@ +--- +author: "@Psykotik" + +display: + DISPLAY_SIZE: 5" + DISPLAY_ORIENTATION: portrait + DISPLAY_RGB_LED: 255, 0, 0 + +static_images: + BACKGROUND: + PATH: background.png + X: 0 + Y: 0 + WIDTH: 480 + HEIGHT: 800 + +static_text: + RAM: + TEXT: /32Gb + X: 120 + Y: 348 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + +STATS: + CPU: + PERCENTAGE: + INTERVAL: 1 + TEXT: + SHOW: true + SHOW_UNIT: true + X: 110 + Y: 127 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 35 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + GRAPH: + SHOW: false + X: 40 + Y: 210 + WIDTH: 160 + HEIGHT: 15 + MIN_VALUE: 0 + MAX_VALUE: 100 + BAR_COLOR: 247, 227, 227 + BAR_OUTLINE: true + BACKGROUND_IMAGE: background.png + LINE_GRAPH: + SHOW: true + X: 30 + Y: 160 + WIDTH: 180 + HEIGHT: 70 + MIN_VALUE: 0 + MAX_VALUE: 100 + HISTORY_SIZE: 60 + AUTOSCALE: false + LINE_COLOR: 247, 227, 227 + AXIS: true + AXIS_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + FREQUENCY: + INTERVAL: 1 + TEXT: + SHOW: true + SHOW_UNIT: True + X: 40 + Y: 250 + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 15 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + LOAD: + INTERVAL: 1 + ONE: + TEXT: + SHOW: false + SHOW_UNIT: false + X: 110 + Y: 106 + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 13 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + FIVE: + TEXT: + SHOW: false + SHOW_UNIT: false + X: 183 + Y: 106 + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 13 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + FIFTEEN: + TEXT: + SHOW: False + SHOW_UNIT: false + X: 265 + Y: 106 + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 13 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + TEMPERATURE: + INTERVAL: 1 + TEXT: + SHOW: true + SHOW_UNIT: True + X: 110 + Y: 240 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 30 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + GPU: + INTERVAL: 1 + PERCENTAGE: + TEXT: + SHOW: true + SHOW_UNIT: True + X: 345 + Y: 127 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 35 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + GRAPH: + SHOW: false + X: 280 + Y: 210 + WIDTH: 160 + HEIGHT: 15 + MIN_VALUE: 0 + MAX_VALUE: 100 + BAR_COLOR: 247, 227, 227 + BAR_OUTLINE: true + BACKGROUND_IMAGE: background.png + LINE_GRAPH: + SHOW: true + X: 270 + Y: 160 + WIDTH: 180 + HEIGHT: 70 + MIN_VALUE: 0 + MAX_VALUE: 100 + HISTORY_SIZE: 60 + AUTOSCALE: false + LINE_COLOR: 247, 227, 227 + AXIS: True + AXIS_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + MEMORY: + GRAPH: + SHOW: true + X: 280 + Y: 260 + WIDTH: 70 + HEIGHT: 10 + MIN_VALUE: 0 + MAX_VALUE: 100 + BAR_COLOR: 247, 227, 227 + BAR_OUTLINE: true + BACKGROUND_IMAGE: background.png + RADIAL: + SHOW: false + X: 310 + Y: 255 + RADIUS: 20 + WIDTH: 5 + MIN_VALUE: 0 + MAX_VALUE: 100 + ANGLE_START: 110 + ANGLE_END: 70 + ANGLE_STEPS: 1 + ANGLE_SEP: 25 + CLOCKWISE: True + BAR_COLOR: 247, 227, 227 + SHOW_TEXT: True + SHOW_UNIT: True + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 15 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + TEXT: + SHOW: true + SHOW_UNIT: True + X: 280 + Y: 245 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 15 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + TEMPERATURE: + TEXT: + SHOW: true + SHOW_UNIT: True + X: 350 + Y: 240 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 30 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + MEMORY: + INTERVAL: 1 + SWAP: + GRAPH: + SHOW: false + X: 115 + Y: 285 + WIDTH: 178 + HEIGHT: 13 + MIN_VALUE: 0 + MAX_VALUE: 100 + BAR_COLOR: 255, 0, 0 + BAR_OUTLINE: False + BACKGROUND_IMAGE: background.png + RADIAL: + SHOW: False + X: 141 + Y: 275 + RADIUS: 28 + WIDTH: 8 + MIN_VALUE: 0 + MAX_VALUE: 100 + ANGLE_START: 110 + ANGLE_END: 70 + ANGLE_STEPS: 1 + ANGLE_SEP: 25 + CLOCKWISE: True + BAR_COLOR: 255, 0, 0 + SHOW_TEXT: True + SHOW_UNIT: True + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 13 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + VIRTUAL: + GRAPH: + SHOW: false + X: 40 + Y: 420 + WIDTH: 160 + HEIGHT: 15 + MIN_VALUE: 0 + MAX_VALUE: 100 + BAR_COLOR: 247, 227, 227 + BAR_OUTLINE: true + BACKGROUND_IMAGE: background.png + LINE_GRAPH: + SHOW: True + X: 30 + Y: 380 + WIDTH: 180 + HEIGHT: 70 + MIN_VALUE: 0 + MAX_VALUE: 100 + HISTORY_SIZE: 200 + AUTOSCALE: False + LINE_COLOR: 247, 227, 227 + AXIS: true + AXIS_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + USED: + SHOW: True + SHOW_UNIT: false + X: 55 + Y: 350 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + FREE: + SHOW: FALSE + SHOW_UNIT: True + X: 182 + Y: 129 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 23 + FONT_COLOR: 255, 255, 255 + BACKGROUND_IMAGE: background.png + PERCENT_TEXT: + SHOW: True + SHOW_UNIT: True + X: 110 + Y: 310 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 35 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + DISK: + INTERVAL: 10 + USED: + GRAPH: + SHOW: true + X: 280 + Y: 400 + WIDTH: 160 + HEIGHT: 15 + MIN_VALUE: 0 + MAX_VALUE: 100 + BAR_COLOR: 247, 227, 227 + BAR_OUTLINE: true + BACKGROUND_IMAGE: background.png + RADIAL: + SHOW: false + X: 360 + Y: 415 + RADIUS: 35 + WIDTH: 6 + MIN_VALUE: 0 + MAX_VALUE: 100 + ANGLE_START: 120 + ANGLE_END: 70 + ANGLE_STEPS: 1 + ANGLE_SEP: 25 + CLOCKWISE: True + BAR_COLOR: 247, 227, 227 + SHOW_TEXT: True + SHOW_UNIT: True + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 25 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + TEXT: + SHOW: false + SHOW_UNIT: True + X: 204 + Y: 405 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 23 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + PERCENT_TEXT: + SHOW: true + SHOW_UNIT: True + X: 305 + Y: 360 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 40 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + TOTAL: + TEXT: + SHOW: False + SHOW_UNIT: True + X: 204 + Y: 375 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 23 + FONT_COLOR: 255, 255, 255 + BACKGROUND_IMAGE: background.png + FREE: + TEXT: + SHOW: False + SHOW_UNIT: True + X: 204 + Y: 435 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 23 + FONT_COLOR: 255, 255, 255 + BACKGROUND_IMAGE: background.png + NET: + INTERVAL: 1 + WLO: + UPLOAD: + TEXT: + SHOW: false + X: 327 + Y: 590 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + UPLOADED: + TEXT: + SHOW: false + X: 380 + Y: 620 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 17 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + DOWNLOAD: + TEXT: + SHOW: false + X: 87 + Y: 590 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + DOWNLOADED: + TEXT: + SHOW: false + X: 140 + Y: 620 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 17 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + ETH: + UPLOAD: + TEXT: + SHOW: true + X: 315 + Y: 540 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + LINE_GRAPH: + SHOW: true + X: 260 + Y: 600 + WIDTH: 180 + HEIGHT: 60 + MIN_VALUE: 0 + MAX_VALUE: 500000 + HISTORY_SIZE: 120 + AUTOSCALE: False + LINE_COLOR: 247, 227, 227 + AXIS: True + AXIS_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + UPLOADED: + TEXT: + SHOW: true + X: 370 + Y: 570 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 17 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + DOWNLOAD: + TEXT: + SHOW: true + X: 80 + Y: 540 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + LINE_GRAPH: + SHOW: true + X: 30 + Y: 600 + WIDTH: 180 + HEIGHT: 60 + MIN_VALUE: 0 + MAX_VALUE: 1500000 + HISTORY_SIZE: 120 + AUTOSCALE: False + LINE_COLOR: 247, 227, 227 + AXIS: True + AXIS_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + DOWNLOADED: + TEXT: + SHOW: true + X: 135 + Y: 570 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 17 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + DATE: + # For time display, it is recommended not to change the interval: keep to 1 + INTERVAL: 1 + DAY: # Format (Y/M/D ordering, month/day translations...) will match your computer locale + TEXT: + FORMAT: medium # short (2/20/23) / medium (Feb 20, 2023) / long (February 20, 2023) / full (Monday, February 20, 2023) + SHOW: True + X: 275 + Y: 25 + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 30 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + HOUR: # Format (12/24h, timezone translations) will match your computer locale + TEXT: + FORMAT: medium # short (6:48 PM) / medium (6:48:53 PM) / long (6:48:53 PM UTC) / full (6:48:53 PM Coordinated Universal Time) + SHOW: True + X: 55 + Y: 25 + FONT: roboto/Roboto-Bold.ttf + FONT_SIZE: 30 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + WEATHER: + # For optimal use, if you don't want to trigger the free threshold daily call (1000 calls), the interval should be 90 MINIMUM (not really useful as the API didn't update that quickly) + INTERVAL: 300 + TEMPERATURE: + TEXT: + SHOW: True + X: 27 + Y: 70 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + TEMPERATURE_FELT: + TEXT: + SHOW: True + X: 115 + Y: 68 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + UPDATE_TIME: + TEXT: + SHOW: True + X: 370 + Y: 69 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + HUMIDITY: + TEXT: + SHOW: True + X: 290 + Y: 69 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + WEATHER_DESCRIPTION: + TEXT: + SHOW: True + CENTER: True # Used to center the description, on a 40 character basis or with CENTER_LENGTH below. Use MONO font for better results. Use fake static data for better positionning ! + CENTER_LENGTH: 40 + X: 20 + Y: 95 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 18 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + CUSTOM: + # For now the refresh interval (in seconds) is the same for all custom data classes + INTERVAL: 1 + Ping: + TEXT: + SHOW: True + X: 325 + Y: 495 + FONT: jetbrains-mono/JetBrainsMono-Bold.ttf + FONT_SIZE: 25 + FONT_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png + ALIGN: right + LINE_GRAPH: + SHOW: true + X: 30 + Y: 680 + WIDTH: 415 + HEIGHT: 70 + MIN_VALUE: 0 + MAX_VALUE: 250 + HISTORY_SIZE: 120 + AUTOSCALE: false + LINE_COLOR: 247, 227, 227 + AXIS: True + AXIS_COLOR: 247, 227, 227 + BACKGROUND_IMAGE: background.png diff --git a/res/themes/ColoredFlat/wallpaperv2.png b/res/themes/ColoredFlat/wallpaperv2.png new file mode 100644 index 00000000..bf2d7581 Binary files /dev/null and b/res/themes/ColoredFlat/wallpaperv2.png differ diff --git a/res/themes/theme_example.yaml b/res/themes/theme_example.yaml index fd56d91f..e72de277 100644 --- a/res/themes/theme_example.yaml +++ b/res/themes/theme_example.yaml @@ -1126,3 +1126,53 @@ STATS: FONT_COLOR: 200, 200, 200 # BACKGROUND_COLOR: 50, 50, 50 BACKGROUND_IMAGE: background.png + WEATHER: + # For optimal use, if you want to stay on the free plan (1000 calls), the interval should be 90 MINIMUM (not really useful as the API didn't update that quickly) + INTERVAL: 300 + TEMPERATURE: + TEXT: + SHOW: True + X: 27 + Y: 70 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + TEMPERATURE_FELT: + TEXT: + SHOW: True + X: 115 + Y: 68 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + UPDATE_TIME: + TEXT: + SHOW: True + X: 370 + Y: 69 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + HUMIDITY: + TEXT: + SHOW: True + X: 290 + Y: 69 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 22 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png + WEATHER_DESCRIPTION: + TEXT: + SHOW: True + CENTER: True # Used to center the description, on a 40 character basis or with CENTER_LENGTH below. Use MONO font for better results. Use fake static data for better positionning ! + CENTER_LENGTH: 40 + X: 20 + Y: 95 + FONT: roboto-mono/RobotoMono-Bold.ttf + FONT_SIZE: 18 + FONT_COLOR: 200, 200, 200 + BACKGROUND_IMAGE: background.png diff --git a/theme-editor.py b/theme-editor.py index 944ee4bc..7d95d823 100755 --- a/theme-editor.py +++ b/theme-editor.py @@ -112,6 +112,7 @@ def refresh_theme(): stats.Net.stats() stats.Date.stats() stats.Custom.stats() + stats.Weather.stats() if __name__ == "__main__":