# $Id: 98_WeekdayTimer.pm 4055 2013-10-16 20:44:49Z dietmar63 $ ############################################################################## # # 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) = @_; if(!$modules{Heating_Control}{LOADED} && -f "$attr{global}{modpath}/FHEM/98_Heating_Control.pm") { my $ret = CommandReload(undef, "98_Heating_Control"); Log3 undef, 1, $ret if($ret); } # 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_UpdatePerlTime($) { my ($hash) = @_; Heating_Control_Define($hash, $hash->{NAME} . " " . $hash->{TYPE} . " " . $hash->{DEF} ); } sub WeekdayTimer_Update($){ my ($hash) = @_; return Heating_Control_Update($hash); } # sub WeekdayTimer_SetAllParms() { # {WeekdayTimer_SetAllParms()} 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); Log3 undef, 3, "WeekdayTimer_Update() for $hash->{NAME} done!"; } Log3 undef, 3, "WeekdayTimer_SetAllParms() done!"; } 1; =pod =begin html

WeekdayTimer

=end html =cut