mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
36_JeeLink.pm: added dummy mode (by BerndOst). see forum: http://forum.fhem.de/index.php/topic,19329.msg246982.html#msg246982
git-svn-id: https://svn.fhem.de/fhem/trunk@7777 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c1c835419e
commit
49e6c90f37
@ -77,6 +77,8 @@ JeeLink_Initialize($)
|
|||||||
$hash->{SetFn} = "JeeLink_Set";
|
$hash->{SetFn} = "JeeLink_Set";
|
||||||
$hash->{AttrFn} = "JeeLink_Attr";
|
$hash->{AttrFn} = "JeeLink_Attr";
|
||||||
$hash->{AttrList} = "Clients MatchList"
|
$hash->{AttrList} = "Clients MatchList"
|
||||||
|
." sendpool"
|
||||||
|
." dummy"
|
||||||
." initCommands"
|
." initCommands"
|
||||||
." flashCommand"
|
." flashCommand"
|
||||||
." DebounceTime BeepLong BeepShort BeepDelay"
|
." DebounceTime BeepLong BeepShort BeepDelay"
|
||||||
@ -99,7 +101,7 @@ JeeLink_Define($$)
|
|||||||
my @a = split("[ \t][ \t]*", $def);
|
my @a = split("[ \t][ \t]*", $def);
|
||||||
|
|
||||||
if(@a != 3) {
|
if(@a != 3) {
|
||||||
my $msg = "wrong syntax: define <name> JeeLink {devicename[\@baudrate] ".
|
my $msg = "wrong syntax: define <name> JeeLink {none | devicename[\@baudrate] ".
|
||||||
"| devicename\@directio}";
|
"| devicename\@directio}";
|
||||||
Log3 undef, 2, $msg;
|
Log3 undef, 2, $msg;
|
||||||
return $msg;
|
return $msg;
|
||||||
@ -108,9 +110,7 @@ JeeLink_Define($$)
|
|||||||
DevIo_CloseDev($hash);
|
DevIo_CloseDev($hash);
|
||||||
|
|
||||||
my $name = $a[0];
|
my $name = $a[0];
|
||||||
|
|
||||||
my $dev = $a[2];
|
my $dev = $a[2];
|
||||||
$dev .= "\@57600" if( $dev !~ m/\@/ );
|
|
||||||
|
|
||||||
$hash->{Clients} = $clientsJeeLink;
|
$hash->{Clients} = $clientsJeeLink;
|
||||||
$hash->{MatchList} = \%matchListPCA301;
|
$hash->{MatchList} = \%matchListPCA301;
|
||||||
@ -119,6 +119,12 @@ JeeLink_Define($$)
|
|||||||
$attr{$name}{flashCommand} = "avrdude -p atmega328P -c arduino -P [PORT] -D -U flash:w:[HEXFILE] 2>[LOGFILE]"
|
$attr{$name}{flashCommand} = "avrdude -p atmega328P -c arduino -P [PORT] -D -U flash:w:[HEXFILE] 2>[LOGFILE]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($dev eq "none") {
|
||||||
|
Log3 $name, 1, "$name device is none, commands will be echoed only";
|
||||||
|
$attr{$name}{dummy} = 1;
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
$dev .= "\@57600" if( $dev !~ m/\@/ );
|
||||||
$hash->{DeviceName} = $dev;
|
$hash->{DeviceName} = $dev;
|
||||||
|
|
||||||
my $ret = DevIo_OpenDev($hash, 0, "JeeLink_DoInit");
|
my $ret = DevIo_OpenDev($hash, 0, "JeeLink_DoInit");
|
||||||
@ -355,6 +361,9 @@ JeeLink_Get($@)
|
|||||||
my ($hash, $name, $cmd, @msg ) = @_;
|
my ($hash, $name, $cmd, @msg ) = @_;
|
||||||
my $arg = join(" ", @msg);
|
my $arg = join(" ", @msg);
|
||||||
|
|
||||||
|
my ($hash, @a) = @_;
|
||||||
|
return "No $a[1] for dummies" if(IsDummy($name));
|
||||||
|
|
||||||
my $list = "devices:noArg initJeeLink:noArg RFMconfig:noArg updateAvailRam:noArg raw";
|
my $list = "devices:noArg initJeeLink:noArg RFMconfig:noArg updateAvailRam:noArg raw";
|
||||||
|
|
||||||
if( $cmd eq "devices" ) {
|
if( $cmd eq "devices" ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user