Skip to content
Permalink
Browse files

Update cycle_upnpevents.php

  • Loading branch information...
tarasfrompir committed Apr 17, 2019
1 parent 02b1fcd commit f0d4529cb67fbbb3a97e324723df0aaa59de9ec4
Showing with 4 additions and 2 deletions.
  1. +4 −2 scripts/cycle_upnpevents.php
@@ -74,9 +74,11 @@
$last_change = $doc->getElementsByTagName('LastChange') [0];
$value = $last_change->nodeValue;
if ($value) {
//DebMes ('value - '.$value);
$value = preg_replace('/<([[:word:]]+) val="(\d*)"/', '<$1>$2</$1', $value);
$value = preg_replace('/<([[:word:]]+) [[:word:]]+="([[:word:]]+)" val="(\d*)"\//', '<$1$2>$3</$1$2', $value);
$value = preg_replace('/<([[:word:]]+) val="(\d+:\d+:\d+)"\//', '<$1>$2</$1', $value);
$value = preg_replace('/<([[:word:]]+) val="([[:word:]]+)"\/>/', '<$1>$2</$1>', $value);
$value = preg_replace('/<([[:word:]]+) val="([^"]+)"\/>/', '<$1>$2</$1>', $value);
$value = str_replace("></InstanceID>", ">", $value);
DebMes ('value - '.$value);
@@ -113,7 +115,7 @@
if ($value=='NOT_IMPLEMENTED') {
$value='';
}
if ($field AND $value) {
if ($field AND $value!='') {
setGlobal($name_device . '.' . $f_name, $value);
}
}

0 comments on commit f0d4529

Please sign in to comment.
You can’t perform that action at this time.