Posts: 2,016
Joined: Jan 2015
Reputation:
146
ksooo
Team-Kodi Developer
Posts: 2,016
2024-10-31, 10:20
(This post was last modified: 2024-10-31, 10:44 by ksooo. Edited 4 times in total.)
One thing that should be changed: Your service should listen to "OnSleep" and "OnWake" notifications. Once you receive "OnSleep" you should not do any network activties (weather data download for example) until you receive "OnWake". Sleep does not (always) mean to suspend suspend to disk or to RAM. On Android it is more like macOS "pwer napping", where the machine is up, but with only limited functionality. On Android, there will no network access possible in that mode, for both local network and internet. I'm currently seeing lot's of errors in my Kodi log, where your addon is trying to download weather data while the Android machine is "sleeping".
BTW: Hourly forecast tiles seem not to update properly after those errors caused by sleep mode. Machine went to sleep today between 0:00 and 1:00, then the errors started, and after wakeup of the device today at 9:00, first hourly tile displayed temperature for 1:00, and did not update itself it seemed until next Kodi restart.
Posts: 2,016
Joined: Jan 2015
Reputation:
146
ksooo
Team-Kodi Developer
Posts: 2,016
> If there is no WEATHER: Downloading weather log entry right after your device wakes up
There definitely is. I see that kodi requests data from the addon right after wakeup.
I even tried switching locations manually which worked on general, but hourly tiles did not update the time, even for the other locations.
Posts: 2,016
Joined: Jan 2015
Reputation:
146
ksooo
Team-Kodi Developer
Posts: 2,016
Could it be that it only happens if the day changes between sleep and wakeup?
Posts: 219
Joined: Apr 2014
Reputation:
75
bkury
Senior Member
Posts: 219
I've now successfully emulated your condition by disabling network connectivity and then steadily increasing the system time by 1 hour and check for the addons behavior. This issue is caused because the addon is running normally but the weather data to match the current time is getting "out of bounds" after about 30+ hours because the addon couldn't download the current weather data in that "sleep" state.
Note: If you are in this state it should still fix itself but worst case would be to wait 1 hour until the next weather download would be triggered
I'm going to switch and increase that check to process all available weather data which means that this situation should only happen if your android device would be sleeping for more than 7 days, at which point there is no more weather data available until we download current data.
Posts: 113
Joined: Oct 2023
Reputation:
23
Thanks again for your work.
Posts: 3
Joined: Oct 2024
Reputation:
1
Bedankt, hoe voeg ik dat toe aan de app? Heb al verscheidene zip bestanden gemaakt, lukt niet om te instaleren.