add setter locationTemp to change location temporary

This commit is contained in:
Marko Oldenburg
2019-09-09 17:35:35 +02:00
parent 150581147f
commit ec08d0ec53
3 changed files with 52 additions and 7 deletions

View File

@ -571,8 +571,19 @@ sub Weather_Set($@) {
Weather_GetUpdate($hash);
return undef;
}
elsif ( ( @a == 3 ) && ( $a[1] eq "newLocation" ) ) {
if ( $hash->{API} eq 'DarkSkyAPI'
or $hash->{API} eq 'OpenWeatherMapAPI' )
{
$hash->{fhem}->{api}->setLocation((split(':',$a[2]))[0],(split(':',$a[2]))[1]);
Weather_DisarmTimer($hash);
Weather_GetUpdate($hash);
return undef;
}
else { return 'this API is not ' . $a[1] .' supported' }
}
else {
return "Unknown argument $cmd, choose one of update:noArg";
return "Unknown argument $cmd, choose one of update:noArg newLocation";
}
}