2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

76_SMAPortal: contrib 3.6.1

git-svn-id: https://svn.fhem.de/fhem/trunk@23061 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-10-31 15:51:25 +00:00
parent e4f1b2e4f8
commit 5c22b412df

View File

@ -1613,8 +1613,6 @@ sub _getBalanceMonthData { ## no critic "not used"
my @bd = split /\s+/x ,AttrVal($name, "balanceMonth", "current");
my $tag = "balanceMonthData";
my $d = (localtime(time))[3]; # heutiges Tages-Datum (Tag)
for my $bal (@bd) {
my ($y,$m);
@ -1662,7 +1660,9 @@ sub _getBalanceMonthData { ## no critic "not used"
$addon = createDateAddon ($params);
}
eval { timelocal(0, 0, 0, $d, $m, $y) } or do { $state = (split(" at", $@))[0];
my $dim = $m+1-2 ? 30+(($m+1)*3%7<4) : 28+!(($y+1900)%4||($y+1900)%400*!(($y+1900)%100)); # errechnet wieviel Tage der Monat hat
eval { timelocal(0, 0, 0, $dim, $m, $y) } or do { $state = (split(" at", $@))[0];
$errstate = 1;
Log3($name, 2, "$name - ERROR - invalid date/time format in attribute 'balanceMonth' detected: $state");
return ($errstate,$state,$reread,$retry);
@ -1670,7 +1670,7 @@ sub _getBalanceMonthData { ## no critic "not used"
Log3 ($name, 4, "$name - retrieve $tag ".($y+1900)."-".sprintf "%02d", $m+1);
my $cts = fhemTimeLocal(0, 0, 0, $d, $m, $y);
my $cts = fhemTimeLocal(0, 0, 0, $dim, $m, $y);
my $offset = fhemTzOffset($cts);
my $anchort = int($cts + $offset); # anchorTime in UTC -> abzurufendes Datum