From d9db67562baa997babbafc45810ccdc263602a35 Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sun, 5 Sep 2021 13:08:01 +0000 Subject: [PATCH] 76_SolarForecast.pm: contrib 0.55.0 git-svn-id: https://svn.fhem.de/fhem/trunk@24916 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SolarForecast.pm | 81 ++++++++++----------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index fab5f4c2f..2d0dbcc31 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -5074,9 +5074,10 @@ sub _flowGraphic { $css $animation - + + - + @@ -5104,11 +5105,11 @@ sub _flowGraphic { - + - + END0 @@ -5116,7 +5117,7 @@ END0 ## get consumer list and display it in Graphics ################################################ my $type = $hash->{TYPE}; - my @consumers = sort{$a<=>$b} keys %{$data{$type}{$name}{consumers}}; # definierte Verbraucher ermitteln + my @consumers = sort{$a<=>$b} keys %{$data{$type}{$name}{consumers}}; # definierte Verbraucher ermitteln my $consumercount = scalar @consumers; my $consumer_start = 0; my $consumer_distance = 100; @@ -5125,31 +5126,30 @@ END0 $consumer_start = 250 - ($consumer_distance * (($consumercount -1) / 2)); } else { - $consumer_start = 250 - ((($consumer_distance ) / 2) * ($consumercount-1)); + $consumer_start = 250 - ((($consumer_distance ) / 2) * ($consumercount-1)); } - $consumer_start = 0 if ($consumer_start < 0); + $consumer_start = 0 if $consumer_start < 0; my $pos_left = $consumer_start; for my $c0 (@consumers) { - next if (!$c0); my ($cons,$im,$start,$end) = split (':', $c0); - #Log3 ($name, 1, "$name - Energieflussgrafik, Consumer to show a -> $cons"); + # Log3 ($name, 1, "$name - Energieflussgrafik, Consumer to show -> $cons"); - my $cname = ConsumerVal ($hash, $c0, "name", ""); # Name des Consumerdevices - my $cicon = ConsumerVal ($hash, $c0, "icon", ""); # Icon des Consumerdevices + my $cname = ConsumerVal ($hash, $c0, "name", ""); # Name des Consumerdevices + my $cicon = ConsumerVal ($hash, $c0, "icon", ""); # Icon des Consumerdevices - $ret .= ''; - #$ret .= FW_makeImage($cicon,$cname); - $ret .= ''; - $ret .= ' '; - $pos_left = $pos_left + $consumer_distance; + $ret .= ''; + #$ret .= FW_makeImage($cicon,$cname); + $ret .= ''; + $ret .= ' '; + + $pos_left += $consumer_distance; } - if ($hasbat) { $ret .= << "END1"; - + END1 @@ -5163,59 +5163,58 @@ END1 $ret .= << "END2"; - - - + + + END2 if ($hasbat) { $ret .= << "END3"; - - + + END3 } ## get consumer list and display it in Graphics ################################################ $pos_left = $consumer_start * 2; + my $consumer_style = 'flowg inactive_out'; for my $c1 (@consumers) { - next if(!$c1); my ($cons,$im,$start,$end) = split (':', $c1); - #Log3 ($name, 1, "$name - Energieflussgrafik, Consumer to show b -> $cons"); + # Log3 ($name, 1, "$name - Energieflussgrafik, Consumer to show -> $cons"); - my $consumer_style = 'flowg inactive_out'; - $consumer_style = 'flowg active_out' if(ReadingsNum($name, "consumer${cons}_currentPower", 0) > 0); + $consumer_style = 'flowg inactive_out'; + $consumer_style = 'flowg active_out' if(ReadingsNum($name, "consumer${cons}_currentPower", 0) > 0); $ret .= qq{}; - $pos_left = $pos_left + ($consumer_distance * 2); - } + $pos_left += ($consumer_distance * 2); + } - $ret .= qq{$cpv} if ($cpv); - $ret .= qq{$soc %} if ($hasbat); - $ret .= qq{$csc} if ($csc && $cpv); - $ret .= qq{$cgfi} if ($cgfi); - $ret .= qq{$cgc} if ($cgc); - $ret .= qq{$batout} if ($batout && $hasbat); - $ret .= qq{$batin} if ($batin && $hasbat); + $ret .= qq{$cpv} if ($cpv); + $ret .= qq{$soc %} if ($hasbat); + $ret .= qq{$csc} if ($csc && $cpv); + $ret .= qq{$cgfi} if ($cgfi); + $ret .= qq{$cgc} if ($cgc); + $ret .= qq{$batout} if ($batout && $hasbat); + $ret .= qq{$batin} if ($batin && $hasbat); ## get consumer list and display it in Graphics ################################################ - $pos_left = $consumer_start * 2; + $pos_left = ($consumer_start * 2) - 50; for my $c2 (@consumers) { - next if(!$c2); my ($cons,$im,$start,$end) = split (':', $c2); - #Log3 ($name, 1, "$name - Energieflussgrafik, Consumer to show c -> $cons"); + Log3 ($name, 1, "$name - Energieflussgrafik, Consumer to show -> $cons"); my $power = ReadingsNum($name, "consumer${cons}_currentPower", 0); $ret .= qq{$power}; - $pos_left = $pos_left + ($consumer_distance * 2); + $pos_left += ($consumer_distance * 2); } - + $ret .= qq{}; return $ret;