2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

11_OWDevice: new attribute cstrings, fix for trimvalues; 10_OWServer: fixed HTML tag in commandref

git-svn-id: https://svn.fhem.de/fhem/trunk@13114 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2017-01-16 19:25:59 +00:00
parent b9959ef60c
commit f170b3d765
3 changed files with 8 additions and 4 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.
- feature: 11_OWDevice: new attribute cstrings, fix for trimvalues
- new: 98_powerMap: introducing new module to calculate power and
energy for every FHEM device w/o power meter
- updated: 38_netatmo.pm: added support for Presence, Homecoach & Webhook

View File

@ -661,7 +661,7 @@ OWServer_Set($@)
<br><br>
<a name="OWDeviceattr"></a>
<a name="OWServerattr"></a>
<b>Attributes</b>
<ul>
<li>nonblocking<br>
@ -804,7 +804,7 @@ OWServer_Set($@)
</ul>
<p>
<a name="OWDeviceattr"></a>
<a name="OWServerattr"></a>
<b>Attribute</b>
<ul>
<li>nonblocking<br>

View File

@ -374,7 +374,7 @@ OWDevice_Initialize($)
$hash->{UndefFn} = "OWDevice_Undef";
$hash->{AttrFn} = "OWDevice_Attr";
$hash->{AttrList} = "IODev uncached trimvalues polls interfaces model ".
$hash->{AttrList} = "IODev uncached trimvalues polls interfaces model cstrings ".
"resolution:9,10,11,12 ".
$readingFnAttributes;
}
@ -465,7 +465,8 @@ OWDevice_ReadValue($$) {
#Debug "$path => $value; $msec";
if($interface ne "id") {
if(defined($value)) {
$value= trim($value) if(AttrVal($hash,"trimvalues",1));
$value=~ s/\0.*$//g if(AttrVal($hash->{NAME},"cstrings",0));
$value= trim($value) if(AttrVal($hash->{NAME},"trimvalues",1));
} else {
Log3 $hash, 3, $hash->{NAME} . ": reading $reading did not return a value";
}
@ -886,6 +887,7 @@ OWDevice_InitValues($)
belong to it, then continue with the next OWServer and the attached OWDevices, and so on.
</li>
<li>trimvalues: removes leading and trailing whitespace from readings. Default is 1 (on).</li>
<li>cstrings: interprets reading as C-style string, i.e. stops reading on the first zero byte. Default is 0 (off).</li>
<li>polls: a comma-separated list of readings to poll. This supersedes the list of default readings to poll.</li>
<li>interfaces: supersedes the interfaces exposed by that device.</li>
<li>model: preset with device type, e.g. DS18S20.</li>
@ -1044,6 +1046,7 @@ OWDevice_InitValues($)
nächste OWServer-Instanz, gefolgt von den zugehörigen OWDevice-Geräten, usw.
</li>
<li>trimvalues: Entfernt voran- und nachgestellte Leerzeichen aus den readings. Standartwert ist 1 (ein).</li>
<li>cstrings: Interpretiert die readings als C-String, d.h. h&ouml;rt mit dem ersten 0-Byte zu lesen auf. Standardwert ist 0 (off).</li>
<li>polls: Eine per Komma getrennte Liste der abzurufenden readings. Mit diesem Attribut unterdrückt man alle standartmäßig abgerufenen readings und ersetzt sie durch die eigene Zusammenstellung.</li>
<li>interfaces: Ersetzt die durch dieses Gerät erzeugten Interfaces.</li>
<li>model: Angabe des Gerätetyps, z.B.: DS18S20.</li>