Skip to content

Commit

Permalink
Fixes Issue OpenELEC#655
Browse files Browse the repository at this point in the history
Also sets the default value for the SABnzbd-Suite auto wake
option to false.
  • Loading branch information
3rdcycle committed May 14, 2012
1 parent f02b9cb commit 6a42dc0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.1.4
- fixes bug in sleep control

2.1.3
- add option to wake up periodically

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<setting id="SABNZBD_PWD" value="" />
<setting id="SABNZBD_USER" value="" />
<setting id="SABNZBD_KEEP_AWAKE" value="false" />
<setting id="SABNZBD_PERIODIC_WAKE" value="true" />
<setting id="SABNZBD_PERIODIC_WAKE" value="false" />
<setting id="SABNZBD_WAKE_AT" value="1" />
</settings>
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
socket.setdefaulttimeout(timeout)

# perform some initial checks and log essential settings
shouldKeepAwake = __settings__.getSetting('SABNZBD_KEEP_AWAKE')
wakePeriodically = __settings__.getSetting('SABNZBD_PERIODIC_WAKE')
shouldKeepAwake = (__settings__.getSetting('SABNZBD_KEEP_AWAKE').lower() == 'true')
wakePeriodically = (__settings__.getSetting('SABNZBD_PERIODIC_WAKE').lower() == 'true')
wakeHourIdx = int(__settings__.getSetting('SABNZBD_WAKE_AT'))
if shouldKeepAwake:
xbmc.log('SABnzbd-Suite: will prevent idle sleep/shutdown while downloading')
Expand All @@ -70,8 +70,8 @@
while (not xbmc.abortRequested):

# reread setting in case it has changed
shouldKeepAwake = __settings__.getSetting('SABNZBD_KEEP_AWAKE')
wakePeriodically = __settings__.getSetting('SABNZBD_PERIODIC_WAKE')
shouldKeepAwake = (__settings__.getSetting('SABNZBD_KEEP_AWAKE').lower() == 'true')
wakePeriodically = (__settings__.getSetting('SABNZBD_PERIODIC_WAKE').lower() == 'true')
wakeHourIdx = int(__settings__.getSetting('SABNZBD_WAKE_AT'))

# check if SABnzbd is downloading
Expand Down Expand Up @@ -108,4 +108,5 @@
open("/sys/class/rtc/rtc0/wakealarm", "w").write("0")
open("/sys/class/rtc/rtc0/wakealarm", "w").write(str(secondsSinceEpoch))

xbmc.sleep(checkInterval * 1000)
xbmc.sleep(checkInterval * 1000)

0 comments on commit 6a42dc0

Please sign in to comment.