From 15cdbb07769428674561ec3b20ff0e637318ef5f Mon Sep 17 00:00:00 2001 From: FlorianZ <> Date: Thu, 1 Jun 2017 18:27:28 +0000 Subject: [PATCH] 98_alarmclock: New feature stop Alarm git-svn-id: https://svn.fhem.de/fhem/trunk@14444 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/98_alarmclock.pm | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/fhem/CHANGED b/fhem/CHANGED index 5fe4a923c..2a2e343ff 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 98_alarmclock: New feature stop Alarm - bugfix: 98_DOIFtools: fixed empty N_timer - bugfix: 37_Spotify: fixed offset playContextByURI - bugfix: 38_CO20: fixed reconnects, improved stability diff --git a/fhem/FHEM/98_alarmclock.pm b/fhem/FHEM/98_alarmclock.pm index b0087be26..ab3226b6a 100644 --- a/fhem/FHEM/98_alarmclock.pm +++ b/fhem/FHEM/98_alarmclock.pm @@ -53,6 +53,7 @@ my %alarmclock_sets = "AlarmOff" => "NONE", "AlarmTime_Weekdays" => "09:00", "AlarmTime_Weekend" => "09:00", + "stop" => "NONE", "skip" => "NONE", "save" => "NONE", "load" => "NONE", @@ -219,6 +220,7 @@ sub alarmclock_Set($$) ." AlarmOff:1_Monday,2_Tuesday,3_Wednesday,4_Thursday,5_Friday,6_Saturday,7_Sunday,8_Holiday,9_Vacation,Weekdays,Weekend,All" ." AlarmTime_Weekdays" ." AlarmTime_Weekend" + ." stop:Alarm" ." skip:NextAlarm,None" ." save:Weekprofile_1,Weekprofile_2,Weekprofile_3,Weekprofile_4,Weekprofile_5" ." load:Weekprofile_1,Weekprofile_2,Weekprofile_3,Weekprofile_4,Weekprofile_5" @@ -332,6 +334,16 @@ sub alarmclock_Set($$) return "Please Set $opt HH:MM" ; } } + +### stop Alarm ### + + if ($opt eq "stop") + { + if (($value eq "Alarm") && ((ReadingsVal($hash->{NAME},"state",0)) =~ /^(Alarm is running|Snooze for.*)/)) + { + alarmclock_alarmroutine_stop($hash); + } + } ### save Weekprofile ### @@ -1304,6 +1316,9 @@ sub alarmclock_Notify($$)
  • AlarmOff (1_Monday|2_Tuesday|3_Wednesday|4_Thursday|5_Friday|6_Saturday|7_Sunday|8_Holiday|9_Vacation|Weekdays|Weekend|All)
    Sets the alarm time of the respective day to off. +
  • +
  • stop (Alarm)
    + Stops a running alarm.
  • save (Weekprofile_1|Weekprofile_2|Weekprofile_3|Weekprofile_4|Weekprofile_5)
    Save alarm times in a profile.