mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
10_KNX.pm:
ABU 20171215 added fix for newline in def docm 20180109 fixed problem with dpt16 reading-set git-svn-id: https://svn.fhem.de/fhem/trunk@15906 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dbfac188f7
commit
fe7c3e5292
@ -39,6 +39,8 @@
|
||||
# ABU 20171006 added dpt19
|
||||
# ABU 20171212 added dpt14.057
|
||||
# ABU 20171212 finetuned doku
|
||||
# ABU 20171215 added fix for newline in def
|
||||
# docm 20180109 fixed problem with dpt16 reading-set
|
||||
|
||||
package main;
|
||||
|
||||
@ -235,6 +237,7 @@ KNX_Initialize($) {
|
||||
sub
|
||||
KNX_Define($$) {
|
||||
my ($hash, $def) = @_;
|
||||
$def =~ s/\n/ /g;
|
||||
my @a = split("[ \t][ \t]*", $def);
|
||||
#device name
|
||||
my $name = $a[0];
|
||||
@ -583,12 +586,21 @@ KNX_Set($@) {
|
||||
{
|
||||
return "\"string\" only allowed for dpt16" if (not($code eq "dpt16"));
|
||||
return "no data for cmd $cmd" if ($lastArg < 2);
|
||||
|
||||
|
||||
#join string
|
||||
for (my $i=2; $i<=$lastArg; $i++)
|
||||
#docm 180109 removed
|
||||
# for (my $i=2; $i<=$lastArg; $i++)
|
||||
# {
|
||||
# $value.= $a[$i]." ";
|
||||
# }
|
||||
|
||||
#docm 180109 inserted
|
||||
$value = $a[2];
|
||||
for (my $i=3; $i<=$lastArg; $i++)
|
||||
{
|
||||
$value.= $a[$i]." ";
|
||||
}
|
||||
$value.= " ".$a[$i];
|
||||
}
|
||||
#docm 180109 changes end
|
||||
}
|
||||
#set RGB <RRGGBB>
|
||||
elsif ($cmd =~ m/$RGB/)
|
||||
@ -1575,6 +1587,11 @@ KNX_decodeByDpt ($$$) {
|
||||
$numval = 0;
|
||||
$state = "";
|
||||
|
||||
#docm 180109 inserted
|
||||
$value =~ /^\s*(00)?(\S+)/;
|
||||
$value = $2;
|
||||
#docm 180109 changes end
|
||||
|
||||
for (my $i = 0; $i < 14; $i++)
|
||||
{
|
||||
my $c = hex(substr($value, $i * 2, 2));
|
||||
|
Loading…
x
Reference in New Issue
Block a user