2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

59_WUup: add set-command "update"

git-svn-id: https://svn.fhem.de/fhem/trunk@15290 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mahowi 2017-10-19 15:24:44 +00:00
parent dcbd85eb18
commit 8e52ad801d
2 changed files with 20 additions and 5 deletions

View File

@ -1,5 +1,6 @@
# 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.
- feature: 59_WUup: add set-command "update"
- bugfix: 46_TeslaPowerwall2AC: fix get data internal timer bug - bugfix: 46_TeslaPowerwall2AC: fix get data internal timer bug
- bugfix: 93_Log2Syslog: typo in commandref - bugfix: 93_Log2Syslog: typo in commandref
- feature: global dnsHostsFile attribute added (Forum #78025) - feature: global dnsHostsFile attribute added (Forum #78025)

View File

@ -32,12 +32,13 @@ use Time::HiRes qw(gettimeofday);
use HttpUtils; use HttpUtils;
use UConv; use UConv;
my $version = "0.9.4"; my $version = "0.9.5";
# Declare functions # Declare functions
sub WUup_Initialize($); sub WUup_Initialize($);
sub WUup_Define($$$); sub WUup_Define($$$);
sub WUup_Undef($$); sub WUup_Undef($$);
sub WUup_Set($@);
sub WUup_Attr(@); sub WUup_Attr(@);
sub WUup_stateRequestTimer($); sub WUup_stateRequestTimer($);
sub WUup_send($); sub WUup_send($);
@ -54,6 +55,7 @@ sub WUup_Initialize($) {
$hash->{DefFn} = "WUup_Define"; $hash->{DefFn} = "WUup_Define";
$hash->{UndefFn} = "WUup_Undef"; $hash->{UndefFn} = "WUup_Undef";
$hash->{SetFn} = "WUup_Set";
$hash->{AttrFn} = "WUup_Attr"; $hash->{AttrFn} = "WUup_Attr";
$hash->{AttrList} = $hash->{AttrList} =
"disable:1 " "disable:1 "
@ -114,6 +116,19 @@ sub WUup_Undef($$) {
return 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(@) { sub WUup_Attr(@) {
my ( $cmd, $name, $attrName, $attrVal ) = @_; my ( $cmd, $name, $attrName, $attrVal ) = @_;
my $hash = $defs{$name}; my $hash = $defs{$name};
@ -327,6 +342,7 @@ sub WUup_receive($) {
# windgustdir_10m (thanks to Aeroschmelz for reminding me) # windgustdir_10m (thanks to Aeroschmelz for reminding me)
# timeout raised to 6s, fixed state error (thanks to mumpitzstuff) # timeout raised to 6s, fixed state error (thanks to mumpitzstuff)
# 2017-10-16 fixed attributes # 2017-10-16 fixed attributes
# 2017-10-19 added set-command "update"
# #
################################################################################ ################################################################################
@ -357,8 +373,7 @@ sub WUup_receive($) {
<a name="WUupset"></a> <a name="WUupset"></a>
<b>Set-Commands</b><br/> <b>Set-Commands</b><br/>
<ul> <ul>
<br/> <li><b>update</b> - send data to Weather Underground</li>
- not implemented -<br/>
</ul> </ul>
<br/><br/> <br/><br/>
@ -457,8 +472,7 @@ sub WUup_receive($) {
<a name="WUupset"></a> <a name="WUupset"></a>
<b>Set-Befehle</b><br/> <b>Set-Befehle</b><br/>
<ul> <ul>
<br/> <li><b>update</b> - sende Daten an Weather Underground</li>
- keine -<br/>
</ul> </ul>
<br/><br/> <br/><br/>