mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
98_DOIFtools.pm: support for multiple holiday files in holiday2we for next timer calculation.
git-svn-id: https://svn.fhem.de/fhem/trunk@16245 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1953f8cead
commit
ad80dde270
@ -1,5 +1,7 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 98_DOIFtools: support for multiple holiday files in holiday2we for
|
||||||
|
next timer calculation
|
||||||
- change: 53_GHoma: plugs with energy measurement implemented
|
- change: 53_GHoma: plugs with energy measurement implemented
|
||||||
reading energy now in kWh / SetExtensions / DbLog_splitFn
|
reading energy now in kWh / SetExtensions / DbLog_splitFn
|
||||||
- change: 93_DbRep: commandref revised
|
- change: 93_DbRep: commandref revised
|
||||||
|
@ -23,6 +23,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
use Time::Local;
|
use Time::Local;
|
||||||
use Color;
|
use Color;
|
||||||
|
use vars qw(%FW_rooms %FW_groups);
|
||||||
|
|
||||||
sub DOIFtools_Initialize($);
|
sub DOIFtools_Initialize($);
|
||||||
sub DOIFtools_Set($@);
|
sub DOIFtools_Set($@);
|
||||||
@ -45,7 +46,7 @@ sub DOIFtools_logWrapper($);
|
|||||||
sub DOIFtoolsCounterReset($);
|
sub DOIFtoolsCounterReset($);
|
||||||
sub DOIFtoolsDeleteStatReadings;
|
sub DOIFtoolsDeleteStatReadings;
|
||||||
|
|
||||||
my @DOIFtools_we = [0,0,0,0,0,0,0,0];
|
my @DOIFtools_we = (0,0,0,0,0,0,0,0);
|
||||||
my $DOIFtoolsJSfuncEM = <<'EOF';
|
my $DOIFtoolsJSfuncEM = <<'EOF';
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//functions
|
//functions
|
||||||
@ -459,8 +460,9 @@ sub DOIFtools_fhemwebFn($$$$) {
|
|||||||
}
|
}
|
||||||
# Event Monitor
|
# Event Monitor
|
||||||
my $a0 = ReadingsVal($d,".eM", "off") eq "on" ? "off" : "on";
|
my $a0 = ReadingsVal($d,".eM", "off") eq "on" ? "off" : "on";
|
||||||
$ret .= "<div class=\"dval\"><table>";
|
$ret .= "<div class=\"dval\"><table class='block wide'>";
|
||||||
$ret .= "<tr><td><span title=\"toggle to switch event monitor on/off\">Event monitor: <a href=\"$FW_ME?detail=$d&cmd.$d=setreading $d .eM $a0$FW_CSRF\">toggle</a> </span>";
|
$ret .= "<tr><td><span title=\"toggle to switch event monitor on/off\">Event monitor: <a href=\"$FW_ME?detail=$d&cmd.$d=setreading $d .eM $a0$FW_CSRF\">toggle</a> </span>";
|
||||||
|
# Shortcuts
|
||||||
if (!AttrVal($d,"DOIFtoolsHideModulShortcuts",0)) {
|
if (!AttrVal($d,"DOIFtoolsHideModulShortcuts",0)) {
|
||||||
$ret .= "Shortcuts: ";
|
$ret .= "Shortcuts: ";
|
||||||
$ret .= "<a href=\"$FW_ME?detail=$d&cmd.$d=reload 98_DOIFtools.pm$FW_CSRF\">reload DOIFtools</a> " if(ReadingsVal($d,".debug",""));
|
$ret .= "<a href=\"$FW_ME?detail=$d&cmd.$d=reload 98_DOIFtools.pm$FW_CSRF\">reload DOIFtools</a> " if(ReadingsVal($d,".debug",""));
|
||||||
@ -576,20 +578,21 @@ sub DOIFtools_Notify($$) {
|
|||||||
my $events = deviceEvents($source,1);
|
my $events = deviceEvents($source,1);
|
||||||
return if( !$events );
|
return if( !$events );
|
||||||
# \@DOIFtools_we aktualisieren
|
# \@DOIFtools_we aktualisieren
|
||||||
if ($sn eq AttrVal("global","holiday2we","")) {
|
if ((",".AttrVal("global","holiday2we","").",") =~ /\,$sn\,/) {
|
||||||
my $we;
|
@DOIFtools_we = (0,0,0,0,0,0,0,0);
|
||||||
|
foreach my $item (split(",",AttrVal("global","holiday2we",""))) {
|
||||||
my $val;
|
my $val;
|
||||||
my $a;
|
my $a;
|
||||||
my $b;
|
my $b;
|
||||||
for (my $i = 0; $i < 8; $i++) {
|
for (my $i = 0; $i < 8; $i++) {
|
||||||
$DOIFtools_we[$i] = 0;
|
$val = CommandGet(undef,"$item days $i");
|
||||||
$val = CommandGet(undef,"$sn days $i");
|
|
||||||
if($val) {
|
if($val) {
|
||||||
($a, $b) = ReplaceEventMap($sn, [$sn, $val], 0);
|
($a, $b) = ReplaceEventMap($item, [$item, $val], 0);
|
||||||
$DOIFtools_we[$i] = 1 if($b ne "none");
|
$DOIFtools_we[$i] = 1 if($b ne "none");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
my $ldi = ReadingsVal($pn,"specialLog","") ? ReadingsVal($pn,"doif_to_log","") : "";
|
my $ldi = ReadingsVal($pn,"specialLog","") ? ReadingsVal($pn,"doif_to_log","") : "";
|
||||||
foreach my $event (@{$events}) {
|
foreach my $event (@{$events}) {
|
||||||
$event = "" if(!defined($event));
|
$event = "" if(!defined($event));
|
||||||
|
Loading…
Reference in New Issue
Block a user