mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-13 17:26:34 +00:00
10_FBDECT.pm: Log commands
git-svn-id: https://svn.fhem.de/fhem/trunk@11709 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
30d0bf104a
commit
f00fd8cf5d
@ -100,8 +100,11 @@ FBDECT_SetHttp($@)
|
||||
}
|
||||
|
||||
my $cmd = $a[1];
|
||||
my $name = $hash->{NAME};
|
||||
Log3 $name, 3, "FBDECT set $name $cmd";
|
||||
|
||||
if($cmd =~ m/^(on|off|toggle)$/) {
|
||||
IOWrite($hash, ReadingsVal($hash->{NAME},"AIN",0), "setswitch$cmd");
|
||||
IOWrite($hash, ReadingsVal($name,"AIN",0), "setswitch$cmd");
|
||||
my $state = ($cmd eq "toggle" ? ($hash->{state} eq "on" ? "off":"on"):$cmd);
|
||||
readingsSingleUpdate($hash, "state", $state, 1);
|
||||
return undef;
|
||||
@ -109,12 +112,12 @@ FBDECT_SetHttp($@)
|
||||
|
||||
if($cmd =~ m/^(open|closed|desired-temp)$/) {
|
||||
if($cmd eq "desired-temp") {
|
||||
return "Usage: set $hash->{NAME} desired-temp value" if(int(@a) != 3);
|
||||
return "Usage: set $name desired-temp value" if(int(@a) != 3);
|
||||
return "desired-temp must be between 8 and 28"
|
||||
if($a[2] !~ m/^[\d.]+$/ || $a[2] < 8 || $a[2] > 28)
|
||||
}
|
||||
my $val = ($cmd eq "open" ? 254 : ($cmd eq "closed" ? 253: int(2*$a[2])));
|
||||
IOWrite($hash, ReadingsVal($hash->{NAME},"AIN",0),"sethkrtsoll¶m=$val");
|
||||
IOWrite($hash, ReadingsVal($name,"AIN",0),"sethkrtsoll¶m=$val");
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
@ -136,6 +139,9 @@ FBDECT_Set($@)
|
||||
return SetExtensions($hash, $usage, @a);
|
||||
}
|
||||
|
||||
my $name = $hash->{NAME};
|
||||
Log3 $name, 3, "FBDECT set $name $cmd";
|
||||
|
||||
my $relay;
|
||||
if($cmd eq "on" || $cmd eq "off") {
|
||||
my $relay = sprintf("%08x%04x0000%08x", 15, 4, $cmd eq "on" ? 1 : 0);
|
||||
|
@ -2367,7 +2367,13 @@ GlobalAttr($$$$)
|
||||
{
|
||||
my ($type, $me, $name, $val) = @_;
|
||||
|
||||
return if($type ne "set");
|
||||
if($type eq "del") {
|
||||
my %noDel = ( verbose=>1, modpath=>1, logfile=>1, featurelevel=>1 );
|
||||
return "The global attribute $name cannot be deleted" if($noDel{$name});
|
||||
return undef;
|
||||
}
|
||||
|
||||
return undef if($type ne "set");
|
||||
################
|
||||
if($name eq "logfile") {
|
||||
my @t = localtime;
|
||||
|
Loading…
x
Reference in New Issue
Block a user