RFR fixes

example path fixes
Prompt changed


git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@493 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2009-12-02 20:38:00 +00:00
parent fea6d2720c
commit cd266ba4fa
17 changed files with 57 additions and 44 deletions

View File

@ -548,3 +548,5 @@
- ==DATE== (4.9) - ==DATE== (4.9)
- bugfix: changed the fhem prompt from FHZ> to fhem> - bugfix: changed the fhem prompt from FHZ> to fhem>
- bugfix: CUL_RFR fixes (chaining RFR's should work)
- bugfix: Path in the examples fixed (got corrupted)

View File

@ -488,7 +488,10 @@ CUL_ReadAnswer($$$)
my ($hash, $arg, $anydata) = @_; my ($hash, $arg, $anydata) = @_;
my $type = $hash->{TYPE}; my $type = $hash->{TYPE};
$hash = $hash->{IODev} if($type eq "CUL_RFR"); while($hash->{TYPE} eq "CUL_RFR") { # Look for the first "real" CUL
$hash = $hash->{IODev};
}
return ("No FD", undef) return ("No FD", undef)
if(!$hash || ($^O !~ /Win/ && !defined($hash->{FD}))); if(!$hash || ($^O !~ /Win/ && !defined($hash->{FD})));
@ -816,8 +819,8 @@ CUL_SimpleWrite(@)
return if(!$hash); return if(!$hash);
if($hash->{TYPE} eq "CUL_RFR") { if($hash->{TYPE} eq "CUL_RFR") {
$msg = CUL_RFR_AddPrefix($hash, $msg); # Prefix $msg with RRBBU and return the corresponding CUL hash.
$hash = $hash->{IODev}; ($hash, $msg) = CUL_RFR_AddPrefix($hash, $msg);
} }
$msg .= "\n" unless($nonl); $msg .= "\n" unless($nonl);

View File

@ -102,7 +102,10 @@ CUL_RFR_Parse($$)
sub sub
CUL_RFR_DelPrefix($) CUL_RFR_DelPrefix($)
{ {
my ($prefix, $msg) = split("U", shift, 2); my ($msg) = @_;
while($msg =~ m/^\d{4}U/) {
(undef, $msg) = split("U", $msg, 2);
}
return $msg; return $msg;
} }
@ -110,7 +113,12 @@ sub
CUL_RFR_AddPrefix($$) CUL_RFR_AddPrefix($$)
{ {
my ($hash, $msg) = @_; my ($hash, $msg) = @_;
return "u" . $hash->{ID} . $hash->{ROUTERID} . $msg; while($hash->{TYPE} eq "CUL_RFR") {
# Prefix $msg with RRBBU and return the corresponding CUL hash
$msg = "u" . $hash->{ID} . $hash->{ROUTERID} . $msg;
$hash = $hash->{IODev};
}
return ($hash, $msg);
} }
1; 1;

View File

@ -2,8 +2,8 @@ BINDIR=/usr/local/bin
MODDIR=/usr/local/lib MODDIR=/usr/local/lib
VARDIR=/var/log/fhem VARDIR=/var/log/fhem
VERS=4.7 VERS=4.8
DATE=2009-10-23 DATE=2009-11-28
all: all:
@echo Nothing to do for all. @echo Nothing to do for all.

View File

@ -31,7 +31,7 @@ Usage:
displayed, e.g.: displayed, e.g.:
Example: Example:
FHZ> jsonlist fhem> jsonlist
{ {
"ResultSet": { "ResultSet": {
"Results": [ "Results": [
@ -49,7 +49,7 @@ Usage:
} }
Example for <devspec>: Example for <devspec>:
FHZ> jsonlist lamp1 fhem> jsonlist lamp1
{ {
"ResultSet": { "ResultSet": {
"Results": { "Results": {
@ -75,7 +75,7 @@ Usage:
} }
Example for <typespec>: Example for <typespec>:
FHZ> jsonlist HMS fhem> jsonlist HMS
{ {
"ResultSet": { "ResultSet": {
"Results": [ "Results": [
@ -89,7 +89,7 @@ Usage:
} }
Example for ROOMS: Example for ROOMS:
FHZ> jsonlist ROOMS fhem> jsonlist ROOMS
{ {
"ResultSet": { "ResultSet": {
"Results": [ "Results": [

View File

@ -21,7 +21,7 @@
+ entries if no parameter is given. + entries if no parameter is given.
+ <br><br> + <br><br>
+ Example: + Example:
+ <pre><code> FHZ> jsonlist + <pre><code> fhem> jsonlist
+ { + {
+ "ResultSet": { + "ResultSet": {
+ "Results": [ + "Results": [
@ -40,7 +40,7 @@
+ </code></pre> + </code></pre>
+ If specifying <code>&lt;devspec&gt;</code>, then a detailed status for + If specifying <code>&lt;devspec&gt;</code>, then a detailed status for
+ <code>&lt;devspec&gt;</code> will be displayed, e.g.: + <code>&lt;devspec&gt;</code> will be displayed, e.g.:
+ <pre><code> FHZ> jsonlist lamp1 + <pre><code> fhem> jsonlist lamp1
+ { + {
+ "ResultSet": { + "ResultSet": {
+ "Results": { + "Results": {
@ -67,7 +67,7 @@
+ </code></pre> + </code></pre>
+ If specifying <code>&lt;typespec&gt;</code>, then a list with the status for + If specifying <code>&lt;typespec&gt;</code>, then a list with the status for
+ the defined <code>&lt;typespec&gt;</code> devices will be displayed, e.g.: + the defined <code>&lt;typespec&gt;</code> devices will be displayed, e.g.:
+ <pre><code> FHZ> jsonlist HMS + <pre><code> fhem> jsonlist HMS
+ { + {
+ "ResultSet": { + "ResultSet": {
+ "Results": [ + "Results": [
@ -82,7 +82,7 @@
+ </code></pre> + </code></pre>
+ If specifying <code>ROOMS</code>, then a list with the defined rooms + If specifying <code>ROOMS</code>, then a list with the defined rooms
+ will be displayed, e.g.: + will be displayed, e.g.:
+ <pre><code> FHZ> jsonlist ROOMS + <pre><code> fhem> jsonlist ROOMS
+ { + {
+ "ResultSet": { + "ResultSet": {
+ "Results": [ + "Results": [

View File

@ -19,19 +19,19 @@ EXAMPLES
Output a short string of the "READINGS" for <devspec>. Output a short string of the "READINGS" for <devspec>.
Example for a FS20-Device: Example for a FS20-Device:
FHZ> getstate EG.sz.SD.Tv fhem> getstate EG.sz.SD.Tv
state:0 state:0
Example for a FHT-Device: Example for a FHT-Device:
FHZ> getstate EG.wz.HZ fhem> getstate EG.wz.HZ
actuator:0 day-temp:21.5 desired-temp:21.5 lowtemp-offset:4.0 [...] actuator:0 day-temp:21.5 desired-temp:21.5 lowtemp-offset:4.0 [...]
Example for a KS300/555-Device: Example for a KS300/555-Device:
FHZ> getstate GH.ga.WE.01 fhem> getstate GH.ga.WE.01
humidity:93 israining:0 rain:207.8 rain_raw:815 temperature:5.1 [...] humidity:93 israining:0 rain:207.8 rain_raw:815 temperature:5.1 [...]
Example for a HMS-Device: Example for a HMS-Device:
FHZ> getstate NN.xx.RM.01 fhem> getstate NN.xx.RM.01
smoke_detect:0 smoke_detect:0
CONTRIB CONTRIB

View File

@ -491,7 +491,7 @@ A line ending with \ will be concatenated with the next one, so long lines
reading (actuator, measured-temp) for all devices from the devspec. reading (actuator, measured-temp) for all devices from the devspec.
<br><br> <br><br>
Example: Example:
<pre><code> FHZ> list <pre><code> fhem> list
Type list <name> for detailed info. Type list <name> for detailed info.
@ -524,7 +524,7 @@ A line ending with \ will be concatenated with the next one, so long lines
</code></pre> </code></pre>
If specifying <code>name</code>, then a detailed status for <code>name</code> If specifying <code>name</code>, then a detailed status for <code>name</code>
will be displayed, e.g.: will be displayed, e.g.:
<pre><code> FHZ> list fl <pre><code> fhem> list fl
Internals: Internals:
CODE 5102 CODE 5102
@ -728,7 +728,7 @@ A line ending with \ will be concatenated with the next one, so long lines
entries. It is not intended for human consumption. entries. It is not intended for human consumption.
<br><br> <br><br>
Example: Example:
<pre> FHZ> xmllist <pre> fhem> xmllist
&lt;FHZINFO&gt; &lt;FHZINFO&gt;
&lt;internal_LIST&gt; &lt;internal_LIST&gt;
&lt;internal name="global" state="internal" sets="" attrs="room configfile logfile modpath pidfilename port statefile userattr verbose version"&gt; &lt;internal name="global" state="internal" sets="" attrs="room configfile logfile modpath pidfilename port statefile userattr verbose version"&gt;

View File

@ -272,21 +272,21 @@ by fhem.pl?</b>
<pre> <pre>
# Check simply the value. It is the same as seen in "list" # Check simply the value. It is the same as seen in "list"
FHZ> {$value{myfht}} fhem> {$value{myfht}}
measured-temp: 23.8 (Celsius) measured-temp: 23.8 (Celsius)
# Get the second word, so we can compare it. # Get the second word, so we can compare it.
FHZ> { my @a = split(" ", $value{myfht});; $a[1] } fhem> { my @a = split(" ", $value{myfht});; $a[1] }
23.8 23.8
# Set the ventilator on now, if its too hot. # Set the ventilator on now, if its too hot.
FHZ> { my @a = split(" ", $value{myfht});; fhem("set ventilator on") if($a[1] > 25.0) } fhem> { my @a = split(" ", $value{myfht});; fhem("set ventilator on") if($a[1] > 25.0) }
# Now do this regularly # Now do this regularly
FHZ> define chilldown at +*00:30:00 { my @a = split(" ", $value{myfht});; fhem("set ventilator on") if($a[1] > 25.0) } fhem> define chilldown at +*00:30:00 { my @a = split(" ", $value{myfht});; fhem("set ventilator on") if($a[1] > 25.0) }
# An alternative: # An alternative:
FHZ> define chilldown at +*00:30:00 { fhem("set ventilator on") if($value{myfht} gt "measured-temp: 25.0") } fhem> define chilldown at +*00:30:00 { fhem("set ventilator on") if($value{myfht} gt "measured-temp: 25.0") }
</pre> </pre>
</ul> </ul>

View File

@ -7,8 +7,8 @@
# #
# Common part # Common part
attr global logfile .-%Y-%m.log attr global logfile /tmp/fhem-%Y-%m.log
attr global statefile ..save # where to save the state of the devices attr global statefile /tmp/fhem.save # where to save the state of the devices
attr global verbose 3 # "normal" verbosity (min 1, max 5) attr global verbose 3 # "normal" verbosity (min 1, max 5)
attr global port 7072 # our TCP/IP port (localhost only) attr global port 7072 # our TCP/IP port (localhost only)
attr global modpath . # where our FHEM directory is attr global modpath . # where our FHEM directory is

View File

@ -10,8 +10,8 @@
# Common part # Common part
attr global logfile .-%Y-%m.log attr global logfile /tmp/fhem-%Y-%m.log
attr global statefile ..save # where to save the state of the devices attr global statefile /tmp/fhem.save # where to save the state of the devices
attr global verbose 3 # "normal" verbosity attr global verbose 3 # "normal" verbosity
attr global port 7072 # our TCP/IP port (localhost only) attr global port 7072 # our TCP/IP port (localhost only)
attr global modpath . # where our FHEM directory is attr global modpath . # where our FHEM directory is

View File

@ -8,8 +8,8 @@
# After about 5-10 minutes, check if "list wz" returns something meaningful # After about 5-10 minutes, check if "list wz" returns something meaningful
# #
attr global logfile .-%Y-%m.log attr global logfile /tmp/fhem-%Y-%m.log
attr global statefile ..save # where to save the state of the devices attr global statefile /tmp/fhem.save # where to save the state of the devices
attr global verbose 3 # "normal" verbosity attr global verbose 3 # "normal" verbosity
attr global port 7072 # our TCP/IP port (localhost only) attr global port 7072 # our TCP/IP port (localhost only)
attr global modpath . # where our FHEM directory is attr global modpath . # where our FHEM directory is

View File

@ -4,8 +4,8 @@
# contrib/91_DbLog.pm # contrib/91_DbLog.pm
# #
attr global logfile .-%Y-%m.log attr global logfile /tmp/fhem-%Y-%m.log
attr global statefile ..save # where to save the state of the devices attr global statefile /tmp/fhem.save # where to save the state of the devices
attr global verbose 3 # "normal" verbosity attr global verbose 3 # "normal" verbosity
attr global port 7072 # our TCP/IP port (localhost only) attr global port 7072 # our TCP/IP port (localhost only)
attr global modpath . # where our FHEM directory is attr global modpath . # where our FHEM directory is

View File

@ -8,8 +8,8 @@
# if there is no definition for it. Check the commandref.html define, Type HMS # if there is no definition for it. Check the commandref.html define, Type HMS
# section for details # section for details
attr global logfile .-%Y-%m.log attr global logfile /tmp/fhem-%Y-%m.log
attr global statefile ..save # where to save the state of the devices attr global statefile /tmp/fhem.save # where to save the state of the devices
attr global verbose 3 # "normal" verbosity (min 1, max 5) attr global verbose 3 # "normal" verbosity (min 1, max 5)
attr global port 7072 # our TCP/IP port (localhost only) attr global port 7072 # our TCP/IP port (localhost only)
attr global modpath . # where our FHEM directory is attr global modpath . # where our FHEM directory is

View File

@ -65,8 +65,8 @@
# Globale Einstellungen # Globale Einstellungen
# global settings # global settings
attr global logfile /var/log/fhem/fhem.log attr global logfile /tmp/fhem.log
attr global statefile /var/cache/fhem/fhem.save attr global statefile /tmp/fhem.save
attr global pidfilename /var/run/fhem.pid attr global pidfilename /var/run/fhem.pid
attr global verbose 3 attr global verbose 3
attr global port 7072 attr global port 7072

View File

@ -1,8 +1,8 @@
# #
# Minimalistic fhem.pl configfile. Take a look at the other examples for more. # Minimalistic fhem.pl configfile. Take a look at the other examples for more.
# #
attr global logfile .-%Y-%m.log attr global logfile /tmp/fhem-%Y-%m.log
attr global statefile ..save # where to save the state of the devices attr global statefile /tmp/fhem.save # where to save the state of the devices
attr global verbose 3 # "normal" verbosity (min 1, max 5) attr global verbose 3 # "normal" verbosity (min 1, max 5)
attr global port 7072 # our TCP/IP port (localhost only) attr global port 7072 # our TCP/IP port (localhost only)
attr global modpath . # where our FHEM directory is attr global modpath . # where our FHEM directory is

View File

@ -2,8 +2,8 @@
# Minimalistic fhem.pl & pgm2 configfile. Take a look at the other examples for # Minimalistic fhem.pl & pgm2 configfile. Take a look at the other examples for
# more. # more.
# #
attr global logfile .-%Y-%m.log attr global logfile /tmp/fhem-%Y-%m.log
attr global statefile ..save # where to save the state of the devices attr global statefile /tmp/fhem.save # where to save the state of the devices
attr global verbose 3 # "normal" verbosity (min 1, max 5) attr global verbose 3 # "normal" verbosity (min 1, max 5)
attr global port 7072 # our TCP/IP port (localhost only) attr global port 7072 # our TCP/IP port (localhost only)
attr global modpath . # where our FHEM directory is attr global modpath . # where our FHEM directory is
@ -12,4 +12,4 @@ define WEB FHEMWEB 8083 global
attr WEB plotmode SVG attr WEB plotmode SVG
# Fake logfile, to access the global log # Fake logfile, to access the global log
define Logfile FileLog .-%Y-%m.log fakelog define Logfile FileLog /tmp/fhem-%Y-%m.log fakelog