FULLY: New command set foreground

git-svn-id: https://svn.fhem.de/fhem/trunk@20386 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
zap
2019-10-20 09:37:18 +00:00
parent 30940c8b75
commit a950189313
2 changed files with 14 additions and 8 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: New command set foreground
- feature: 73_DoorBird: Videos on Events - feature: 73_DoorBird: Videos on Events
- change: 70_SolarEdgeAPI: new attributes to control interval, debug features - change: 70_SolarEdgeAPI: new attributes to control interval, debug features
- change: 93_DbRep: change SQL of delDoublets due to incompatible change of - change: 93_DbRep: change SQL of delDoublets due to incompatible change of

View File

@@ -1,6 +1,6 @@
############################################################################## ##############################################################################
# #
# 89_FULLY.pm 1.35 # 89_FULLY.pm 1.40
# #
# $Id$ # $Id$
# #
@@ -37,7 +37,7 @@ sub FULLY_ProcessDeviceInfo ($$);
sub FULLY_UpdateReadings ($$); sub FULLY_UpdateReadings ($$);
sub FULLY_Ping ($$); sub FULLY_Ping ($$);
my $FULLY_VERSION = "1.35"; my $FULLY_VERSION = "1.40";
# Timeout for Fully requests # Timeout for Fully requests
my $FULLY_TIMEOUT = 5; my $FULLY_TIMEOUT = 5;
@@ -237,10 +237,10 @@ sub FULLY_Set ($@)
my ($hash, $a, $h) = @_; my ($hash, $a, $h) = @_;
my $name = shift @$a; my $name = shift @$a;
my $opt = shift @$a; my $opt = shift @$a;
my $options = "brightness photo:noArg clearCache:noArg exit:noArg lock:noArg motionDetection:on,off ". my $options = "brightness photo:noArg clearCache:noArg exit:noArg foreground:noArg lock:noArg ".
"off:noArg on:noArg on-for-timer playSound restart:noArg screenOffTimer screenSaver:start,stop ". "motionDetection:on,off off:noArg on:noArg on-for-timer playSound restart:noArg screenOffTimer ".
"screenSaverTimer screenSaverURL speak startURL stopSound:noArg unlock:noArg url ". "screenSaver:start,stop screenSaverTimer screenSaverURL speak startURL stopSound:noArg ".
"volume"; "unlock:noArg url volume";
# Fully commands without argument # Fully commands without argument
my %cmds = ( my %cmds = (
@@ -250,7 +250,8 @@ sub FULLY_Set ($@)
"restart" => "restartApp", "restart" => "restartApp",
"on" => "screenOn", "off" => "screenOff", "on" => "screenOn", "off" => "screenOff",
"lock" => "enabledLockedMode", "unlock" => "disableLockedMode", "lock" => "enabledLockedMode", "unlock" => "disableLockedMode",
"stopSound" => "stopSound" "stopSound" => "stopSound",
"foreground" => "toForeground"
); );
my @c = (); my @c = ();
@@ -416,7 +417,6 @@ sub FULLY_Get ($@)
} }
$response = ''; $response = '';
# while ($result =~ /table-cell.>([^<]+)<\/td><td class=.table-cell.>([^<]+)</g) {
while ($result =~ /table-cell.>([^<]+)<\/td><td class=.table-cell.>(.*?)<\/td>/g) { while ($result =~ /table-cell.>([^<]+)<\/td><td class=.table-cell.>(.*?)<\/td>/g) {
my ($in, $iv) = ($1, $2); my ($in, $iv) = ($1, $2);
if ($iv =~ /^<a .*?>(.*?)<\/a>/) { if ($iv =~ /^<a .*?>(.*?)<\/a>/) {
@@ -597,6 +597,7 @@ sub FULLY_ExecuteCB ($$$)
HttpUtils_NonblockingGet ($reqpar); HttpUtils_NonblockingGet ($reqpar);
} }
else { else {
readingsSingleUpdate ($hash, "execState", "error", 1);
Log3 $name, 2, "FULLY: [$name] Error during request. $err"; Log3 $name, 2, "FULLY: [$name] Error during request. $err";
} }
} }
@@ -747,6 +748,7 @@ sub FULLY_UpdateReadings ($$)
my ($rn, $rv) = split ('=', $parval); my ($rn, $rv) = split ('=', $parval);
readingsBulkUpdate ($hash, $rn, $rv); readingsBulkUpdate ($hash, $rn, $rv);
} }
readingsBulkUpdate ($hash, "execState", "success");
readingsEndUpdate ($hash, 1); readingsEndUpdate ($hash, 1);
return $rc; return $rc;
@@ -826,6 +828,9 @@ sub FULLY_Ping ($$)
<li><b>set &lt;name&gt; exit</b><br/> <li><b>set &lt;name&gt; exit</b><br/>
Terminate Fully. Terminate Fully.
</li><br/> </li><br/>
<li><b>set &lt;name&gt; foreground</b><br/>
Bring fully app to foreground.
</li><br/>
<li><b>set &lt;name&gt; motionDetection { on | off }</b><br/> <li><b>set &lt;name&gt; motionDetection { on | off }</b><br/>
Turn motion detection by camera on or off. Turn motion detection by camera on or off.
</li><br/> </li><br/>