diff --git a/fhem/CHANGED b/fhem/CHANGED index 16e35542e..029507a67 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # 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: state definition and split attribute added to 66_ECMD, + 67_ECMDDevice - FHEMWEB: JavaScripts and CssFiles attributes added - change: avoid updating weather information on get (59_Weather.pm) - change: removed noshutdown=0 for HTTP connections made in 57_Calendar.pm diff --git a/fhem/FHEM/66_ECMD.pm b/fhem/FHEM/66_ECMD.pm index 2e5bb71c0..8784dc3ef 100644 --- a/fhem/FHEM/66_ECMD.pm +++ b/fhem/FHEM/66_ECMD.pm @@ -64,7 +64,7 @@ ECMD_Initialize($) $hash->{GetFn} = "ECMD_Get"; $hash->{SetFn} = "ECMD_Set"; $hash->{AttrFn} = "ECMD_Attr"; - $hash->{AttrList}= "classdefs logTraffic:0,1,2,3,4,5 timeout"; + $hash->{AttrList}= "classdefs split logTraffic:0,1,2,3,4,5 timeout"; } ##################################### @@ -316,6 +316,12 @@ ECMD_EvalClassDef($$$) Log3 $hash, 5, "$name: parameters are $def"; $hash->{fhem}{classDefs}{$classname}{params}= $def; # + # state + # + } elsif($cmd eq "state") { + Log3 $hash, 5, "$name: state is determined as $def"; + $hash->{fhem}{classDefs}{$classname}{state}= $def; + # # reading # } elsif($cmd eq "reading") { @@ -487,6 +493,7 @@ sub ECMD_Read($) { my ($hash) = @_; my $buf = ECMD_SimpleRead($hash); + return unless(defined($buf)); return if($buf eq ""); ECMD_Log $hash, 5, "Spontaneously received " . dq($buf); @@ -631,6 +638,13 @@ ECMD_Write($$$)
attr myECMD \n
splits foo 12\nbar off
into
+ foo 12
and bar off
.