mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
98_TRAFFIC: v1.3.5, fixed return readings in DbLog_SplitFn
git-svn-id: https://svn.fhem.de/fhem/trunk@16020 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d902fae662
commit
df0f6b5353
@ -1,5 +1,6 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- bugfix: 98_TRAFFIC: v1.3.5, fixed return readings in DbLog_SplitFn
|
||||||
- feature: attr: -a and -r Options added (Forum #83414)
|
- feature: attr: -a and -r Options added (Forum #83414)
|
||||||
- feature: 20_FRM_IN: added Firmata 2.5 feature PIN_MODE_PULLUP
|
- feature: 20_FRM_IN: added Firmata 2.5 feature PIN_MODE_PULLUP
|
||||||
note: requires perl-firmata 0.64
|
note: requires perl-firmata 0.64
|
||||||
|
@ -71,7 +71,7 @@ sub TRAFFIC_DbLog_split;
|
|||||||
my %TRcmds = (
|
my %TRcmds = (
|
||||||
'update' => 'noArg',
|
'update' => 'noArg',
|
||||||
);
|
);
|
||||||
my $TRVersion = '1.3.4';
|
my $TRVersion = '1.3.5';
|
||||||
|
|
||||||
sub TRAFFIC_Initialize($){
|
sub TRAFFIC_Initialize($){
|
||||||
|
|
||||||
@ -789,12 +789,16 @@ sub TRAFFIC_DbLog_split($) {
|
|||||||
my @parts = split(/ /,$event);
|
my @parts = split(/ /,$event);
|
||||||
$reading = shift @parts;
|
$reading = shift @parts;
|
||||||
$reading =~ tr/://d;
|
$reading =~ tr/://d;
|
||||||
$reading =~ s/^return_//;
|
my $alternativeReading = $reading;
|
||||||
|
$alternativeReading =~ s/^return_//;
|
||||||
$value = join(" ",@parts);
|
$value = join(" ",@parts);
|
||||||
|
|
||||||
if($readings->{$reading}){
|
if($readings->{$reading}){
|
||||||
$unit = $readings->{$reading};
|
$unit = $readings->{$reading};
|
||||||
$value =~ s/$unit$//; #try to remove the unit from the value
|
$value =~ s/$unit$//; #try to remove the unit from the value
|
||||||
|
}elsif($readings->{$alternativeReading}){
|
||||||
|
$unit = $readings->{$alternativeReading};
|
||||||
|
$value =~ s/$unit$//; #try to remove the unit from the value
|
||||||
}else{
|
}else{
|
||||||
Log3 $hash, 5, "TRAFFIC: ($device) TRAFFIC_DbLog_split auto detect unit for reading $reading value $value";
|
Log3 $hash, 5, "TRAFFIC: ($device) TRAFFIC_DbLog_split auto detect unit for reading $reading value $value";
|
||||||
$unit = 'min' if ($reading) =~ m/_min$/;
|
$unit = 'min' if ($reading) =~ m/_min$/;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user