doc:appunti:software:kodi_addon_disable_screensaver
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:software:kodi_addon_disable_screensaver [2023/05/20 19:09] – [How to disable the screensaver into a Kodi add-on] niccolo | doc:appunti:software:kodi_addon_disable_screensaver [2023/05/20 21:29] (current) – [How to disable the screensaver from a Kodi add-on] niccolo | ||
---|---|---|---|
Line 5: | Line 5: | ||
Writing the add-on I faced the problem to disable the screensaver during image playback. It turned out that on the internet you find several examples, which are sometimes confusing and not working. In this page I hope to explain all the possibilities offered by **Kodi 19 Matrix**. | Writing the add-on I faced the problem to disable the screensaver during image playback. It turned out that on the internet you find several examples, which are sometimes confusing and not working. In this page I hope to explain all the possibilities offered by **Kodi 19 Matrix**. | ||
- | ===== JSON RPC ===== | + | Before Kodi 19 Matrix the only way to disable the screensaver was to change settings via the JSON RPC API, starting with version 19 it is possible (and simpler) to call a built-in function. |
+ | |||
+ | ===== Using JSON RPC ===== | ||
There are several Kodi settings related to the screensaver, | There are several Kodi settings related to the screensaver, | ||
- | Into the add-on code you can use the Python function **xbmc.executeJSONRPC()** to communicate with Kodi itself, using the [[https:// | + | Into the add-on code you can use the Python function **xbmc.executeJSONRPC()** to communicate with Kodi itself, using the [[https:// |
^ powermanagement.displaysoff | ^ powermanagement.displaysoff | ||
^ screensaver.mode | ^ screensaver.mode | ||
^ screensaver.time | ^ screensaver.time | ||
- | ^ screensaver.usedimonpause | + | ^ screensaver.usedimonpause |
<code python> | <code python> | ||
Line 40: | Line 42: | ||
json_rpc = json.loads(xbmc.executeJSONRPC(json.dumps(command))) | json_rpc = json.loads(xbmc.executeJSONRPC(json.dumps(command))) | ||
</ | </ | ||
- | ===== System settings | + | ===== Using a built-in function |
+ | |||
+ | There is another way to disable the screensaver in Kodi: it is a [[https:// | ||
+ | |||
+ | <code python> | ||
+ | # Prevent any screensaver to start. | ||
+ | xbmc.executebuiltin(' | ||
+ | |||
+ | # ... Add-on executes its job... | ||
+ | |||
+ | # Restore the screensaver default behaviour. | ||
+ | xbmc.executebuiltin(' | ||
+ | </ | ||
===== Web References ===== | ===== Web References ===== | ||
Line 47: | Line 61: | ||
* **[[https:// | * **[[https:// | ||
* **[[https:// | * **[[https:// | ||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
doc/appunti/software/kodi_addon_disable_screensaver.1684602586.txt.gz · Last modified: 2023/05/20 19:09 by niccolo