2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

98_openweathermap - added set command "clear" to delete readings.

git-svn-id: https://svn.fhem.de/fhem/trunk@5294 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2014-03-22 16:47:27 +00:00
parent fd453851e6
commit f42e870f8f
2 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,8 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- SVN - SVN
- change: MAX: interpret SetTemperature command from WT to HT - change: openweathermap: added set command „clear“
- change: MAX: interpret SetTemperature command from WT to HT
- feature: MAX: retry packets 3 times if missing an ack - feature: MAX: retry packets 3 times if missing an ack
- feature: new module 98_cloneDummy.pm added (Joachim) - feature: new module 98_cloneDummy.pm added (Joachim)
- feature: STACKABLE_CC (busware.de device for the RPi) added - feature: STACKABLE_CC (busware.de device for the RPi) added

View File

@ -61,6 +61,9 @@
# 2014-02-04 added: shutdownFn # 2014-02-04 added: shutdownFn
# #
# 2014-02-14 modi: changed Loglevel from 3 to 4 where possible # 2014-02-14 modi: changed Loglevel from 3 to 4 where possible
#
# 2014-03-22 added: added set command 'clear'
#
package main; package main;
@ -113,7 +116,7 @@ sub OWO_Shutdown($) {
sub OWO_Set($@){ sub OWO_Set($@){
my ($hash, @a) = @_; my ($hash, @a) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
my $usage = "Unknown argument, choose one of stationById stationByGeo stationByName send:noArg"; my $usage = "Unknown argument, choose one of clear:noArg stationById stationByGeo stationByName send:noArg";
my $response; my $response;
return "No Argument given" if(!defined($a[1])); return "No Argument given" if(!defined($a[1]));
@ -126,6 +129,13 @@ sub OWO_Set($@){
given($cmd){ given($cmd){
when("?") { return $usage; } when("?") { return $usage; }
when("clear"){
CommandDeleteReading(undef, "$name _.*");
CommandDeleteReading(undef, "$name c_.*");
CommandDeleteReading(undef, "$name g_.*");
return;
}
when("send"){ when("send"){
OWO_GetStatus($hash,1); OWO_GetStatus($hash,1);
return; return;