2
0
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:
rudolfkoenig 2013-08-23 13:29:58 +00:00
parent 2cbd58bb2a
commit 416df1e94f
4 changed files with 8 additions and 21 deletions

View File

@ -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 &lt;name&gt; weblink [link|image|iframe|htmlCode|cmdList|readings]
<code>define &lt;name&gt; weblink [link|image|iframe|htmlCode|cmdList]
&lt;argument&gt;</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 &lt;hr&gt</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 &amp;deg;;C'}}</code><br>
<code>define wlHeizung weblink readings t1:temperature t2:temperature t3:temperature *notime {{ 't1.temperature' => 'Vorlauf', 't2.temperature' => 'R&amp;uuml;;cklauf', 't3.temperature' => 'Zirkulation'}}</code>
</ul>
<br>
Notes:
<ul>
<li>For cmdList &lt;argument&gt; consist of a list of space separated icon:label:cmd triples.</li>
<li>For readings &lt;argument&gt; consist of one or more &lt;device&gt;[: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>&lt;device&gt;<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 &lt;device&gt;.&lt;reading&gt;. $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>

View File

@ -100,6 +100,7 @@
<a href="#PID">PID</a> &nbsp;
<a href="#PRESENCE">PRESENCE</a> &nbsp;
<a href="#PachLog">PachLog</a> &nbsp;
<a href="#readingsGroup">readingsGroup</a> &nbsp;
<a href="#remotecontrol">remotecontrol</a> &nbsp;
<a href="#SUNRISE_EL">SUNRISE_EL</a> &nbsp;
<a href="#sequence">sequence</a> &nbsp;

View File

@ -98,6 +98,7 @@
<a href="#PID">PID</a> &nbsp;
<a href="#PRESENCE">PRESENCE</a> &nbsp;
<a href="#PachLog">PachLog</a> &nbsp;
<a href="#readingsGroup">readingsGroup</a> &nbsp;
<a href="#remotecontrol">remotecontrol</a> &nbsp;
<a href="#SUNRISE_EL">SUNRISE_EL</a> &nbsp;
<a href="#sequence">sequence</a> &nbsp;

View File

@ -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');
}