2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

FULLY: Support Fully 1.35

git-svn-id: https://svn.fhem.de/fhem/trunk@20232 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
zap 2019-09-23 17:26:18 +00:00
parent b8b172ac08
commit 4a285ab707
2 changed files with 26 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.
# Do not insert empty lines here, update check depends on it.
- bugfix: 89_FULLY: Support Fully version 1.34
- change: 93_DbRep: comma can be shown in sqlCmdHistory, Forum: #103908
- feature: 49_SSCamSTRM: new attribute "hideAudio"
- bugfix: 73_AutoShuttersControl: change code in ShuttersCommandSet

View File

@ -1,6 +1,6 @@
##############################################################################
#
# 89_FULLY.pm 1.3
# 89_FULLY.pm 1.35
#
# $Id$
#
@ -37,7 +37,7 @@ sub FULLY_ProcessDeviceInfo ($$);
sub FULLY_UpdateReadings ($$);
sub FULLY_Ping ($$);
my $FULLY_VERSION = "1.3";
my $FULLY_VERSION = "1.35";
# Timeout for Fully requests
my $FULLY_TIMEOUT = 5;
@ -416,8 +416,17 @@ sub FULLY_Get ($@)
}
$response = '';
while ($result =~ /table-cell\">([^<]+)<\/td><td class="table-cell">([^<]+)</g) {
$response .= "$1 = $2<br/>\n";
# while ($result =~ /table-cell.>([^<]+)<\/td><td class=.table-cell.>([^<]+)</g) {
while ($result =~ /table-cell.>([^<]+)<\/td><td class=.table-cell.>(.*?)<\/td>/g) {
my ($in, $iv) = ($1, $2);
if ($iv =~ /^<a .*?>(.*?)<\/a>/) {
$iv = $1;
}
elsif ($iv =~ /(.*?)</) {
$iv = $1;
}
$iv =~ s/[ ]+$//;
$response .= "$in = $iv<br/>\n";
}
return $response;
@ -541,6 +550,7 @@ sub FULLY_ExecuteCB ($$$)
Log3 $name, 4, "FULLY: [$name] Last command executed. Processing results";
Log3 $name, 5, "FULLY: [$name] $data";
my $result = FULLY_ProcessDeviceInfo ($name, $data);
Log3 $name, 4, "FULLY: [$name] $result";
if (!FULLY_UpdateReadings ($hash, $result)) {
Log3 $name, 2, "FULLY: [$name] Command failed";
}
@ -661,13 +671,23 @@ sub FULLY_ProcessDeviceInfo ($$)
# <td class='table-cell'>Kiosk mode</td><td class='table-cell'>off</td>
my $parameters = "$name|1";
while ($result =~ /table-cell.>([^<]+)<\/td><td class=.table-cell.>([^<]+)</g) {
while ($result =~ /table-cell.>([^<]+)<\/td><td class=.table-cell.>(.*?)<\/td>/g) {
my $rn = lc($1);
my $rv = $2;
if ($rv =~ /^<a .*?>(.*?)<\/a>/) {
$rv = $1;
}
elsif ($rv =~ /(.*?)</) {
$rv = $1;
}
$rv =~ s/[ ]+$//;
$rv =~ s/\s+$//;
$rn =~ s/\:/\./g;
$rn =~ s/[^A-Za-z\d_\.-]+/_/g;
$rn =~ s/[_]+$//;
next if ($rn eq 'webview_ua');
if ($rn eq 'battery_level') {
if ($rv =~ /^([0-9]+)% \(([^\)]+)\)$/) {
$parameters .= "|$rn=$1|power=$2";