change data handle for callBackFn - wichtig alle Module Updaten

This commit is contained in:
Marko Oldenburg 2019-01-09 12:55:21 +01:00
parent 49a292cc50
commit 117ebca8bc
3 changed files with 7 additions and 8 deletions

View File

@ -336,8 +336,8 @@ sub Weather_ReturnWithError($$) {
sub Weather_RetrieveCallbackFn($) {
my $hash = shift;
my $name = $hash->{NAME};
my $name = shift;
my $hash = $defs{$name};
my $responseRef = $hash->{fhem}{api}->getWeather;
if ( $responseRef->{status} eq 'ok' ) {
@ -602,8 +602,7 @@ sub Weather_Define($$) {
Weather_LanguageInitialize($hash->{LANG});
my $apistring = $api . '::Weather';
# $hash->{fhem}{api} = $api . '::Weather'->new( { hash => $hash, apikey => $hash->{APIKEY}, location => $hash->{LOCATION}, cachemaxage => 600, language => $hash->{LANG} } );
$hash->{fhem}{api} = $apistring->new( { hash => $hash, 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}, cachemaxage => 600, language => $hash->{LANG} } );
Weather_GetUpdate($hash) if($init_done);

View File

@ -66,7 +66,7 @@ sub new {
my ( $class, $argsRef ) = @_;
my $self = {
devHash => $argsRef->{hash},
devName => $argsRef->{devName},
key => ( defined( $argsRef->{apikey} ) ? $argsRef->{apikey} : 'none' ),
cachemaxage => $argsRef->{cachemaxage},
lang => $argsRef->{language},
@ -437,7 +437,7 @@ sub _CallWeatherCallbackFn($) {
my $self = shift;
# ## Aufruf der callbackFn
main::Weather_RetrieveCallbackFn( $self->{devHash} );
main::Weather_RetrieveCallbackFn( $self->{devName} );
}
sub _ErrorHandling($$) {

View File

@ -89,7 +89,7 @@ sub new {
my ( $class, $argsRef ) = @_;
my $self = {
devHash => $argsRef->{hash},
devName => $argsRef->{devName},
key => ( defined( $argsRef->{apikey} ) ? $argsRef->{apikey} : 'none' ),
cachemaxage => $argsRef->{cachemaxage},
lang => $argsRef->{language},
@ -286,7 +286,7 @@ sub _CallWeatherCallbackFn($) {
my $self = shift;
# ## Aufruf der callbackFn
main::Weather_RetrieveCallbackFn( $self->{devHash} );
main::Weather_RetrieveCallbackFn( $self->{devName} );
}
sub _ErrorHandling($$) {