From d2e71e2c1ffdbdfa885dd48b8793efa74f52f695 Mon Sep 17 00:00:00 2001 From: dietmar63 <> Date: Thu, 10 Oct 2013 21:38:56 +0000 Subject: [PATCH] new Module git-svn-id: https://svn.fhem.de/fhem/trunk@4031 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_WeekdayTimer.pm | 177 +++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100644 fhem/FHEM/98_WeekdayTimer.pm diff --git a/fhem/FHEM/98_WeekdayTimer.pm b/fhem/FHEM/98_WeekdayTimer.pm new file mode 100644 index 000000000..84e6d8cc0 --- /dev/null +++ b/fhem/FHEM/98_WeekdayTimer.pm @@ -0,0 +1,177 @@ +# $Id$ +############################################################################## +# +# 98_WeekdayTimer.pm +# written by Dietmar Ortmann +# +# This file is part of fhem. +# +# Fhem is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# Fhem is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with fhem. If not, see . +# +############################################################################## + +package main; +use strict; +use warnings; +use POSIX; + +##################################### +sub +WeekdayTimer_Initialize($) +{ + my ($hash) = @_; + +# Consumer + $hash->{DefFn} = "WeekdayTimer_Define"; + $hash->{UndefFn} = "WeekdayTimer_Undef"; + $hash->{GetFn} = "WeekdayTimer_Get"; + $hash->{UpdFn} = "WeekdayTimer_Update"; + $hash->{AttrList}= "disable:0,1 ". + $readingFnAttributes; +} + +sub +WeekdayTimer_Get($@) { + return Heating_Control_Get($@); +} + + +sub +WeekdayTimer_Define($$){ + my ($hash, $def) = @_; + + my $ret = Heating_Control_Define($hash, $def); + $hash->{helper}{DESIRED_TEMP_READING} = ""; + return $ret; +} + +sub +WeekdayTimer_Undef($$){ + my ($hash, $arg) = @_; + return Heating_Control_Undef($hash, $arg); +} + +sub +WeekdayTimer_Update($){ +my ($hash) = @_; + return Heating_Control_Update($hash); +} +# +sub WeekdayTimer_SetAllTemps() { # {WeekdayTimer_SetAllTemps()} + + foreach my $hc ( sort keys %{$modules{WeekdayTimer}{defptr}} ) { + my $hash = $modules{WeekdayTimer}{defptr}{$hc}; + + if($hash->{helper}{CONDITION}) { + if (!(eval ($hash->{helper}{CONDITION}))) { + readingsSingleUpdate ($hash, "state", "inactive", 1); + next; + } + } + WeekdayTimer_Update($hash); + } +} + +1; + +=pod +=begin html + + + +

WeekdayTimer

+ + + +=end html + +=cut