Compare commits
73 Commits
Author | SHA1 | Date | |
---|---|---|---|
af36bed895 | |||
ba898624c5 | |||
12595b3674 | |||
f7234b10f8 | |||
be3fb7bbfc | |||
23bbc9f9b0 | |||
e60509fbfd | |||
aafeea4d5f | |||
c6b6a12e47 | |||
b57f538bc3 | |||
464ba0bec3 | |||
2b96be4e6e | |||
d07297bcd8 | |||
af786290bc | |||
478c4a3159 | |||
6a38b446a9 | |||
00c0a2a87e | |||
0a47226436 | |||
e9fb9357a9 | |||
ce875a8beb | |||
d0157fb2c7 | |||
eb134a19e9 | |||
cfd255569f | |||
b1de4b52da | |||
6b6c066a9b | |||
530fc01d57 | |||
7d7cbef4ed | |||
8b9bbd4f98 | |||
2a06821252 | |||
9868f74a86 | |||
d2e93a6d5a | |||
c27d51534c | |||
5bfd1c49d9 | |||
0f1af75a9e | |||
70a402f096 | |||
245fc455e1 | |||
1683fab2d4 | |||
33763032c6 | |||
2afb98f9b9 | |||
38091aacd1 | |||
30dd03cbea | |||
43e3fcb237 | |||
5f611555e3 | |||
a3fa194cdd | |||
baa48a79a4 | |||
2601a42643 | |||
cfd8ff9ea1 | |||
be3352e462 | |||
fb5087803b | |||
e3b9f512b9 | |||
99b46338ca | |||
a78a1a986d | |||
62df910faa | |||
f96c557a22 | |||
4eeb71e8bc | |||
eeea03d2df | |||
2e8acfff0b | |||
c29f48a282 | |||
185a7bbc91 | |||
0a2f755324 | |||
b6ecd73be9 | |||
4e666112b5 | |||
394c038e5c | |||
e96fb55f90 | |||
a330aec9d7 | |||
fc08db02eb | |||
f8b12ba1a7 | |||
908773420b | |||
cef2455448 | |||
e237018aad | |||
c7f7066b31 | |||
363e862244 | |||
8659585952 |
1337
CHANGELOG.md
1337
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
1141
FHEM/59_Weather.pm
1141
FHEM/59_Weather.pm
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
UPD 2023-01-07_13:28:16 57768 FHEM/59_Weather.pm
|
UPD 2025-02-05_05:56:41 25899 FHEM/59_Weather.pm
|
||||||
UPD 2023-01-07_13:28:44 49884 lib/FHEM/APIs/Weather/DarkSkyAPI.pm
|
UPD 2025-02-04_21:08:26 34419 lib/FHEM/Core/Weather.pm
|
||||||
UPD 2023-01-07_13:28:59 33258 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
|
UPD 2025-02-05_06:38:34 33780 lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm
|
||||||
UPD 2023-01-07_13:29:12 36090 lib/FHEM/APIs/Weather/wundergroundAPI.pm
|
UPD 2025-02-04_21:08:26 38751 lib/FHEM/APIs/Weather/wundergroundAPI.pm
|
||||||
|
@ -4,32 +4,34 @@ use File::Basename;
|
|||||||
use POSIX qw(strftime);
|
use POSIX qw(strftime);
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
my @filenames = ( 'FHEM/59_Weather.pm',
|
my @filenames = (
|
||||||
'lib/FHEM/APIs/Weather/DarkSkyAPI.pm',
|
'FHEM/59_Weather.pm',
|
||||||
|
'lib/FHEM/Core/Weather.pm',
|
||||||
'lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm',
|
'lib/FHEM/APIs/Weather/OpenWeatherMapAPI.pm',
|
||||||
'lib/FHEM/APIs/Weather/wundergroundAPI.pm',
|
'lib/FHEM/APIs/Weather/wundergroundAPI.pm',
|
||||||
);
|
);
|
||||||
|
|
||||||
my $controlsfile = 'controls_Weather.txt';
|
my $controlsfile = 'controls_Weather.txt';
|
||||||
|
|
||||||
open(FH, ">$controlsfile") || return("Can't open $controlsfile: $!");
|
open( FH, ">$controlsfile" ) || return ("Can't open $controlsfile: $!");
|
||||||
|
|
||||||
for my $filename (@filenames) {
|
for my $filename (@filenames) {
|
||||||
my @statOutput = stat($filename);
|
my @statOutput = stat($filename);
|
||||||
|
|
||||||
if (scalar @statOutput != 13) {
|
if ( scalar @statOutput != 13 ) {
|
||||||
printf 'error: stat has unexpected return value for ' . $filename . "\n";
|
printf 'error: stat has unexpected return value for '
|
||||||
|
. $filename . "\n";
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $mtime = $statOutput[9];
|
my $mtime = $statOutput[9];
|
||||||
my $date = POSIX::strftime("%Y-%m-%d", localtime($mtime));
|
my $date = POSIX::strftime( "%Y-%m-%d", localtime($mtime) );
|
||||||
my $time = POSIX::strftime("%H:%M:%S", localtime($mtime));
|
my $time = POSIX::strftime( "%H:%M:%S", localtime($mtime) );
|
||||||
my $filetime = $date."_".$time;
|
my $filetime = $date . "_" . $time;
|
||||||
|
|
||||||
my $filesize = $statOutput[7];
|
my $filesize = $statOutput[7];
|
||||||
|
|
||||||
printf FH 'UPD ' . $filetime . ' ' . $filesize . ' ' .$filename . "\n";
|
printf FH 'UPD ' . $filetime . ' ' . $filesize . ' ' . $filename . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
close(FH);
|
close(FH);
|
||||||
|
File diff suppressed because one or more lines are too long
@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Developed with VSCodium and richterger perl plugin
|
# Developed with VSCodium and richterger perl plugin
|
||||||
#
|
#
|
||||||
# (c) 2019-2023 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
# (c) 2019-2025 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net)
|
||||||
# All rights reserved
|
# All rights reserved
|
||||||
#
|
#
|
||||||
# Special thanks goes to:
|
# Special thanks goes to:
|
||||||
@ -423,7 +423,7 @@ sub _ProcessingRetrieveData {
|
|||||||
_ErrorHandling( $self,
|
_ErrorHandling( $self,
|
||||||
'OpenWeatherMap Weather decode JSON err ' . $@ );
|
'OpenWeatherMap Weather decode JSON err ' . $@ );
|
||||||
}
|
}
|
||||||
elsif (defined( $data->{cod} )
|
elsif ( defined( $data->{cod} )
|
||||||
&& $data->{cod}
|
&& $data->{cod}
|
||||||
&& $data->{cod} != 200
|
&& $data->{cod} != 200
|
||||||
&& defined( $data->{message} )
|
&& defined( $data->{message} )
|
||||||
@ -591,6 +591,7 @@ sub _FillSelfHashWithWeatherResponseForWeatherCurrent {
|
|||||||
'wind_direction' => $data->{wind}->{deg},
|
'wind_direction' => $data->{wind}->{deg},
|
||||||
'cloudCover' => $data->{clouds}->{all},
|
'cloudCover' => $data->{clouds}->{all},
|
||||||
'code' => $codes{ $data->{weather}->[0]->{id} },
|
'code' => $codes{ $data->{weather}->[0]->{id} },
|
||||||
|
'owmAPICode' => $data->{weather}->[0]->{id},
|
||||||
'iconAPI' => $data->{weather}->[0]->{icon},
|
'iconAPI' => $data->{weather}->[0]->{icon},
|
||||||
'sunsetTime' => _strftimeWrapper(
|
'sunsetTime' => _strftimeWrapper(
|
||||||
"%a, %e %b %Y %H:%M",
|
"%a, %e %b %Y %H:%M",
|
||||||
@ -670,6 +671,7 @@ sub _FillSelfHashWithWeatherResponseForForecastHourly {
|
|||||||
),
|
),
|
||||||
'cloudCover' => $data->{list}->[$i]->{clouds}->{all},
|
'cloudCover' => $data->{list}->[$i]->{clouds}->{all},
|
||||||
'code' => $codes{ $data->{list}->[$i]->{weather}->[0]->{id} },
|
'code' => $codes{ $data->{list}->[$i]->{weather}->[0]->{id} },
|
||||||
|
'owmAPICode' => $data->{list}->[$i]->{weather}->[0]->{id},
|
||||||
'iconAPI' => $data->{list}->[$i]->{weather}->[0]->{icon},
|
'iconAPI' => $data->{list}->[$i]->{weather}->[0]->{icon},
|
||||||
'rain1h' => (
|
'rain1h' => (
|
||||||
$data->{list}->[$i]->{rain}->{'1h'}
|
$data->{list}->[$i]->{rain}->{'1h'}
|
||||||
@ -688,7 +690,7 @@ sub _FillSelfHashWithWeatherResponseForForecastHourly {
|
|||||||
),
|
),
|
||||||
'snow3h' => (
|
'snow3h' => (
|
||||||
$data->{list}->[$i]->{snow}->{'3h'}
|
$data->{list}->[$i]->{snow}->{'3h'}
|
||||||
? $data->{list}->[$i]->{snow}->{'1h'}
|
? $data->{list}->[$i]->{snow}->{'3h'}
|
||||||
: 0
|
: 0
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
@ -732,6 +734,7 @@ sub _FillSelfHashWithWeatherResponseForOnecallCurrent {
|
|||||||
'rain_1h' => ( $data->{rain}->{'1h'} ? $data->{rain}->{'1h'} : 0 ),
|
'rain_1h' => ( $data->{rain}->{'1h'} ? $data->{rain}->{'1h'} : 0 ),
|
||||||
'cloudCover' => $data->{current}->{clouds},
|
'cloudCover' => $data->{current}->{clouds},
|
||||||
'code' => $codes{ $data->{current}->{weather}->[0]->{id} },
|
'code' => $codes{ $data->{current}->{weather}->[0]->{id} },
|
||||||
|
'owmAPICode' => $data->{current}->{weather}->[0]->{id},
|
||||||
'iconAPI' => $data->{current}->{weather}->[0]->{icon},
|
'iconAPI' => $data->{current}->{weather}->[0]->{icon},
|
||||||
'condition' =>
|
'condition' =>
|
||||||
encode_utf8( $data->{current}->{weather}->[0]->{description} ),
|
encode_utf8( $data->{current}->{weather}->[0]->{description} ),
|
||||||
@ -788,6 +791,7 @@ sub _FillSelfHashWithWeatherResponseForOnecallDaily {
|
|||||||
'moonset' => strftime(
|
'moonset' => strftime(
|
||||||
"%a, %H:%M", localtime( $data->{daily}->[$i]->{moonset} )
|
"%a, %H:%M", localtime( $data->{daily}->[$i]->{moonset} )
|
||||||
),
|
),
|
||||||
|
'summary' => $data->{daily}->[$i]->{summary},
|
||||||
'temperature' =>
|
'temperature' =>
|
||||||
int( sprintf( "%.0f", $data->{daily}->[$i]->{temp}->{day} ) ),
|
int( sprintf( "%.0f", $data->{daily}->[$i]->{temp}->{day} ) ),
|
||||||
'temperature_morn' => int(
|
'temperature_morn' => int(
|
||||||
@ -833,6 +837,7 @@ sub _FillSelfHashWithWeatherResponseForOnecallDaily {
|
|||||||
$data->{daily}->[$i]->{weather}->[0]->{description}
|
$data->{daily}->[$i]->{weather}->[0]->{description}
|
||||||
),
|
),
|
||||||
'code' => $codes{ $data->{daily}->[$i]->{weather}->[0]->{id} },
|
'code' => $codes{ $data->{daily}->[$i]->{weather}->[0]->{id} },
|
||||||
|
'owmAPICode' => $data->{daily}->[$i]->{weather}->[0]->{id},
|
||||||
'iconAPI' => $data->{daily}->[$i]->{weather}->[0]->{icon},
|
'iconAPI' => $data->{daily}->[$i]->{weather}->[0]->{icon},
|
||||||
'pressure' => int(
|
'pressure' => int(
|
||||||
sprintf( "%.1f", $data->{daily}->[$i]->{pressure} ) + 0.5
|
sprintf( "%.1f", $data->{daily}->[$i]->{pressure} ) + 0.5
|
||||||
@ -853,7 +858,6 @@ sub _FillSelfHashWithWeatherResponseForOnecallDaily {
|
|||||||
sprintf( "%.1f", ( $data->{daily}->[$i]->{wind_deg} ) )
|
sprintf( "%.1f", ( $data->{daily}->[$i]->{wind_deg} ) )
|
||||||
),
|
),
|
||||||
'cloudCover' => $data->{daily}->[$i]->{clouds},
|
'cloudCover' => $data->{daily}->[$i]->{clouds},
|
||||||
'code' => $codes{ $data->{daily}->[$i]->{weather}->[0]->{id} },
|
|
||||||
'rain' => (
|
'rain' => (
|
||||||
$data->{daily}->[$i]->{rain} ? $data->{daily}->[$i]->{rain}
|
$data->{daily}->[$i]->{rain} ? $data->{daily}->[$i]->{rain}
|
||||||
: 0
|
: 0
|
||||||
@ -920,6 +924,7 @@ sub _FillSelfHashWithWeatherResponseForOnecallHourly {
|
|||||||
'wind_direction' => $data->{hourly}->[$i]->{wind_deg},
|
'wind_direction' => $data->{hourly}->[$i]->{wind_deg},
|
||||||
'cloudCover' => $data->{hourly}->[$i]->{clouds},
|
'cloudCover' => $data->{hourly}->[$i]->{clouds},
|
||||||
'code' => $codes{ $data->{hourly}->[$i]->{weather}->[0]->{id} },
|
'code' => $codes{ $data->{hourly}->[$i]->{weather}->[0]->{id} },
|
||||||
|
'owmAPICode' => $data->{hourly}->[$i]->{weather}->[0]->{id},
|
||||||
'iconAPI' => $data->{hourly}->[$i]->{weather}->[0]->{icon},
|
'iconAPI' => $data->{hourly}->[$i]->{weather}->[0]->{icon},
|
||||||
'rain1h' => (
|
'rain1h' => (
|
||||||
$data->{hourly}->[$i]->{rain}->{'1h'}
|
$data->{hourly}->[$i]->{rain}->{'1h'}
|
||||||
@ -951,7 +956,7 @@ sub _CallWeatherCallbackFn {
|
|||||||
|
|
||||||
# print 'Dumperausgabe: ' . Dumper $self;
|
# print 'Dumperausgabe: ' . Dumper $self;
|
||||||
### Aufruf der callbackFn
|
### Aufruf der callbackFn
|
||||||
return ::Weather_RetrieveCallbackFn( $self->{devName} );
|
return FHEM::Core::Weather::RetrieveCallbackFn( $self->{devName} );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub _ErrorHandling {
|
sub _ErrorHandling {
|
||||||
@ -977,9 +982,9 @@ sub _CreateForecastRef {
|
|||||||
{
|
{
|
||||||
lat => $self->{lat},
|
lat => $self->{lat},
|
||||||
long => $self->{long},
|
long => $self->{long},
|
||||||
apiMaintainer => 'Marko Oldenburg ('
|
apiMaintainer => $META->{author}[0],
|
||||||
. $META->{x_fhem_maintainer}[0] . ')',
|
apiVersion => version->parse( __PACKAGE__->VERSION() )->normal . '-'
|
||||||
apiVersion => version->parse( __PACKAGE__->VERSION() )->normal,
|
. $META->{release_status},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -1024,7 +1029,14 @@ sub _strftimeWrapper {
|
|||||||
"abstract": "Wetter API für OpenWeatherMap"
|
"abstract": "Wetter API für OpenWeatherMap"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": "v3.2.5",
|
"keywords": [
|
||||||
|
"fhem-mod-device",
|
||||||
|
"Weather",
|
||||||
|
"API"
|
||||||
|
],
|
||||||
|
"release_status": "stable",
|
||||||
|
"license": "GPL_2",
|
||||||
|
"version": "v3.2.7",
|
||||||
"author": [
|
"author": [
|
||||||
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
|
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
|
||||||
],
|
],
|
||||||
@ -1037,8 +1049,9 @@ sub _strftimeWrapper {
|
|||||||
"prereqs": {
|
"prereqs": {
|
||||||
"runtime": {
|
"runtime": {
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"FHEM": 5.00918799,
|
||||||
|
"HttpUtils": 5.023,
|
||||||
"FHEM::Meta": 0,
|
"FHEM::Meta": 0,
|
||||||
"HttpUtils": 0,
|
|
||||||
"strict": 0,
|
"strict": 0,
|
||||||
"warnings": 0,
|
"warnings": 0,
|
||||||
"constant": 0,
|
"constant": 0,
|
||||||
|
File diff suppressed because one or more lines are too long
1159
lib/FHEM/Core/Weather.pm
Normal file
1159
lib/FHEM/Core/Weather.pm
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user