robho wrote:
> I found that the windspeed is incorrect if you're using metric units.
> Here's a patch which solves the problem:
> >
Code:
--------------------
> > --- Plugin.pm.old 2020-03-27 21:41:31.160152756 +0100
> +++ Plugin.pm 2020-03-27 22:36:15.128817918 +0100
> @@ -3526,6 +3526,14 @@
> $wetData{'feelslikeC'} = FtoC($perldata->{'vt1observation'}->{'feelsLike'});
> $wetData{'dewpointF'} = $perldata->{'vt1observation'}->{'dewPoint'};
> $wetData{'dewpointC'} = FtoC($perldata->{'vt1observation'}->{'dewPoint'});
> +
> + $wetData{'windspeed_mh'} =
$perldata->{'vt1observation'}->{'windSpeed'};
> + $wetData{'windspeed_kh'} =
($perldata->{'vt1observation'}->{'windSpeed'})*1.609344;
> + $wetData{'windspeed_kh'} = int($wetData{'windspeed_kh'} + .5 *
($wetData{'windspeed_kh'} <=> 0)); #Funky round
> + $wetData{'windspeed_kth'} =
($perldata->{'vt1observation'}->{'windSpeed'})/1.1515;
> + $wetData{'windspeed_kth'} = int($wetData{'windspeed_kth'} + .5 *
($wetData{'windspeed_kth'} <=> 0)); #Funky round
> + $wetData{'windspeed_ms'} =
$perldata->{'vt1observation'}->{'windSpeed'}*16.09344/36;
> + $wetData{'windspeed_ms'} = int($wetData{'windspeed_ms'} + .5 *
($wetData{'windspeed_ms'} <=> 0)); #Funky round
> }
> elsif ($units eq 'm') {
> $wetData{'temperatureF'} =
CtoF($perldata->{'vt1observation'}->{'temperature'});
> @@ -3534,6 +3542,14 @@
> $wetData{'feelslikeC'} = $perldata->{'vt1observation'}->{'feelsLike'};
> $wetData{'dewpointF'} = CtoF($perldata->{'vt1observation'}->{'dewPoint'});
> $wetData{'dewpointC'} = $perldata->{'vt1observation'}->{'dewPoint'};
> +
> + $wetData{'windspeed_kh'} =
$perldata->{'vt1observation'}->{'windSpeed'};
> + $wetData{'windspeed_mh'} =
($perldata->{'vt1observation'}->{'windSpeed'}) * 0.6213711922;
> + $wetData{'windspeed_mh'} = int($wetData{'windspeed_mh'} + .5 *
($wetData{'windspeed_mh'} <=> 0)); #Funky round
> + $wetData{'windspeed_kth'} =
($perldata->{'vt1observation'}->{'windSpeed'}) * 0.54;
> + $wetData{'windspeed_kth'} = int($wetData{'windspeed_kth'} + .5 *
($wetData{'windspeed_kth'} <=> 0)); #Funky round
> + $wetData{'windspeed_ms'} =
$perldata->{'vt1observation'}->{'windSpeed'} / 3.6;
> + $wetData{'windspeed_ms'} = int($wetData{'windspeed_ms'} + .5 *
($wetData{'windspeed_ms'} <=> 0)); #Funky round
> }
> else {
> $log->error('$units undefined');
> @@ -3541,13 +3557,6 @@
>
> $wetData{-1}{'forecastIcon'} = $perldata->{'vt1observation'}->{'icon'};
> $wetData{-1}{'forecastIconURLSmall'} =
'/plugins/SuperDateTime/html/images/' . $perldata->{'vt1observation'}->{'icon'}
. '.png';
> - $wetData{'windspeed_mh'} =
$perldata->{'vt1observation'}->{'windSpeed'};
> - $wetData{'windspeed_kh'} =
($perldata->{'vt1observation'}->{'windSpeed'})*1.609344;
> - $wetData{'windspeed_kh'} = int($wetData{'windspeed_kh'} + .5 *
($wetData{'windspeed_kh'} <=> 0)); #Funky round
> - $wetData{'windspeed_kth'} =
($perldata->{'vt1observation'}->{'windSpeed'})/1.1515;
> - $wetData{'windspeed_kth'} = int($wetData{'windspeed_kth'} + .5 *
($wetData{'windspeed_kth'} <=> 0)); #Funky round
> - $wetData{'windspeed_ms'} =
$perldata->{'vt1observation'}->{'windSpeed'}*16.09344/36;
> - $wetData{'windspeed_ms'} = int($wetData{'windspeed_ms'} + .5 *
($wetData{'windspeed_ms'} <=> 0)); #Funky round
> my $WindDir = $perldata->{'vt1observation'}->{'windDirCompass'};
> $wetData{'windspeed_mh'} = $WindDir . $wetData{'windspeed_mh'};
>
--------------------
> >
>
> (I think it would be easier to start using this plugin if a new thread
> or wiki page was added for the current plugin. I just started using
> the plugin and it took me some time to figure out that there are at
> least three versions, but only one is maintained (I think) and which
> repo to use to use it)
Nice catch. I'll roll your patch into a future release. I'll also look
into starting new thread for that release.
------------------------------------------------------------------------
BoomX2's Profile: http://forums.slimdevices.com/member.php?userid=33529
View this thread: http://forums.slimdevices.com/showthread.php?t=14327
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins