From f42e870f8fbfbcbb4229a55d824e46070536e9a3 Mon Sep 17 00:00:00 2001 From: betateilchen <> Date: Sat, 22 Mar 2014 16:47:27 +0000 Subject: [PATCH] 98_openweathermap - added set command "clear" to delete readings. git-svn-id: https://svn.fhem.de/fhem/trunk@5294 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 3 ++- fhem/FHEM/98_openweathermap.pm | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 91822074c..bab34cda0 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,7 +1,8 @@ # 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. - 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: new module 98_cloneDummy.pm added (Joachim) - feature: STACKABLE_CC (busware.de device for the RPi) added diff --git a/fhem/FHEM/98_openweathermap.pm b/fhem/FHEM/98_openweathermap.pm index cdb281864..5bce90eee 100644 --- a/fhem/FHEM/98_openweathermap.pm +++ b/fhem/FHEM/98_openweathermap.pm @@ -61,6 +61,9 @@ # 2014-02-04 added: shutdownFn # # 2014-02-14 modi: changed Loglevel from 3 to 4 where possible +# +# 2014-03-22 added: added set command 'clear' +# package main; @@ -113,7 +116,7 @@ sub OWO_Shutdown($) { sub OWO_Set($@){ my ($hash, @a) = @_; 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; return "No Argument given" if(!defined($a[1])); @@ -126,6 +129,13 @@ sub OWO_Set($@){ given($cmd){ when("?") { return $usage; } + when("clear"){ + CommandDeleteReading(undef, "$name _.*"); + CommandDeleteReading(undef, "$name c_.*"); + CommandDeleteReading(undef, "$name g_.*"); + return; + } + when("send"){ OWO_GetStatus($hash,1); return;