1616 SYSTEM_ACTION_HIBERNATE ,
1717 SYSTEM_ACTION_POWEROFF ,
1818 SYSTEM_ACTION_QUIT_KODI ,
19+ SYSTEM_ACTION_RESTART_KODI ,
20+ SYSTEM_ACTION_REBOOT_SYSTEM ,
1921 SYSTEM_ACTION_SHUTDOWN_KODI ,
2022 SYSTEM_ACTION_STANDBY , TIMER_WEEKLY ,
2123 Timer )
@@ -166,8 +168,7 @@ def _handleSystemAction() -> None:
166168 addon = xbmcaddon .Addon ()
167169 lines = list ()
168170 lines .append (addon .getLocalizedString (32270 ))
169- lines .append (addon .getLocalizedString (
170- 32081 + self .timerWithSystemAction .system_action ))
171+ lines .append (self .timerWithSystemAction .format ("$P" ))
171172 lines .append (addon .getLocalizedString (32271 ))
172173 abort = xbmcgui .Dialog ().yesno (heading = "%s: %s" % (addon .getLocalizedString (32256 ), self .timerWithSystemAction .label ),
173174 message = "\n " .join (lines ),
@@ -248,7 +249,7 @@ def getFaderInterval(self) -> float:
248249 vol_max = self .fader .return_vol if self .fader .fade == FADE_OUT_FROM_CURRENT else self .fader .vol_max
249250 vol_diff = vol_max - self .fader .vol_min
250251
251- return delta_end_start / vol_diff
252+ return delta_end_start / vol_diff if vol_diff != 0 else None
252253
253254 def _setTimerToPlayAny (self , timer : Timer ) -> None :
254255
@@ -370,6 +371,10 @@ def _performSystemAction() -> None:
370371 showNotification (self .timerWithSystemAction , msg_id = 32083 )
371372 xbmc .executebuiltin ("Quit()" )
372373
374+ elif self .timerWithSystemAction .system_action == SYSTEM_ACTION_RESTART_KODI :
375+ showNotification (self .timerWithSystemAction , msg_id = 32094 )
376+ xbmc .executebuiltin ("RestartApp()" )
377+
373378 elif self .timerWithSystemAction .system_action == SYSTEM_ACTION_STANDBY :
374379 showNotification (self .timerWithSystemAction , msg_id = 32084 )
375380 xbmc .executebuiltin ("Suspend()" )
@@ -382,6 +387,10 @@ def _performSystemAction() -> None:
382387 showNotification (self .timerWithSystemAction , msg_id = 32086 )
383388 xbmc .executebuiltin ("Powerdown()" )
384389
390+ elif self .timerWithSystemAction .system_action == SYSTEM_ACTION_REBOOT_SYSTEM :
391+ showNotification (self .timerWithSystemAction , msg_id = 32099 )
392+ xbmc .executebuiltin ("Reboot()" )
393+
385394 elif self .timerWithSystemAction .system_action == SYSTEM_ACTION_CEC_STANDBY :
386395 showNotification (self .timerWithSystemAction , msg_id = 32093 )
387396 xbmc .executebuiltin ("CECStandby()" )
0 commit comments