=== AlarmSnoozeApplet.lua ================================================================== --- AlarmSnoozeApplet.lua (revision 39045) +++ AlarmSnoozeApplet.lua (local) @@ -248,6 +248,22 @@ end +function notify_playerPower(self, player, power) + if player ~= self.player then + return + end + log:debug("notify_playerPower(): ", power) + + -- turning power off while alarm is in progress always means alarm should be cancelled + if not power then + if self.alarmInProgress then + log:warn('Power turned off while alarm in progress. By design, turn the alarm off') + self:_alarmOff(true) + end + end +end + + function notify_playerCurrent(self, player) log:info("notify_playerCurrent(", player, ")") if player == self.localPlayer then