Open XLave opened 8 months ago
There is a discussion post where someone added it. It hasn't been merged yet, and there were some problems when I just copied the code, but I used the guy's concepts to add it to mine, and it works.
Thx, I didn't know it. I't trying to use it but I get the error:
\library\scheduler.py", line 157, in
KeyError: 'WEATHER'
How can I fix it?
Thx, I didn't know it. I't trying to use it but I get the error: \library\scheduler.py", line 157, in @schedule(timedelta(seconds=config.THEME_DATA['STATS']['WEATHER'].get("INTERVAL", None)).total_seconds())
~~~~~~^^^^^^^^^^^ KeyError: 'WEATHER' How can I fix it?
You need to add a WEATHER section in your theme (in STATS section): something like this:
WEATHER:
INTERVAL: 600
TEXT:
SHOW: True
X: 35
Y: 52
FONT: roboto-mono/RobotoMono-Bold.ttf
FONT_SIZE: 18
FONT_COLOR: 150, 200, 200
BACKGROUND_IMAGE: background.png
L.E. I've added a small fix to avoid this error on themes without WEATHER section. https://github.com/GaryStar/turing-smart-screen-python/commit/aae4abc244fcef6248823c0e25ebdc81d76e19cf
Yeah, thx, I've just tried it, now it shows the info in the display.
I have another issue:
File "\turing-smart-screen-python-feature-names-alert-weather\library\stats.py", line 33, in
You need to install requests
module by yourself (it's now added in requirements.txt
so on a fresh install it will be automatically added)
This module is used to fetch data from OpenWeatherMap. It's a standard module to fetch data from external sites.
To install it you can use:
pip install requests
or
python -m pip install requests
or
py.exe -m pip install requests
Thx for your quick support!
I have installed that module and it fixes but I have another issue with LibreHardware.dll related:
File "...\turing-smart-screen-python-feature-names-alert-weather\library\sensors\sensors_librehardwaremonitor.py", line 42, in
If I use the main branch the monitor works great, but I want to use your branch because of the redrawn from waking up and the weather info. Sorry for the trouble, I don't know Python nor any programming language.
if you use LibreHardware you need to start main.py with admin rights.
I was running it with admin rights, but the problem was another: https://www.jesusninoc.com/06/16/posible-solucion-al-error-se-intento-cargar-un-ensamblado-desde-una-ubicacion-de-red-por-lo-que-el-ensamblado-habria-sido-incluido-en-un-espacio-aislado-de-versiones-anteriores-de-net-framework/
Now I fixed it and it's running great!! Thx for your time, happy 2024!!
I'm trying to add a weather icon from OpenWeather API by adding the line "icon = data['weather'][0]['icon']" to the stats.py but i'm only able to get the icon code instead of the icon (https://openweathermap.org/weather-conditions). Is it possible to fetch an image from a url to display it on the monitor? How can I achieve that?
those icons are static and not so many. maybe they can all be manually downloaded in the theme folder (for example) and used from there based of the code received. I will try to implement something like this in the next days..
I've updated the code with support for weather icons as well There are two sets of icons added:
Example usage:
WEATHER:
INTERVAL: 600
TEXT:
SHOW: True
X: 30
Y: 52
FONT: roboto-mono/RobotoMono-Bold.ttf
FONT_SIZE: 18
FONT_COLOR: 150, 200, 200
BACKGROUND_IMAGE: background.png
ICON:
SHOW: True
X: 30
Y: 11
SCALE: 0.43
BACKGROUND_IMAGE: background.png
Thanx so much! It works perfect now with weather icons, that was a fast implementation.
Hi, I'm having an "connection error" somentimes when geeting back from sleep in the weather info, any thoughs about how to fix it?
yes.. add
time.sleep(5) # on wake, network access is not ready immediately
before
stats.Weather.stats() # refresh is needed because time between automated refreshes is usually over 10-15 minutes
in main.py
P.S. I've updated my branch with this change. I also added code for the smart screen to be turned on and off (not off completely just brightness set to 0) when system is turning the main monitor on/off (not shutdown or sleep) My branch is here: https://github.com/GaryStar/turing-smart-screen-python/tree/feature/names-alert-weather
Is there a way to display the local weather info like in UsbMonitor.exe? Would be a great addition.