change hashRef for parameter from cachemaxage to apioptions

This commit is contained in:
Marko Oldenburg 2019-01-10 10:55:03 +01:00
parent 5b95ea31e4
commit 1a9d7ad760
4 changed files with 35 additions and 4 deletions

View File

@ -596,7 +596,7 @@ sub Weather_Define($$) {
Weather_LanguageInitialize($hash->{LANG});
my $apistring = $api . '::Weather';
$hash->{fhem}->{api} = $apistring->new( { devName => $hash->{NAME}, apikey => $hash->{APIKEY}, location => $hash->{LOCATION}, cachemaxage => 600, language => $hash->{LANG} } );
$hash->{fhem}->{api} = $apistring->new( { devName => $hash->{NAME}, apikey => $hash->{APIKEY}, location => $hash->{LOCATION}, apioptions => $hash->{APIOPTIONS}, language => $hash->{LANG} } );
Weather_GetUpdate($hash) if($init_done);

View File

@ -68,7 +68,7 @@ sub new {
my $self = {
devName => $argsRef->{devName},
key => ( defined( $argsRef->{apikey} ) ? $argsRef->{apikey} : 'none' ),
cachemaxage => $argsRef->{cachemaxage},
cachemaxage => ( (split(':',$argsRef->{apioptions}))[0] eq 'cachemaxage' ? (split(':',$argsRef->{apioptions}))[1] : 900 ),
lang => $argsRef->{language},
lat => ( split( ',', $argsRef->{location} ) )[0],
long => ( split( ',', $argsRef->{location} ) )[1],

File diff suppressed because one or more lines are too long

View File

@ -116,7 +116,7 @@ sub new {
my $self = {
devName => $argsRef->{devName},
key => ( defined( $argsRef->{apikey} ) ? $argsRef->{apikey} : 'none' ),
cachemaxage => $argsRef->{cachemaxage},
cachemaxage => ( (split(':',$argsRef->{apioptions}))[0] eq 'cachemaxage' ? (split(':',$argsRef->{apioptions}))[1] : 900 ),
lang => $argsRef->{language},
lat => ( split( ',', $argsRef->{location} ) )[0],
long => ( split( ',', $argsRef->{location} ) )[1],