mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 08:11:44 +00:00
CUR time commands
git-svn-id: https://svn.fhem.de/fhem/trunk@363 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
68679a3b82
commit
9e0ced360e
@ -20,7 +20,8 @@ my %gets = (
|
|||||||
"raw" => "",
|
"raw" => "",
|
||||||
"ccconf" => "=",
|
"ccconf" => "=",
|
||||||
"uptime" => "t",
|
"uptime" => "t",
|
||||||
"file" => ""
|
"file" => "",
|
||||||
|
"time" => "c03"
|
||||||
);
|
);
|
||||||
|
|
||||||
my %sets = (
|
my %sets = (
|
||||||
@ -32,7 +33,8 @@ my %sets = (
|
|||||||
"verbose" => "X",
|
"verbose" => "X",
|
||||||
"led" => "l",
|
"led" => "l",
|
||||||
"patable" => "x",
|
"patable" => "x",
|
||||||
"file" => ""
|
"file" => "",
|
||||||
|
"time" => ""
|
||||||
);
|
);
|
||||||
|
|
||||||
my @ampllist = (24, 27, 30, 33, 36, 38, 40, 42);
|
my @ampllist = (24, 27, 30, 33, 36, 38, 40, 42);
|
||||||
@ -271,6 +273,14 @@ WRITEEND:
|
|||||||
CUL_SimpleWrite($hash, $initstr);
|
CUL_SimpleWrite($hash, $initstr);
|
||||||
return "$name: $err" if($err);
|
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 {
|
} else {
|
||||||
|
|
||||||
return "Expecting a 0-padded hex number"
|
return "Expecting a 0-padded hex number"
|
||||||
@ -442,6 +452,12 @@ CUL_DoInit($)
|
|||||||
}
|
}
|
||||||
$hash->{VERSION} = $ver;
|
$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);
|
CUL_SimpleWrite($hash, $initstr);
|
||||||
$hash->{STATE} = "Initialized";
|
$hash->{STATE} = "Initialized";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user