2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

00_ElsnerWS: windStrength calculation corrected

git-svn-id: https://svn.fhem.de/fhem/trunk@22863 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
klaus.schauer 2020-09-27 06:39:52 +00:00
parent 04d58f8602
commit f84e255c45

View File

@ -257,7 +257,7 @@ sub ElsnerWS_Read($) {
$windSpeed = ElsnerWS_readingsBulkUpdate($hash, "windSpeed", $windSpeed, 0.1, 0.7, "%0.1f");
my @windStrength = (0.2, 1.5, 3.3, 5.4, 7.9, 10.7, 13.8, 17.1, 20.7, 24.4, 28.4, 32.6);
my $windStrength = 0;
while($windSpeed > $windStrength[$windStrength] && $windStrength <= @windStrength + 1) {
while($windSpeed > $windStrength[$windStrength] && $windStrength < @windStrength) {
$windStrength ++;
}
my $isSunny = ElsnerWS_swayCtrl($hash, "isSunny", $brightness, "brightnessSunny", "brightnessSunnyDelay", 20000, 40000, 120, 30, 'no', 'yes');