diff --git a/fhem/CHANGED b/fhem/CHANGED index 63296afef..b7763bbf1 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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. + - change: 12_HProtocolGateway: moved strapping table csv file to attribute - bugfix: 98_WeekdayTimer: restore old Revision; remove Twilight dependency - bugfix: 88_HMCCU: Module HttpUtils included - changed. 98_WOL: remove dependency on Twilight + German COmmandref diff --git a/fhem/FHEM/12_HProtocolGateway.pm b/fhem/FHEM/12_HProtocolGateway.pm index 8978a4305..7cfd4a8af 100644 --- a/fhem/FHEM/12_HProtocolGateway.pm +++ b/fhem/FHEM/12_HProtocolGateway.pm @@ -49,8 +49,7 @@ sub HProtocolGateway_Initialize($) { "parityBit:N,E,O " . "databitsLength:5,6,7,8 " . "stopBit:0,1 " . - "pollIntervalMins " . - "path"; + "pollIntervalMins"; } sub HProtocolGateway_Define($$) { @@ -342,8 +341,6 @@ sub HProtocolGateway_Attr (@) { } else { RemoveInternalTimer($hash); } - } elsif ($attr eq 'path') { - $attr{$name}{path} = $val; } elsif ($attr eq 'baudrate') { $attr{$name}{baudrate} = $val; HProtocolGateway_DeviceConfig($hash); @@ -386,19 +383,19 @@ sub HProtocolGateway_Poll($) { sub HProtocolGateway_Tank($$$) { my ($hash,$tankHash,$filllevel) = @_; my $name = $hash->{NAME}; - my $path = AttrVal($name,"path",""); - my $type = AttrVal($tankHash->{NAME},"type",""); + my $type = AttrVal($tankHash->{NAME}, 'type',''); my %TankChartHash; - open my $fh, '<', $path.$type or die "Cannot open: $!"; - while (my $line = <$fh>) { + + my @array = split(" ", $type); + + foreach my $line (@array) { $line =~ s/\s*\z//; my @array = split /,/, $line; my $key = shift @array; $TankChartHash{$key} = $array[0]; } - close $fh; - + my $volume = 0; my $volume1 = 0; my $level1 = 0; @@ -433,7 +430,6 @@ sub HProtocolGateway_Tank($$$) {
define <name> HProtocolGateway /dev/tty???
attr <name> pollIntervalMins 2
- attr <name> path /opt/fhem/
attr <name> baudrate 1200
attr <name> databitsLength 8
attr <name> parityBit N
@@ -441,23 +437,6 @@ sub HProtocolGateway_Tank($$$) {
Defines an HProtocolGateway connected to RS232 serial standard interface.
- path is the path for tank<01>.csv strapping table files.
-
-
- level,volume
- 10,16
- 520,7781
- 1330,29105
- 1830,43403
- 2070,49844
- 2220,53580
- 2370,57009
- 2400,57650
- 2430,58275
- 2370,57009
- 2400,57650
- 2430,58275
-
+ level,volume
+ 10,16
+ 520,7781
+ 1330,29105
+ 1830,43403
+ 2070,49844
+ 2220,53580
+ 2370,57009
+ 2400,57650
+ 2430,58275
+ 2370,57009
+ 2400,57650
+ 2430,58275
+