diff --git a/fhem/CHANGED b/fhem/CHANGED index 681e65835..73bd8becb 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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. + - feature: 59_WUup: add set-command "update" - bugfix: 46_TeslaPowerwall2AC: fix get data internal timer bug - bugfix: 93_Log2Syslog: typo in commandref - feature: global dnsHostsFile attribute added (Forum #78025) diff --git a/fhem/FHEM/59_WUup.pm b/fhem/FHEM/59_WUup.pm index e4b8410d9..d59e01722 100644 --- a/fhem/FHEM/59_WUup.pm +++ b/fhem/FHEM/59_WUup.pm @@ -32,12 +32,13 @@ use Time::HiRes qw(gettimeofday); use HttpUtils; use UConv; -my $version = "0.9.4"; +my $version = "0.9.5"; # Declare functions sub WUup_Initialize($); sub WUup_Define($$$); sub WUup_Undef($$); +sub WUup_Set($@); sub WUup_Attr(@); sub WUup_stateRequestTimer($); sub WUup_send($); @@ -54,6 +55,7 @@ sub WUup_Initialize($) { $hash->{DefFn} = "WUup_Define"; $hash->{UndefFn} = "WUup_Undef"; + $hash->{SetFn} = "WUup_Set"; $hash->{AttrFn} = "WUup_Attr"; $hash->{AttrList} = "disable:1 " @@ -114,6 +116,19 @@ sub WUup_Undef($$) { return undef; } +sub WUup_Set($@) { + my ( $hash, $name, $cmd, @args ) = @_; + + return "\"set $name\" needs at least one argument" unless ( defined($cmd) ); + + if ( $cmd eq "update" ) { + WUup_stateRequestTimer($hash); + } + else { + return "Unknown argument $cmd, choose one of update:noArg"; + } +} + sub WUup_Attr(@) { my ( $cmd, $name, $attrName, $attrVal ) = @_; my $hash = $defs{$name}; @@ -327,6 +342,7 @@ sub WUup_receive($) { # windgustdir_10m (thanks to Aeroschmelz for reminding me) # timeout raised to 6s, fixed state error (thanks to mumpitzstuff) # 2017-10-16 fixed attributes +# 2017-10-19 added set-command "update" # ################################################################################ @@ -357,8 +373,7 @@ sub WUup_receive($) { Set-Commands


@@ -457,8 +472,7 @@ sub WUup_receive($) { Set-Befehle