2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

FULLY: Added attribute disable

git-svn-id: https://svn.fhem.de/fhem/trunk@15968 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
zap 2018-01-23 12:36:57 +00:00
parent e71ff85cf8
commit 6b094795dd
2 changed files with 13 additions and 1 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: 89_FULLY: Added support for attribute disable
- change: 93_DbLog: V3.7.0, log verbose 5 enhanced, configuration read check - change: 93_DbLog: V3.7.0, log verbose 5 enhanced, configuration read check
added to configCheck added to configCheck
- feature: 74_Unifi: new Readings for WLAN-states, fixed Warning - feature: 74_Unifi: new Readings for WLAN-states, fixed Warning

View File

@ -55,6 +55,7 @@ sub FULLY_Initialize ($)
$hash->{parseParams} = 1; $hash->{parseParams} = 1;
$hash->{AttrList} = "pingBeforeCmd:0,1,2 pollInterval requestTimeout repeatCommand:0,1,2 " . $hash->{AttrList} = "pingBeforeCmd:0,1,2 pollInterval requestTimeout repeatCommand:0,1,2 " .
"disable:0,1 " .
$readingFnAttributes; $readingFnAttributes;
} }
@ -189,6 +190,9 @@ sub FULLY_Set ($@)
"lock" => "enabledLockedMode", "unlock" => "disableLockedMode" "lock" => "enabledLockedMode", "unlock" => "disableLockedMode"
); );
my $disable = AttrVal ($name, 'disable', 0);
return undef if ($disable);
if (exists ($cmds{$opt})) { if (exists ($cmds{$opt})) {
$response = FULLY_Execute ($hash, $cmds{$opt}, undef, 1); $response = FULLY_Execute ($hash, $cmds{$opt}, undef, 1);
} }
@ -277,6 +281,9 @@ sub FULLY_Get ($@)
my $options = "info:noArg stats:noArg update:noArg"; my $options = "info:noArg stats:noArg update:noArg";
my $response; my $response;
my $disable = AttrVal ($name, 'disable', 0);
return undef if ($disable);
if ($opt eq 'info') { if ($opt eq 'info') {
my $result = FULLY_Execute ($hash, 'deviceInfo', undef, 1); my $result = FULLY_Execute ($hash, 'deviceInfo', undef, 1);
if (!defined ($result) || $result eq '') { if (!defined ($result) || $result eq '') {
@ -373,8 +380,9 @@ sub FULLY_UpdateDeviceInfo ($)
{ {
my ($hash) = @_; my ($hash) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
my $disable = AttrVal ($name, 'disable', 0);
if (!exists ($hash->{fully}{bc})) { if (!exists ($hash->{fully}{bc}) && $disable == 0) {
$hash->{fully}{bc} = BlockingCall ("FULLY_GetDeviceInfo", $name, "FULLY_GotDeviceInfo", $hash->{fully}{bc} = BlockingCall ("FULLY_GetDeviceInfo", $name, "FULLY_GotDeviceInfo",
120, "FULLY_Abort", $hash); 120, "FULLY_Abort", $hash);
} }
@ -641,6 +649,9 @@ sub FULLY_Ping ($$)
<b>Attributes</b><br/> <b>Attributes</b><br/>
<br/> <br/>
<ul> <ul>
<li><b>disable &lt;0 | 1&gt;</b><br/>
Disable device and automatic polling.
</li><br/>
<li><b>pingBeforeCmd &lt;Count&gt;</b><br/> <li><b>pingBeforeCmd &lt;Count&gt;</b><br/>
Send <i>Count</i> ping request to tablet before executing commands. Valid values Send <i>Count</i> ping request to tablet before executing commands. Valid values
for <i>Count</i> are 0,1,2. Default is 0 (do not send ping request). for <i>Count</i> are 0,1,2. Default is 0 (do not send ping request).