mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
weblink readings going to separate module, by justme1986
http://forum.fhem.de/index.php?t=msg&th=13734&goto=91410&rid=0#msg_91410 git-svn-id: https://svn.fhem.de/fhem/trunk@3770 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2cbd58bb2a
commit
416df1e94f
@ -194,6 +194,7 @@ weblink_FwFn($$$$)
|
||||
}
|
||||
}
|
||||
$ret .= "</table></td></tr>";
|
||||
$ret .= "<tr><td><div class=\"devType\"><a style=\"color:#ff8888\" href=\"/fhem/docs/commandref.html#readingsGroup\">weblink readings is deprecated. please use readingsGroup instead.</a></div></td></tr>";
|
||||
$ret .= "</table>";
|
||||
$ret .= "</br>";
|
||||
|
||||
@ -213,7 +214,7 @@ weblink_FwFn($$$$)
|
||||
<a name="weblinkdefine"></a>
|
||||
<b>Define</b>
|
||||
<ul>
|
||||
<code>define <name> weblink [link|image|iframe|htmlCode|cmdList|readings]
|
||||
<code>define <name> weblink [link|image|iframe|htmlCode|cmdList]
|
||||
<argument></code>
|
||||
<br><br>
|
||||
This is a placeholder device used with FHEMWEB to be able to add user
|
||||
@ -226,29 +227,13 @@ weblink_FwFn($$$$)
|
||||
<code>define hr weblink htmlCode <hr></code><br>
|
||||
<code>define w_Frlink weblink htmlCode { WeatherAsHtml("w_Frankfurt") }</code><br>
|
||||
<code>define systemCommands weblink cmdList pair:Pair:set+cul2+hmPairForSec+60 restart:Restart:shutdown+restart update:UpdateCheck:update+check</code><br>
|
||||
<code>define wl_SystemStatus weblink readings sysstat *nostate *notime {{ 'load' => 'Systemauslastung', 'temperature' => 'Systemtemperatur in &deg;;C'}}</code><br>
|
||||
<code>define wlHeizung weblink readings t1:temperature t2:temperature t3:temperature *notime {{ 't1.temperature' => 'Vorlauf', 't2.temperature' => 'R&uuml;;cklauf', 't3.temperature' => 'Zirkulation'}}</code>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
Notes:
|
||||
<ul>
|
||||
<li>For cmdList <argument> consist of a list of space separated icon:label:cmd triples.</li>
|
||||
<li>For readings <argument> consist of one or more <device>[:regex] pairs,
|
||||
zero or more of the modifiers *noheading, *notime and *nostate and as the last argument an optional {} expression that should return
|
||||
a perl hash to map reading names to display names.
|
||||
<ul>
|
||||
<li><device><br>
|
||||
the device(s) from which the readings should be taken</li>
|
||||
<li>regex<br>
|
||||
an optional regex to select the readings that should be displayed.</li>
|
||||
<li>*noheading<br>don't display the table heading</li>
|
||||
<li>*notime<br>don't display the reading timestamp</li>
|
||||
<li>*nostate<br>don't include the state reading, other readings can be excluded with a regex of the form:<code>^((?!reading).)*$</code></li>
|
||||
<li>{...}<br>
|
||||
a perl expression that returns a hash that maps the reading name to the display name. keys can be either the name of the reading or <device>.<reading>. $NAME is replaced by the device name</li>
|
||||
</li>
|
||||
</ul>
|
||||
<li>The readings type is deprecated. Use <a href="#readingGroup">readingGroup</a> instead.</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
@ -100,6 +100,7 @@
|
||||
<a href="#PID">PID</a>
|
||||
<a href="#PRESENCE">PRESENCE</a>
|
||||
<a href="#PachLog">PachLog</a>
|
||||
<a href="#readingsGroup">readingsGroup</a>
|
||||
<a href="#remotecontrol">remotecontrol</a>
|
||||
<a href="#SUNRISE_EL">SUNRISE_EL</a>
|
||||
<a href="#sequence">sequence</a>
|
||||
|
@ -98,7 +98,8 @@
|
||||
<a href="#PID">PID</a>
|
||||
<a href="#PRESENCE">PRESENCE</a>
|
||||
<a href="#PachLog">PachLog</a>
|
||||
<a href="#remotecontrol">remotecontrol</a>
|
||||
<a href="#readingsGroup">readingsGroup</a>
|
||||
<a href="#remotecontrol">remotecontrol</a>
|
||||
<a href="#SUNRISE_EL">SUNRISE_EL</a>
|
||||
<a href="#sequence">sequence</a>
|
||||
<a href="#speedtest">speedtest</a>
|
||||
|
@ -33,7 +33,7 @@ FW_doUpdate()
|
||||
var devs = new Array();
|
||||
for(var i=FW_curLine; i < lines.length; i++) {
|
||||
var d = lines[i].split("<<", 3); // Complete arg
|
||||
//console.log("Got "+lines[i]);
|
||||
console.log("Got "+lines[i]);
|
||||
if(d.length != 3)
|
||||
continue;
|
||||
var elArr = document.querySelectorAll("[informId='"+d[0]+"']");
|
||||
@ -48,7 +48,7 @@ FW_doUpdate()
|
||||
|
||||
} else {
|
||||
el.innerHTML=d[2];
|
||||
if(d[0].indexOf("-") >= 0) // readings / timestamps
|
||||
if(d[0].match(/-ts$/)) // timestamps
|
||||
el.setAttribute('class', 'changed');
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user