diff --git a/fhem/FHEM/98_DOIF.pm b/fhem/FHEM/98_DOIF.pm index c5fee04fe..a2c921ab8 100644 --- a/fhem/FHEM/98_DOIF.pm +++ b/fhem/FHEM/98_DOIF.pm @@ -4481,16 +4481,17 @@ sub format_value { my ($val,$min,$dec)=@_; my $format; my $value=$val; - if ($val eq "") { $val="N/A"; $format='%s'; - $value=$min; - } elsif ($val !~ /(-?\d+(\.\d+)?)/) { + $value=0; + } elsif ($val =~ /(-?\d+(\.\d+)?)/) { + $format='%1.'.$dec.'f'; + $value=$1; + $val=$value; + } else { $format='%s'; $value=0; - } else { - $format='%1.'.$dec.'f'; } return($format,$value,$val); } @@ -5385,7 +5386,7 @@ sub ring ',$currColor,$minColor,(defined $lr ? $lr:0),$x1,$y1,$x2,$y2,color($currColor,$lr),color($minColor,$lr)); } if (defined $innerRing and $innerRing and ref($func) ne "ARRAY") { - $out.= sprintf('\ + $out.= sprintf('\ ',$minCol,$maxColor,(defined $lir ? $lir:0),100,0,0,0,color($maxColor,$lir),color($minCol,$lir)); } $out.= '\ @@ -5584,10 +5585,10 @@ sub ring2 $out.= sprintf('',$width,$height,$width,$height); $out.= ''; $out.= ''; - $out.= sprintf('\ + $out.= sprintf('\ ',$currColor,$minColor,(defined $lr ? $lr:0),$x1,$y1,$x2,$y2,color($currColor,$lr),color($currColor,$lr)); - $out.= sprintf('\ + $out.= sprintf('\ ',$currColor2,$minColor2,(defined $lr ? $lr:0),$x12,$y12,$x22,$y22,color($currColor2,$lr),color($currColor2,$lr)); $out.= '\ @@ -5600,7 +5601,7 @@ sub ring2 $out.=''; - $out.=sprintf('',$currColor,$minColor,(defined $lr ? $lr:0)); + $out.=sprintf('',$currColor,$minColor,(defined $lr ? $lr:0)); $out.=describeArc(41, 30, 28.2, 0, int($prop*280)); $out.='';