CUR time commands

git-svn-id: https://svn.fhem.de/fhem/trunk@363 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2009-04-11 09:22:52 +00:00
parent 68679a3b82
commit 9e0ced360e

View File

@ -20,7 +20,8 @@ my %gets = (
"raw" => "",
"ccconf" => "=",
"uptime" => "t",
"file" => ""
"file" => "",
"time" => "c03"
);
my %sets = (
@ -32,7 +33,8 @@ my %sets = (
"verbose" => "X",
"led" => "l",
"patable" => "x",
"file" => ""
"file" => "",
"time" => ""
);
my @ampllist = (24, 27, 30, 33, 36, 38, 40, 42);
@ -271,6 +273,14 @@ WRITEEND:
CUL_SimpleWrite($hash, $initstr);
return "$name: $err" if($err);
} elsif($type eq "time") {
return "Only supported for CUR devices (see VERSION)"
if($hash->{VERSION} !~ m/CUR/);
my @a = localtime;
my $msg = sprintf("c%02d%02d%02d", $a[2],$a[1],$a[0]);
CUL_SimpleWrite($hash, $msg);
} else {
return "Expecting a 0-padded hex number"
@ -442,6 +452,12 @@ CUL_DoInit($)
}
$hash->{VERSION} = $ver;
if($ver =~ m/CUR/) {
my @a = localtime;
my $msg = sprintf("c%02d%02d%02d", $a[2],$a[1],$a[0]);
CUL_SimpleWrite($hash, $msg);
}
CUL_SimpleWrite($hash, $initstr);
$hash->{STATE} = "Initialized";