From c7ad191c12a59b0ed4641d3da2ee6f7bfc3f2dca Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Fri, 15 Jan 2010 16:35:21 +0000 Subject: [PATCH] Fix for EMGZ address above 9 git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@548 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/15_CUL_EM.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FHEM/15_CUL_EM.pm b/FHEM/15_CUL_EM.pm index 33f7319cc..c833429a8 100755 --- a/FHEM/15_CUL_EM.pm +++ b/FHEM/15_CUL_EM.pm @@ -35,7 +35,7 @@ CUL_EM_Define($$) "[corr1 corr2 CostPerUnit BasicFeePerMonth]" if(int(@a) < 3 || int(@a) > 7); return "Define $a[0]: wrong CODE format: valid is 1-12" - if($a[2] !~ m/^\d$/ || $a[2] < 1 || $a[2] > 12); + if($a[2] !~ m/^\d+$/ || $a[2] < 1 || $a[2] > 12); $hash->{CODE} = $a[2]; @@ -86,7 +86,7 @@ CUL_EM_Parse($$) # E01012471B80100B80B -> Type 01, Code 01, Cnt 10 my @a = split("", $msg); my $tpe = ($a[1].$a[2])+0; - my $cde = ($a[3].$a[4])+0; + my $cde = hex($a[3].$a[4]); # seqno = number of received datagram in sequence, runs from 2 to 255 # total_cnt= total (cumulated) value in ticks as read from the device