2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-03 13:45:36 +00:00

HTML check (with Safari Web Inspactor)

git-svn-id: https://svn.fhem.de/fhem/trunk@754 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2010-11-07 11:39:49 +00:00
parent d7eb06a37f
commit c718b542b4
8 changed files with 70 additions and 61 deletions

View File

@ -8,6 +8,7 @@
- feature: decode CUL uptime - feature: decode CUL uptime
- feature: USB doc changes, FHZ initFS20_02/stopHMS parameters by Andreas. - feature: USB doc changes, FHZ initFS20_02/stopHMS parameters by Andreas.
- feature: CUL_HM (experimental) for HomeMatic devices. - feature: CUL_HM (experimental) for HomeMatic devices.
- bugfix: HTML-Syntax check of the pgm2 output and documents (*.html)
- feature: added date alias for FHT80b (Boris) - feature: added date alias for FHT80b (Boris)
- 2010-08-15 (5.0) - 2010-08-15 (5.0)

View File

@ -48,7 +48,7 @@
Skip this section if you installed fhem via the Debian package.<br><br> Skip this section if you installed fhem via the Debian package.<br><br>
First install the Device::SerialPort (or Win32::SerialPort) perl module First install the Device::SerialPort (or Win32::SerialPort) perl module
with the command <code>"sudo cpan Device::SerialPort"</code></br> with the command <code>"sudo cpan Device::SerialPort"</code><br>
The default configuration will install fhem into /usr/bin, The default configuration will install fhem into /usr/bin,
/usr/share/fhem and /var/log/fhem and /etc/fhem.cfg. Edit the Makefile to /usr/share/fhem and /var/log/fhem and /etc/fhem.cfg. Edit the Makefile to
change this. change this.
@ -94,7 +94,7 @@
<br><br> <br><br>
<b>Note:</b> Don't forget to type "save" in the "Fhem cmd" input field of <b>Note:</b> Don't forget to type "save" in the "Fhem cmd" input field of
the browser after defining a device or setting its attribute. Otherwise the browser after defining a device or setting its attribute. Otherwise
the changes will disappear after the next start.</br><br> </ul> the changes will disappear after the next start.<br><br> </ul>
<a name="autocreate"></a> <a name="autocreate"></a>
<h3>Automatically creating transmitters</h3> <h3>Automatically creating transmitters</h3>
@ -136,7 +136,6 @@
<a href="commandref.html#model">Here</a> is a complete list of FS20 <a href="commandref.html#model">Here</a> is a complete list of FS20
models.<br> For other device-types similar messages should appear. models.<br> For other device-types similar messages should appear.
</ul> </ul>
</ul>
<a name="FS20rx"></a> <a name="FS20rx"></a>
<h3>Configuring FS20 receivers</h3> <h3>Configuring FS20 receivers</h3>
@ -370,5 +369,5 @@
</ul> </ul>
</div> </div>
<body> </body>
</html> </html>

View File

@ -1954,15 +1954,16 @@ A line ending with \ will be concatenated with the next one, so long lines
<li>fhtbuf<br> <li>fhtbuf<br>
CUL has a message buffer for the FHT. If the buffer is full, then newly CUL has a message buffer for the FHT. If the buffer is full, then newly
issued commands will be dropped, if the attribute <a issued commands will be dropped, if the attribute <a
href="#culfhtsoftbuffer">fhtsoftbuffer</a> is not set. Instead, a "EOB" message is issued. href="#culfhtsoftbuffer">fhtsoftbuffer</a> is not set.
Instead, a "EOB" message is issued.
<code>fhtbuf</code> returns the free memory in this buffer (in hex), <code>fhtbuf</code> returns the free memory in this buffer (in hex),
an empty buffer in the CUL is 40 (64 bytes). an empty buffer in the CUL-V2 is 74 bytes, in CUL-V3/CUN 200 Bytes.
A message occupies 3 + 2x(number of FHT commands) bytes, A message occupies 3 + 2x(number of FHT commands) bytes,
this is the second reason why sending multiple FHT commands with one this is the second reason why sending multiple FHT commands with one
<a href="#set">set</a> is a good idea. The first reason is, that <a href="#set">set</a> is a good idea. The first reason is, that
these FHT commands are sent at once to the FHT. these FHT commands are sent at once to the FHT.
</li>
</li> <br> </li> <br>
<li>ccconf<br> <li>ccconf<br>
Read some CUL radio-chip (cc1101) registers (frequency, bandwidth, etc), Read some CUL radio-chip (cc1101) registers (frequency, bandwidth, etc),
and display them in human readable form. and display them in human readable form.
@ -2278,7 +2279,6 @@ A line ending with \ will be concatenated with the next one, so long lines
The rest of the attributes is the same as for the <a href="#CUL">CUL</a>.</ul><br> The rest of the attributes is the same as for the <a href="#CUL">CUL</a>.</ul><br>
</ul> </ul>
<br> <br>
</ul>
<a name="EM"></a> <a name="EM"></a>
@ -2651,7 +2651,6 @@ A line ending with \ will be concatenated with the next one, so long lines
</ul> </ul>
<br> <br>
</ul>
<a name="KS300"></a> <a name="KS300"></a>
<h3>KS300</h3> <h3>KS300</h3>
@ -4935,7 +4934,7 @@ Terminating
site on the iPhone in Safari, try to add it to the home-screen. site on the iPhone in Safari, try to add it to the home-screen.
</li><br> </li><br>
</li></ul> </ul>
</ul> </ul>
@ -5299,7 +5298,7 @@ Terminating
href="#trigger">trigger</a> command to execute the macro. href="#trigger">trigger</a> command to execute the macro.
E.g.<br> E.g.<br>
<code>fhem> define MyMacro notify MyMacro { Log 1, "Hello"}</code><br> <code>fhem> define MyMacro notify MyMacro { Log 1, "Hello"}</code><br>
<code>fhem> trigger MyMacro</pre></code><br> <code>fhem> trigger MyMacro</code><br>
</ul> </ul>
@ -5855,10 +5854,10 @@ isday</pre>
in an interactive mode, meaning that the FHEM-Loop will be block as long as the graphics are rendered. in an interactive mode, meaning that the FHEM-Loop will be block as long as the graphics are rendered.
If you want to use multiprocessing, set the RENDERER and multiprocessing to on and the If you want to use multiprocessing, set the RENDERER and multiprocessing to on and the
weblink-graphics will be rendered in the background. weblink-graphics will be rendered in the background.
</li><br></li> </ul> </li><br>
</ul>
</ul> </ul>
</ul>
<a name="PachLog"></a> <a name="PachLog"></a>
@ -5941,22 +5940,23 @@ isday</pre>
<br><br> <br><br>
Example: Example:
<ul><br> <ul><br>
<code>dumpdef TEST</code><br><br> <pre>dumpdef TEST
<ul><code>CALLER => main: /opt/fhz/FHEM/01_FHEMWEB.pm LINE: 194 SUB: main::FW_AnswerCall<br>
SUB-NAME: main::Commanddumpdef<br> CALLER => main: /opt/fhz/FHEM/01_FHEMWEB.pm LINE: 194 SUB: main::FW_AnswerCall
DUMP-DEVICE: TEST <br> SUB-NAME: main::Commanddumpdef
$VAR1 = {<ul><code> DUMP-DEVICE: TEST
'IODev' => {},<br> $VAR1 = {
'NAME' => 'TEST',<br> 'IODev' => {},
'NR' => 64,<br> 'NAME' => 'TEST',
'STATE' => '???',<br> 'NR' => 64,
'TYPE' => 'dummy'<br> 'STATE' => '???',
};</code></ul> 'TYPE' => 'dummy'
<code>DUMP-DEVICE-ATTR<br> };
$VAR1 = {</code><ul><code> DUMP-DEVICE-ATTR
'room' => 'DEF_DUMMY,GRP.TEST'<br> $VAR1 = {
};</ul></code> 'room' => 'DEF_DUMMY,GRP.TEST'
</code></ul><br> };
</pre>
</ul> </ul>
</ul> </ul>

View File

@ -184,7 +184,7 @@
<h4>3. I switched on a FS20 device directly (without the remote), but <h4>3. I switched on a FS20 device directly (without the remote), but
the fhem.pl did not noticed it.<br>Is it a bug?</h4> the fhem.pl did not noticed it.<br>Is it a bug?</h4>
<ul> <ul>
The protocol used by the FS20 family is quite simple: it is </b>not</b> The protocol used by the FS20 family is quite simple: it is <b>not</b>
encrypted in any way, and there is no feedback to the sender. So if you encrypted in any way, and there is no feedback to the sender. So if you
push any buttons on a pure receiver, no radio waves will be sent out, and push any buttons on a pure receiver, no radio waves will be sent out, and
the FHZ1000 won't notice anything. The FHZ1000PC does not even know if the FHZ1000 won't notice anything. The FHZ1000PC does not even know if
@ -274,7 +274,7 @@ that 255 should be the default?</h4>
rain-cup is 13.9 cm, the area ca 151.75 cm<sup>2</sup>, which rain-cup is 13.9 cm, the area ca 151.75 cm<sup>2</sup>, which
is ca 1/65.9 m<sup>2</sup>. is ca 1/65.9 m<sup>2</sup>.
The 0.5 liter corresponds to 32.95 liter per m<sup>2</sup>. 130 ticks The 0.5 liter corresponds to 32.95 liter per m<sup>2</sup>. 130 ticks
correspond to 32.95 l/m<sum>2</sup> -> 1 tick is ca 253 ml. I estimate correspond to 32.95 l/m<sup>2</sup> -> 1 tick is ca 253 ml. I estimate
the error margin to +/- 2%<br> the error margin to +/- 2%<br>
You are welcome to do your own experiments, I am interested in the results. You are welcome to do your own experiments, I am interested in the results.

View File

@ -68,7 +68,13 @@
fhem-=VERS=.deb</a> fhem-=VERS=.deb</a>
<br> <br>
See the <a href="CHANGED">CHANGED</a> file for current changes. See the <a href="CHANGED">CHANGED</a> file for current changes.
<br>
Nightly CVS version:
<a href="http://www.dhs-computertechnik.de/downloads/fhem-cvs.tgz">
http://www.dhs-computertechnik.de/downloads/fhem-cvs.tgz</a>
<br><br> <br><br>
Please fill out our <a href="http://www.koeniglich.de/tinc?key=Erq0O0LU&formname=FHEM_used_modules">survey</a>, Please fill out our <a href="http://www.koeniglich.de/tinc?key=Erq0O0LU&formname=FHEM_used_modules">survey</a>,
as we'd like to know which FHEM modules are in use. Here are the <a as we'd like to know which FHEM modules are in use. Here are the <a
href="surveyresults.html">results</a>. href="surveyresults.html">results</a>.
@ -327,9 +333,9 @@
You don't have to install all of them, one is probably more than You don't have to install all of them, one is probably more than
enough :-).<br> enough :-).<br>
The numbering has historical reasons: not actively maintained versions The numbering has historical reasons: not actively maintained versions
are not described here.</br> are not described here.<br>
<b>Important:</b> Make sure you add some protection (.htaccess, etc) <b>Important:</b> Make sure you add some protection (.htaccess, etc)
else everybody will be able to set your devices.</br> else everybody will be able to set your devices.<br>
</div> </div>
<h3>Web frontend 2 (webfrontend/pgm2)</h3> <h3>Web frontend 2 (webfrontend/pgm2)</h3>

View File

@ -477,8 +477,10 @@ FW_makeTable($$$$$$$$)
my @al = map { s/[:;].*//;$_ } split(" ", $clist); my @al = map { s/[:;].*//;$_ } split(" ", $clist);
pO "<td>" . FW_select("arg.$ccmd$d",\@al,undef) . "</td>"; pO "<td>" . FW_select("arg.$ccmd$d",\@al,undef) . "</td>";
pO "<td>" . FW_textfield("val.$ccmd$d", 20) . "</td>"; pO "<td>" . FW_textfield("val.$ccmd$d", 20) . "</td>";
pO "<td>" . FW_submit("cmd.$ccmd$d", $ccmd) . "</td>"; pO "<td>" .
pO FW_hidden("dev.$ccmd$d", $d); FW_submit("cmd.$ccmd$d", $ccmd) .
FW_hidden("dev.$ccmd$d", $d) .
"</td>";
pO "</tr>"; pO "</tr>";
} }
@ -489,7 +491,8 @@ FW_makeTable($$$$$$$$)
pF " <tr class=\"%s\">", $row?"odd":"even"; pF " <tr class=\"%s\">", $row?"odd":"even";
$row = ($row+1)%2; $row = ($row+1)%2;
if($makelink && $__reldoc) { if($makelink && $__reldoc) {
pO "<td><a href=\"$__reldoc#$v\">$v</a></td>"; # no pH, want to open extra browser # no pH, want to open extra browser
pO "<td><a href=\"$__reldoc#$v\">$v</a></td>";
} else { } else {
pO "<td>$v</td>"; pO "<td>$v</td>";
} }
@ -810,12 +813,14 @@ FW_showRoom()
my @tv = map { ($_.".0", $_+0.5) } (5..30); my @tv = map { ($_.".0", $_+0.5) } (5..30);
shift(@tv); # 5.0 is not valid shift(@tv); # 5.0 is not valid
$v = int($v*20)/$v if($v =~ m/^[0-9].$/); $v = int($v*20)/$v if($v =~ m/^[0-9].$/);
pO FW_hidden("arg.$d", "desired-temp");
pO FW_hidden("dev.$d", $d);
pO "<td>" . pO "<td>" .
FW_hidden("arg.$d", "desired-temp") .
FW_hidden("dev.$d", $d) .
FW_select("val.$d", \@tv, ReadingsVal($d, "desired-temp", $v)) . FW_select("val.$d", \@tv, ReadingsVal($d, "desired-temp", $v)) .
FW_submit("cmd.$d", "set") . "</td>"; FW_submit("cmd.$d", "set") .
"</td>";
} elsif($type eq "FileLog") { } elsif($type eq "FileLog") {
@ -838,7 +843,9 @@ FW_showRoom()
} elsif($type eq "weblink") { } elsif($type eq "weblink") {
pO "<td>";
FW_showWeblink($d, $defs{$d}{LINK}, $defs{$d}{WLTYPE}); FW_showWeblink($d, $defs{$d}{LINK}, $defs{$d}{WLTYPE});
pO "</td>";
} else { } else {
@ -1526,7 +1533,7 @@ FW_showWeblink($$$)
} elsif($t eq "fileplot") { } elsif($t eq "fileplot") {
my @va = split(":", $v, 3); my @va = split(":", $v, 3);
if(@va != 3 || !$defs{$va[0]} || !$defs{$va[0]}{currentlogfile}) { if(@va != 3 || !$defs{$va[0]} || !$defs{$va[0]}{currentlogfile}) {
pO "<td>Broken definition: $v</a></td>"; pO "<td>Broken definition: $v</td>";
} else { } else {
if($va[2] eq "CURRENT") { if($va[2] eq "CURRENT") {
$defs{$va[0]}{currentlogfile} =~ m,([^/]*)$,; $defs{$va[0]}{currentlogfile} =~ m,([^/]*)$,;

View File

@ -53,11 +53,10 @@ SVG_render($$$$$$$)
my ($w, $h) = ($ow-2*$x, $oh-2*$y); # Rect size my ($w, $h) = ($ow-2*$x, $oh-2*$y); # Rect size
# Html Header # Html Header
pO "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; pO '<?xml version="1.0" encoding="UTF-8"?>';
pO "<!DOCTYPE svg>"; pO '<!DOCTYPE svg>';
pO "<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" ". pO '<svg version="1.1" xmlns="http://www.w3.org/2000/svg" '.
"xmlns:xlink=\"http://www.w3.org/1999/xlink\" " . 'xmlns:xlink="http://www.w3.org/1999/xlink" >';
">";
pO "<style type=\"text/css\"><![CDATA["; pO "<style type=\"text/css\"><![CDATA[";
if(open(FH, "$__dir/svg_style.css")) { if(open(FH, "$__dir/svg_style.css")) {
@ -430,7 +429,6 @@ time_to_sec($)
if(!$str) { if(!$str) {
return 0; return 0;
} }
Log 1, $str;
my ($y,$m,$d,$h,$mi,$s) = split("[-_:]", $str); my ($y,$m,$d,$h,$mi,$s) = split("[-_:]", $str);
$s = 0 if(!$s); $s = 0 if(!$s);
$mi= 0 if(!$mi); $mi= 0 if(!$mi);

View File

@ -9,11 +9,10 @@ function
compressPoints(pointList) compressPoints(pointList)
{ {
var i, x, y, lx = -1, ly, ret = ""; var i, x, y, lx = -1, ly, ret = "";
var pl_arr = pointList.split(" "); var pl_arr = pointList.split(/[, ]/);
for(i = 0; i < pl_arr.length; i++) { for(i = 0; i < pl_arr.length; i +=2) {
var xy = pl_arr[i].split(","); x = parseInt(pl_arr[i]);
x = parseInt(xy[0]); y = parseInt(pl_arr[i+1]);
y = parseInt(xy[1]);
if(pl_arr.length > 500 && lx != -1 && x-lx < 2) // Filter the data. if(pl_arr.length > 500 && lx != -1 && x-lx < 2) // Filter the data.
continue; continue;
ret = ret+ ret = ret+
@ -90,7 +89,6 @@ svg_paste(evt)
"translate(0,"+ (h/y_mul+y_min-h/ny_mul-ny_min)*y_mul +") "+ "translate(0,"+ (h/y_mul+y_min-h/ny_mul-ny_min)*y_mul +") "+
"scale(1, "+ (y_mul/ny_mul) +") "; "scale(1, "+ (y_mul/ny_mul) +") ";
o.setAttribute("transform", tr); o.setAttribute("transform", tr);
d.documentElement.appendChild(o); d.documentElement.appendChild(o);
} }