2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

ZWDongle/ZWave: readd changes (#38315)

git-svn-id: https://svn.fhem.de/fhem/trunk@9027 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-08-08 11:37:52 +00:00
parent 93f3c785c4
commit 4f508166dc
2 changed files with 10 additions and 8 deletions

View File

@ -36,7 +36,6 @@ my %sets = (
"sendNIF" => { cmd => "12%02x05@" },# ZW_SEND_NODE_INFORMATION
"setNIF" => { cmd => "03%02x%02x%02x%02x" },
# SERIAL_API_APPL_NODE_INFORMATION
"timeouts" => { cmd => "06%02x%02x"},# SERIAL_API_SET_TIMEOUTS
"reopen" => { cmd => "" },
);
@ -51,6 +50,7 @@ my %gets = (
"nodeInfo" => "41%02x", # ZW_GET_NODE_PROTOCOL_INFO
"nodeList" => "02", # SERIAL_API_GET_INIT_DATA
"random" => "1c%02x", # ZW_GET_RANDOM
"timeouts" => "06%02x%02x", # SERIAL_API_SET_TIMEOUTS
"version" => "15", # ZW_GET_VERSION
"raw" => "%s", # hex
@ -174,8 +174,6 @@ use vars qw(%zw_type6);
'11' => 'SWITCH_MULTILEVEL',
);
my $serInit;
sub
ZWDongle_Initialize($)
{
@ -337,7 +335,7 @@ ZWDongle_Get($@)
if(!defined($gets{$type}));
my $fb = substr($gets{$type}, 0, 2);
if($fb =~ m/^[0-8A-F]+$/i && !$serInit &&
if($fb =~ m/^[0-8A-F]+$/i && $type ne "caps" &&
ReadingsVal($name, "caps","") !~ m/\b$zw_func_id{$fb}\b/) {
return "$type is unsupported by this controller";
}
@ -475,20 +473,20 @@ ZWDongle_DoInit($)
{
my $hash = shift;
my $name = $hash->{NAME};
$serInit = 1;
DevIo_SetHwHandshake($hash) if($hash->{USBDev});
$hash->{PARTIAL} = "";
ZWDongle_Clear($hash);
ZWDongle_Get($hash, $name, "caps"); $serInit = 0;
ZWDongle_Get($hash, $name, "caps");
ZWDongle_Get($hash, $name, "homeId");
ZWDongle_Get($hash, $name, ("random", 32)); # Sec relevant
ZWDongle_Set($hash, $name, ("timeouts", 100, 15)); # Sec relevant
ZWDongle_ReadAnswer($hash, "timeouts", "^0106");
# NODEINFO_LISTENING, Generic Static controller, Specific Static Controller, 0
ZWDongle_Set($hash, $name, ("setNIF", 1, 2, 1, 0)); # Sec relevant (?)
$hash->{STATE} = "Initialized";
readingsSingleUpdate($hash, "state", "Initialized", 1);
return undef;
}

View File

@ -21,7 +21,8 @@ my %zwave_id2class;
my %zwave_class = (
NO_OPERATION => { id => '00' },
BASIC => { id => '20',
set => { basicValue => "01%02x" },
set => { basicValue => "01%02x",
basicSet => "01%02x" }, # Alias, Forum #38200
get => { basicStatus => "02", },
parse => { "..2001(.*)"=> '"basicSet:$1"', # Forum #36980
"..2002" => "basicGet:request", # sent by the remote
@ -1972,6 +1973,9 @@ s2Hex($)
<li>basicValue value<br>
Send value (0-255) to this device. The interpretation is device dependent,
e.g. for a SWITCH_BINARY device 0 is off and anything else is on.</li>
<li>basicValue value<br>
Alias for basicValue, to make mapping from the incoming events easier.
</li><br>
<br><br><b>Class BASIC_WINDOW_COVERING</b>
<li>coveringClose<br>