2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

10_KNX.pm: fix bug introduced w. last change (Forum #122582)

git-svn-id: https://svn.fhem.de/fhem/trunk@26815 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
erwin 2022-12-08 12:09:41 +00:00
parent ca1b095b9c
commit efbc6b25b2
2 changed files with 6 additions and 8 deletions

View File

@ -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: 10_KNX: fix bug introduced w. last change, Forum #122582
- bugfix: 93_DbRep: fix diffValue for newer MariaDB Forum: #130697 - bugfix: 93_DbRep: fix diffValue for newer MariaDB Forum: #130697
- change: 98_todoist: API v9, please check - change: 98_todoist: API v9, please check
- change: 00_KNXIO: minor changes, Forum #127792 - change: 00_KNXIO: minor changes, Forum #127792

View File

@ -635,7 +635,6 @@ sub KNX_Get {
my $gadName = $args[0] // $hash->{FIRSTGADNAME}; my $gadName = $args[0] // $hash->{FIRSTGADNAME};
#FHEM asks with a ? at startup - no action, no log - if dev is disabled: no SET/GET pulldown ! #FHEM asks with a ? at startup - no action, no log - if dev is disabled: no SET/GET pulldown !
# return qq{unknown argument $cmd choose one of $hash->{GETSTRING}} if(defined($cmd) && ($cmd =~ m/\?/x));
if ($gadName =~ m/\?/x) { if ($gadName =~ m/\?/x) {
return (IsDisabled($name) == 1)?undef:qq{unknown argument choose one of $hash->{GETSTRING}}; return (IsDisabled($name) == 1)?undef:qq{unknown argument choose one of $hash->{GETSTRING}};
=pod =pod
@ -691,7 +690,6 @@ sub KNX_Set {
$thisSub .= qq{ ($name): }; $thisSub .= qq{ ($name): };
#FHEM asks with a "?" at startup or any reload of the device-detail-view - if dev is disabled: no SET/GET pulldown ! #FHEM asks with a "?" at startup or any reload of the device-detail-view - if dev is disabled: no SET/GET pulldown !
# return qq{unknown argument $cmd choose one of $hash->{SETSTRING}} if(defined($cmd) && ($cmd =~ m/\?/x));
if(defined($cmd) && ($cmd =~ m/\?/x)) { if(defined($cmd) && ($cmd =~ m/\?/x)) {
return (IsDisabled($name) == 1)?undef:qq{unknown argument $cmd choose one of $hash->{SETSTRING}}; return (IsDisabled($name) == 1)?undef:qq{unknown argument $cmd choose one of $hash->{SETSTRING}};
} }
@ -1061,22 +1059,21 @@ sub KNX_Parse {
Log3 ($deviceName, 5, qq{KNX_Parse ($deviceName): [r] GET}); Log3 ($deviceName, 5, qq{KNX_Parse ($deviceName): [r] GET});
#answer "old school" #answer "old school"
my $value = ReadingsVal($deviceName, 'state', undef); # fetch default value from state # my $value = ReadingsVal($deviceName, 'state', undef); # fetch default value from state
# my $value = undef; my $value = undef;
if (AttrVal($deviceName, 'answerReading', 0) != 0) { if (AttrVal($deviceName, 'answerReading', 0) != 0) {
my $putVal = ReadingsVal($deviceName, $putName, undef); my $putVal = ReadingsVal($deviceName, $putName, undef);
if (defined($putVal) && ($putVal ne q{})) { if (defined($putVal) && ($putVal ne q{})) {
$value = $putVal; #medium priority, overwrite $value $value = $putVal; #medium priority, overwrite $value
} }
# else { else {
# $value = ReadingsVal($deviceName, 'state', undef); #lowest priority - use state $value = ReadingsVal($deviceName, 'state', undef); #lowest priority - use state!
# } }
} }
#high priority - eval #high priority - eval
my $cmdAttr = AttrVal($deviceName, 'putCmd', undef); my $cmdAttr = AttrVal($deviceName, 'putCmd', undef);
if ((defined($cmdAttr)) && ($cmdAttr ne q{})) { if ((defined($cmdAttr)) && ($cmdAttr ne q{})) {
# $value = ReadingsVal($deviceName, 'state', undef); # fetch default value from state
$value = KNX_eval ($deviceHash, $gadName, $value, $cmdAttr); $value = KNX_eval ($deviceHash, $gadName, $value, $cmdAttr);
if (defined($value) && ($value ne q{}) && ($value ne 'ERROR')) { # answer only, if eval was successful if (defined($value) && ($value ne q{}) && ($value ne 'ERROR')) { # answer only, if eval was successful
Log3 ($deviceName, 5, qq{KNX_Parse ($deviceName): [r] replaced by Attr putCmd=$cmdAttr VALUE=$value}); Log3 ($deviceName, 5, qq{KNX_Parse ($deviceName): [r] replaced by Attr putCmd=$cmdAttr VALUE=$value});