mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 13:24:56 +00:00
Unit.pm: additional RTypes for 59_Wunderground.pm
git-svn-id: https://svn.fhem.de/fhem/trunk@12590 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9ba34087f1
commit
59552def35
@ -61,13 +61,15 @@ sub Wunderground_Initialize($) {
|
||||
'UV' => { rtype => 'uvi' },
|
||||
'dewpoint' => { rtype => 'c' },
|
||||
'dewpoint_f' => { rtype => 'f' },
|
||||
'fc0_high_c' => { rtype => 'c' },
|
||||
'fc0_high_f' => { rtype => 'f' },
|
||||
'fc0_high_c' => { rtype => 'c', format => '%i' },
|
||||
'fc0_high_f' => { rtype => 'f', format => '%i' },
|
||||
'fc0_humidity' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc0_humidity_max' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc0_humidity_min' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc0_low_c' => { rtype => 'c' },
|
||||
'fc0_low_f' => { rtype => 'f' },
|
||||
'fc0_icon_url' => { rtype => 'url_http' },
|
||||
'fc0_icon_url_night' => { rtype => 'url_http' },
|
||||
'fc0_low_c' => { rtype => 'c', format => '%i' },
|
||||
'fc0_low_f' => { rtype => 'f', format => '%i' },
|
||||
'fc0_rain_day' => { rtype => 'mm' },
|
||||
'fc0_rain_day_in' => { rtype => 'in' },
|
||||
'fc0_rain_night' => { rtype => 'mm' },
|
||||
@ -76,19 +78,23 @@ sub Wunderground_Initialize($) {
|
||||
'fc0_snow_day_in' => { rtype => 'in' },
|
||||
'fc0_snow_night' => { rtype => 'cm' },
|
||||
'fc0_snow_night_in' => { rtype => 'in' },
|
||||
'fc0_title' => { rtype => 'weekday', showLong => 1 },
|
||||
'fc0_title_night' => { rtype => 'weekday_night', showLong => 1 },
|
||||
'fc0_wind_direction' => { rtype => 'gon' },
|
||||
'fc0_wind_direction_max' => { rtype => 'gon' },
|
||||
'fc0_wind_speed' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
'fc0_wind_speed_max' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
'fc0_wind_speed_max_mph' => { rtype => 'mph', formula_symbol => 'Ws' },
|
||||
'fc0_wind_speed_mph' => { rtype => 'mph', formula_symbol => 'Ws' },
|
||||
'fc1_high_c' => { rtype => 'c' },
|
||||
'fc1_high_f' => { rtype => 'f' },
|
||||
'fc1_high_c' => { rtype => 'c', format => '%i' },
|
||||
'fc1_high_f' => { rtype => 'f', format => '%i' },
|
||||
'fc1_humidity' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc1_humidity_max' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc1_humidity_min' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc1_low_c' => { rtype => 'c' },
|
||||
'fc1_low_f' => { rtype => 'f' },
|
||||
'fc1_icon_url' => { rtype => 'url_http' },
|
||||
'fc1_icon_url_night' => { rtype => 'url_http' },
|
||||
'fc1_low_c' => { rtype => 'c', format => '%i' },
|
||||
'fc1_low_f' => { rtype => 'f', format => '%i' },
|
||||
'fc1_rain_day' => { rtype => 'mm' },
|
||||
'fc1_rain_day_in' => { rtype => 'in' },
|
||||
'fc1_rain_night' => { rtype => 'mm' },
|
||||
@ -97,19 +103,23 @@ sub Wunderground_Initialize($) {
|
||||
'fc1_snow_day_in' => { rtype => 'in' },
|
||||
'fc1_snow_night' => { rtype => 'cm' },
|
||||
'fc1_snow_night_in' => { rtype => 'in' },
|
||||
'fc1_title' => { rtype => 'weekday', showLong => 1 },
|
||||
'fc1_title_night' => { rtype => 'weekday_night', showLong => 1 },
|
||||
'fc1_wind_direction' => { rtype => 'gon' },
|
||||
'fc1_wind_direction_max' => { rtype => 'gon' },
|
||||
'fc1_wind_speed' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
'fc1_wind_speed_max' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
'fc1_wind_speed_max_mph' => { rtype => 'mph', formula_symbol => 'Ws' },
|
||||
'fc1_wind_speed_mph' => { rtype => 'mph', formula_symbol => 'Ws' },
|
||||
'fc2_high_c' => { rtype => 'c' },
|
||||
'fc2_high_f' => { rtype => 'f' },
|
||||
'fc2_high_c' => { rtype => 'c', format => '%i' },
|
||||
'fc2_high_f' => { rtype => 'f', format => '%i' },
|
||||
'fc2_humidity' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc2_humidity_max' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc2_humidity_min' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc2_low_c' => { rtype => 'c' },
|
||||
'fc2_low_f' => { rtype => 'f' },
|
||||
'fc2_icon_url' => { rtype => 'url_http' },
|
||||
'fc2_icon_url_night' => { rtype => 'url_http' },
|
||||
'fc2_low_c' => { rtype => 'c', format => '%i' },
|
||||
'fc2_low_f' => { rtype => 'f', format => '%i' },
|
||||
'fc2_rain_day' => { rtype => 'mm' },
|
||||
'fc2_rain_day_in' => { rtype => 'in' },
|
||||
'fc2_rain_night' => { rtype => 'mm' },
|
||||
@ -118,19 +128,23 @@ sub Wunderground_Initialize($) {
|
||||
'fc2_snow_day_in' => { rtype => 'in' },
|
||||
'fc2_snow_night' => { rtype => 'cm' },
|
||||
'fc2_snow_night_in' => { rtype => 'in' },
|
||||
'fc2_wind_direction' => { rtype => 'gon' },
|
||||
'fc2_title' => { rtype => 'weekday', showLong => 1 },
|
||||
'fc2_title_night' => { rtype => 'weekday_night', showLong => 1, },
|
||||
'fc2_wind_direction' => { rtype => 'gon' },
|
||||
'fc2_wind_direction_max' => { rtype => 'gon' },
|
||||
'fc2_wind_speed' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
'fc2_wind_speed_max' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
'fc2_wind_speed_max_mph' => { rtype => 'mph', formula_symbol => 'Ws' },
|
||||
'fc2_wind_speed_mph' => { rtype => 'mph', formula_symbol => 'Ws' },
|
||||
'fc3_high_c' => { rtype => 'c' },
|
||||
'fc3_high_f' => { rtype => 'f' },
|
||||
'fc3_high_c' => { rtype => 'c', format => '%i' },
|
||||
'fc3_high_f' => { rtype => 'f', format => '%i' },
|
||||
'fc3_humidity' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc3_humidity_max' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc3_humidity_min' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'fc3_low_c' => { rtype => 'c' },
|
||||
'fc3_low_f' => { rtype => 'f' },
|
||||
'fc3_icon_url' => { rtype => 'url_http' },
|
||||
'fc3_icon_url_night' => { rtype => 'url_http' },
|
||||
'fc3_low_c' => { rtype => 'c', format => '%i' },
|
||||
'fc3_low_f' => { rtype => 'f', format => '%i' },
|
||||
'fc3_rain_day' => { rtype => 'mm' },
|
||||
'fc3_rain_day_in' => { rtype => 'in' },
|
||||
'fc3_rain_night' => { rtype => 'mm' },
|
||||
@ -139,6 +153,8 @@ sub Wunderground_Initialize($) {
|
||||
'fc3_snow_day_in' => { rtype => 'in' },
|
||||
'fc3_snow_night' => { rtype => 'cm' },
|
||||
'fc3_snow_night_in' => { rtype => 'in' },
|
||||
'fc3_title' => { rtype => 'weekday', showLong => 1 },
|
||||
'fc3_title_night' => { rtype => 'weekday_night', showLong => 1 },
|
||||
'fc3_wind_direction' => { rtype => 'gon' },
|
||||
'fc3_wind_direction_max' => { rtype => 'gon' },
|
||||
'fc3_wind_speed' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
@ -147,29 +163,45 @@ sub Wunderground_Initialize($) {
|
||||
'fc3_wind_speed_mph' => { rtype => 'mph', formula_symbol => 'Ws' },
|
||||
'feelslike_c' => { rtype => 'c' },
|
||||
'feelslike_f' => { rtype => 'f' },
|
||||
'heat_index_c' => { rtype => 'c' },
|
||||
'heat_index_f' => { rtype => 'f' },
|
||||
'forecast_url' => { rtype => 'url_http' },
|
||||
'history_url' => { rtype => 'url_http' },
|
||||
'humidity' => { rtype => 'pct', formula_symbol => 'H' },
|
||||
'icon_url' => { rtype => 'url_http' },
|
||||
'israining' => { rtype => 'bool', },
|
||||
'lastQueryResult' => { rtype => 'oknok' },
|
||||
'moon_age' => { rtype => 'd' },
|
||||
'moon_pct' => { rtype => 'pct' },
|
||||
'ob_url' => { rtype => 'url_http' },
|
||||
'pressure' => { rtype => 'hpamb' },
|
||||
'pressure_in' => { rtype => 'inhg' },
|
||||
'pressure_trend' => { rtype => 'trend', showLong => 1, },
|
||||
'rain' => { rtype => 'mm' },
|
||||
'rain_day' => { rtype => 'mm' },
|
||||
'rain_day_in' => { rtype => 'in' },
|
||||
'rain_in' => { rtype => 'in' },
|
||||
'solarradiation' => { rtype => 'wpsm' },
|
||||
'sunrise' => { rtype => 'time' },
|
||||
'sunset' => { rtype => 'time' },
|
||||
'temp_c' => { rtype => 'c' },
|
||||
'temp_f' => { rtype => 'f' },
|
||||
'visibility' => { rtype => 'km' },
|
||||
'visibility_mi' => { rtype => 'mi' },
|
||||
'wind_chill' => { rtype => 'c', formula_symbol => 'Wc' },
|
||||
'wind_chill_f' => { rtype => 'f', formula_symbol => 'Wc' },
|
||||
'wind_direction' => { rtype => 'direction' },
|
||||
'wind_gust' => { rtype => 'kmh', formula_symbol => 'Wg' },
|
||||
'wind_gust_mph' => { rtype => 'mph', formula_symbol => 'Wg' },
|
||||
'wind_speed' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
'wind_speed_mph' => { rtype => 'mph', formula_symbol => 'Ws' }
|
||||
'visibility' => { rtype => 'km', scope => { empty_replace => '-.-' } },
|
||||
'visibility_mi' =>
|
||||
{ rtype => 'mi', scope => { empty_replace => '-.-' } },
|
||||
'wind_chill' => {
|
||||
rtype => 'c',
|
||||
formula_symbol => 'Wc',
|
||||
scope => { empty_replace => '-.-' },
|
||||
},
|
||||
'wind_chill_f' => {
|
||||
rtype => 'f',
|
||||
formula_symbol => 'Wc',
|
||||
scope => { empty_replace => '-.-' }
|
||||
},
|
||||
'wind_direction' => { rtype => 'direction' },
|
||||
'wind_gust' => { rtype => 'kmh', formula_symbol => 'Wg' },
|
||||
'wind_gust_mph' => { rtype => 'mph', formula_symbol => 'Wg' },
|
||||
'wind_speed' => { rtype => 'kmh', formula_symbol => 'Ws' },
|
||||
'wind_speed_mph' => { rtype => 'mph', formula_symbol => 'Ws' }
|
||||
};
|
||||
|
||||
return;
|
||||
|
@ -15,18 +15,6 @@ use Data::Dumper;
|
||||
####################
|
||||
# Translations
|
||||
|
||||
my %pressure_trend = ( "=" => "0", "+" => "1", "-" => "2" );
|
||||
|
||||
my %pressure_trend_sym = ( 0 => "=", 1 => "+", 2 => "-" );
|
||||
|
||||
my %pressure_trend_txt = (
|
||||
"en" => { 0 => "steady", 1 => "rising", 2 => "falling" },
|
||||
"de" => { 0 => "gleichbleibend", 1 => "steigend", 2 => "fallend" },
|
||||
"nl" => { 0 => "stabiel", 1 => "stijgend", 2 => "dalend" },
|
||||
"fr" => { 0 => "stable", 1 => "croissant", 2 => "décroissant" },
|
||||
"pl" => { 0 => "stabilne", 1 => "rośnie", 2 => "spada" },
|
||||
);
|
||||
|
||||
my %compasspoint_txt = (
|
||||
"en" => [
|
||||
'N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE',
|
||||
@ -440,26 +428,6 @@ sub uvi2condition($) {
|
||||
return $v;
|
||||
}
|
||||
|
||||
sub pressuretrend2sym($) {
|
||||
my ($data) = @_;
|
||||
return $data if !$pressure_trend_sym{$data};
|
||||
return $pressure_trend_sym{$data};
|
||||
}
|
||||
|
||||
sub pressuretrend2condition($;$) {
|
||||
my ( $data, $lang ) = @_;
|
||||
my $l = ( $lang ? lc($lang) : "en" );
|
||||
return $pressure_trend_txt{$l}{$data}
|
||||
if $pressure_trend_txt{$l}{$data};
|
||||
return $pressure_trend_txt{"en"}{$data};
|
||||
}
|
||||
|
||||
sub sym2pressuretrend($) {
|
||||
my ($data) = @_;
|
||||
return $data if !$pressure_trend{$data};
|
||||
return $pressure_trend{$data};
|
||||
}
|
||||
|
||||
sub values2weathercondition($$$$$) {
|
||||
my ( $temp, $hum, $light, $isday, $israining ) = @_;
|
||||
my $condition = "clear";
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user