-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from hollie/add_xpl_x10_support
Add xPL x10 basic support (input from Roger on mailing list)
- Loading branch information
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
=begin comment | ||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | ||
xPL_X10Basic.pm - basic support for X10 messages over xPL | ||
$Date$ | ||
$Revision$ | ||
Info: | ||
This module allows to support X10 basic messages over xPL. | ||
Usage: | ||
In your items.mht, add the squeezebox devices like this: | ||
XPL_X10BASIC, xpl_device_id:instance, object_name, group_name | ||
e.g. | ||
XPL_X10BASIC, hollie-x10gate.downstairs:uplight, uplight, Lights | ||
License: | ||
This free software is licensed under the terms of the GNU public license. | ||
Authors: | ||
Roger Simon, added to git by Lieven Hollevoet based on a mail on the mailing list | ||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | ||
=cut | ||
|
||
use strict; | ||
|
||
package xPL_X10Basic; | ||
use base qw(xPL_Item); | ||
|
||
sub new { | ||
my ($class, $p_source, $p_type, $p_statekey) = @_; | ||
my ($source,$deviceid) = $p_source =~ /(\S+):(\S+)/; | ||
$source = $p_source unless $source; | ||
my $self = $class->SUPER::new($source); | ||
$$self{type} = $p_type if $p_type; | ||
my $statekey = $p_statekey; | ||
$statekey = 'command'; | ||
$self->SUPER::class_name('x10.basic'); | ||
$$self{state_monitor} = "x10.basic : $statekey"; | ||
$self->SUPER::device_monitor("device=$deviceid") if defined | ||
$deviceid; | ||
return $self; | ||
} | ||
|
||
|
||
sub send_on { | ||
my ($self) = @_; | ||
$self->SUPER::send_cmnd('x10.basic' => { 'device' => '$deviceid', | ||
'command' => 'on' }); | ||
} | ||
|
||
sub send_off { | ||
my ($self) = @_; | ||
$self->SUPER::send_cmnd('x10.basic' => { 'device' => '$deviceid', | ||
'command' => 'off' }); | ||
} | ||
|
||
|
||
|
||
sub rts10_on { | ||
my ($self) = @_; | ||
$self->SUPER::send_cmnd('x10.basic' => { 'device' => '$deviceid', | ||
'command' => 'on' , 'protocol' => 'rts10' }); | ||
} | ||
|
||
|
||
sub rts10_off { | ||
my ($self) = @_; | ||
$self->SUPER::send_cmnd('x10.basic' => { 'device' => '$deviceid', | ||
'command' => 'off' , 'protocol' => 'rts10' }); | ||
} | ||
|
||
|
||
1; |