2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +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:
Ellert 2018-02-23 13:16:23 +00:00
parent 1953f8cead
commit ad80dde270
2 changed files with 19 additions and 14 deletions

View File

@ -1,5 +1,7 @@
# 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_DOIFtools: support for multiple holiday files in holiday2we for
next timer calculation
- change: 53_GHoma: plugs with energy measurement implemented
reading energy now in kWh / SetExtensions / DbLog_splitFn
- change: 93_DbRep: commandref revised

View File

@ -23,6 +23,7 @@ use strict;
use warnings;
use Time::Local;
use Color;
use vars qw(%FW_rooms %FW_groups);
sub DOIFtools_Initialize($);
sub DOIFtools_Set($@);
@ -45,7 +46,7 @@ sub DOIFtools_logWrapper($);
sub DOIFtoolsCounterReset($);
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';
<script type="text/javascript">
//functions
@ -459,8 +460,9 @@ sub DOIFtools_fhemwebFn($$$$) {
}
# Event Monitor
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&amp;cmd.$d=setreading $d .eM $a0$FW_CSRF\">toggle</a>&nbsp;&nbsp;</span>";
# Shortcuts
if (!AttrVal($d,"DOIFtoolsHideModulShortcuts",0)) {
$ret .= "Shortcuts: ";
$ret .= "<a href=\"$FW_ME?detail=$d&amp;cmd.$d=reload 98_DOIFtools.pm$FW_CSRF\">reload DOIFtools</a>&nbsp;&nbsp;" if(ReadingsVal($d,".debug",""));
@ -576,20 +578,21 @@ sub DOIFtools_Notify($$) {
my $events = deviceEvents($source,1);
return if( !$events );
# \@DOIFtools_we aktualisieren
if ($sn eq AttrVal("global","holiday2we","")) {
my $we;
if ((",".AttrVal("global","holiday2we","").",") =~ /\,$sn\,/) {
@DOIFtools_we = (0,0,0,0,0,0,0,0);
foreach my $item (split(",",AttrVal("global","holiday2we",""))) {
my $val;
my $a;
my $b;
for (my $i = 0; $i < 8; $i++) {
$DOIFtools_we[$i] = 0;
$val = CommandGet(undef,"$sn days $i");
$val = CommandGet(undef,"$item days $i");
if($val) {
($a, $b) = ReplaceEventMap($sn, [$sn, $val], 0);
($a, $b) = ReplaceEventMap($item, [$item, $val], 0);
$DOIFtools_we[$i] = 1 if($b ne "none");
}
}
}
}
my $ldi = ReadingsVal($pn,"specialLog","") ? ReadingsVal($pn,"doif_to_log","") : "";
foreach my $event (@{$events}) {
$event = "" if(!defined($event));