trigger_switch_d 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/COPYING.txt +674 -0
- data/LICENSE.txt +54 -0
- data/README.rdoc +106 -0
- data/bin/teach +44 -0
- data/bin/tsd +68 -0
- data/bin/turn_off +42 -0
- data/bin/turn_on +39 -0
- data/doc/classes/Tellstick/Tellstick.html +117 -0
- data/doc/classes/Tellstick/TellstickIO.html +265 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000020.html +18 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000021.html +20 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000022.html +26 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000023.html +19 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000024.html +26 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000025.html +16 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000026.html +16 -0
- data/doc/classes/Tellstick/TellstickIO.src/M000027.html +24 -0
- data/doc/classes/Tellstick.html +204 -0
- data/doc/classes/Tellstick.src/M000019.html +25 -0
- data/doc/classes/TriggerSwitchD/Action.html +165 -0
- data/doc/classes/TriggerSwitchD/Action.src/M000015.html +28 -0
- data/doc/classes/TriggerSwitchD/Action.src/M000016.html +18 -0
- data/doc/classes/TriggerSwitchD/Application.html +203 -0
- data/doc/classes/TriggerSwitchD/Application.src/M000017.html +21 -0
- data/doc/classes/TriggerSwitchD/Application.src/M000018.html +40 -0
- data/doc/classes/TriggerSwitchD/ConfigFactory/Config.html +127 -0
- data/doc/classes/TriggerSwitchD/ConfigFactory/Config.src/M000014.html +23 -0
- data/doc/classes/TriggerSwitchD/ConfigFactory.html +141 -0
- data/doc/classes/TriggerSwitchD/ConfigFactory.src/M000013.html +24 -0
- data/doc/classes/TriggerSwitchD/IPC.html +134 -0
- data/doc/classes/TriggerSwitchD/IPC.src/M000012.html +32 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.html +242 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000005.html +19 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000006.html +18 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000007.html +23 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000008.html +19 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000009.html +19 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000010.html +18 -0
- data/doc/classes/TriggerSwitchD/Schedule/InstanceMethods.src/M000011.html +18 -0
- data/doc/classes/TriggerSwitchD/Schedule.html +147 -0
- data/doc/classes/TriggerSwitchD/Schedule.src/M000004.html +19 -0
- data/doc/classes/TriggerSwitchD/SwitchFactory.html +135 -0
- data/doc/classes/TriggerSwitchD/SwitchFactory.src/M000003.html +20 -0
- data/doc/classes/TriggerSwitchD.html +212 -0
- data/doc/classes/TriggerSwitchD.src/M000001.html +22 -0
- data/doc/classes/TriggerSwitchD.src/M000002.html +27 -0
- data/doc/created.rid +1 -0
- data/doc/files/lib/tellstick/protocol/nexa_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/not_connected_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/null_protocol_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/plain_text_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/proove_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/protocol_loader_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/rising_sun_rb.html +126 -0
- data/doc/files/lib/tellstick/protocol/waveman_rb.html +126 -0
- data/doc/files/lib/tellstick/tellstick_io_rb.html +135 -0
- data/doc/files/lib/tellstick/tellstick_rb.html +135 -0
- data/doc/files/lib/tellstick_rb.html +134 -0
- data/doc/files/lib/trigger_switch_d/action_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/application_rb.html +136 -0
- data/doc/files/lib/trigger_switch_d/config_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/daylight_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/ipc_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/schedule_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/switch_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d/trigger_switch_d_helper_rb.html +126 -0
- data/doc/files/lib/trigger_switch_d_rb.html +140 -0
- data/doc/fr_class_index.html +38 -0
- data/doc/fr_file_index.html +46 -0
- data/doc/fr_method_index.html +53 -0
- data/doc/index.html +24 -0
- data/features/execute_schedule.feature +20 -0
- data/features/group_aliases.feature +31 -0
- data/features/handle_switches.feature +36 -0
- data/features/listen_for_client_call.feature +23 -0
- data/features/persistent_schedule.feature +70 -0
- data/features/proove_protocol.feature +20 -0
- data/features/schedule.feature +25 -0
- data/features/simple_string_protocol.feature +35 -0
- data/features/step_definitions/execute_schedule_steps.rb +16 -0
- data/features/step_definitions/group_aliases_steps.rb +24 -0
- data/features/step_definitions/handle_switches_steps.rb +21 -0
- data/features/step_definitions/listen_for_client_call_steps.rb +34 -0
- data/features/step_definitions/persistent_schedule_steps.rb +18 -0
- data/features/step_definitions/proove_protocol_steps.rb +3 -0
- data/features/step_definitions/schedule_steps.rb +9 -0
- data/features/step_definitions/shared_steps.rb +75 -0
- data/features/step_definitions/simple_string_protocol_steps.rb +3 -0
- data/features/step_definitions/sunrise_steps.rb +22 -0
- data/features/step_definitions/tellstick_connected_steps.rb +21 -0
- data/features/sunrise.feature +22 -0
- data/features/sunset.feature +22 -0
- data/features/support/action_helpers.rb +10 -0
- data/features/support/env.rb +7 -0
- data/features/support/listen_for_client_call_helper.rb +71 -0
- data/features/support/proove_helpers.rb +6 -0
- data/features/support/sunrise_helper.rb +8 -0
- data/features/tellstick_connected.feature +14 -0
- data/lib/tellstick/protocol/nexa.rb +48 -0
- data/lib/tellstick/protocol/not_connected.rb +42 -0
- data/lib/tellstick/protocol/null_protocol.rb +41 -0
- data/lib/tellstick/protocol/plain_text.rb +35 -0
- data/lib/tellstick/protocol/proove.rb +83 -0
- data/lib/tellstick/protocol/protocol_loader.rb +26 -0
- data/lib/tellstick/protocol/rising_sun.rb +42 -0
- data/lib/tellstick/protocol/waveman.rb +29 -0
- data/lib/tellstick/tellstick.rb +73 -0
- data/lib/tellstick/tellstick_io.rb +80 -0
- data/lib/tellstick.rb +20 -0
- data/lib/trigger_switch_d/action.rb +83 -0
- data/lib/trigger_switch_d/application.rb +89 -0
- data/lib/trigger_switch_d/config.rb +83 -0
- data/lib/trigger_switch_d/daylight.rb +114 -0
- data/lib/trigger_switch_d/ipc.rb +39 -0
- data/lib/trigger_switch_d/schedule.rb +95 -0
- data/lib/trigger_switch_d/switch.rb +37 -0
- data/lib/trigger_switch_d/trigger_switch_d_helper.rb +44 -0
- data/lib/trigger_switch_d.rb +26 -0
- data/spec/spec_helper.rb +22 -0
- data/spec/tellstick/protocol/nexa_spec.rb +57 -0
- data/spec/tellstick/protocol/proove_spec.rb +61 -0
- data/spec/tellstick/protocol/rising_sun_spec.rb +56 -0
- data/spec/tellstick/protocol/waveman_spec.rb +57 -0
- data/spec/tellstick/tellstick_io_spec.rb +31 -0
- data/spec/tellstick/tellstick_spec.rb +86 -0
- data/spec/trigger_switch_d/application_spec.rb +144 -0
- data/spec/trigger_switch_d/config_spec.rb +94 -0
- data/spec/trigger_switch_d/daylight_spec.rb +39 -0
- data/spec/trigger_switch_d/ipc_spec.rb +119 -0
- data/spec/trigger_switch_d/schedule_spec.rb +103 -0
- data/spec/trigger_switch_d/trigger_switch_d_spec_helpers.rb +24 -0
- data/trigger_switch_d.gemspec +43 -0
- metadata +206 -0
data/LICENSE.txt
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
TriggerSwitchD is copyrighted free software by Pontus Strömdahl, AdhocSkill,
|
2
|
+
<pontus.stromdahl@adhocskill.com>.You can redistribute it and/or modify
|
3
|
+
it under either the terms of the GPL (see COPYING.txt file),
|
4
|
+
or the conditions below:
|
5
|
+
|
6
|
+
1. You may make and give away verbatim copies of the source form of the
|
7
|
+
software without restriction, provided that you duplicate all of the
|
8
|
+
original copyright notices and associated disclaimers.
|
9
|
+
|
10
|
+
2. You may modify your copy of the software in any way, provided that
|
11
|
+
you do at least ONE of the following:
|
12
|
+
|
13
|
+
a) place your modifications in the Public Domain or otherwise
|
14
|
+
make them Freely Available, such as by posting said
|
15
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
16
|
+
the author to include your modifications in the software.
|
17
|
+
|
18
|
+
b) use the modified software only within your corporation or
|
19
|
+
organization.
|
20
|
+
|
21
|
+
c) rename any non-standard executables so the names do not conflict
|
22
|
+
with standard executables, which must also be provided.
|
23
|
+
|
24
|
+
d) make other distribution arrangements with the author.
|
25
|
+
|
26
|
+
3. You may distribute the software in object code or executable
|
27
|
+
form, provided that you do at least ONE of the following:
|
28
|
+
|
29
|
+
a) distribute the executables and library files of the software,
|
30
|
+
together with instructions (in the manual page or equivalent)
|
31
|
+
on where to get the original distribution.
|
32
|
+
|
33
|
+
b) accompany the distribution with the machine-readable source of
|
34
|
+
the software.
|
35
|
+
|
36
|
+
c) give non-standard executables non-standard names, with
|
37
|
+
instructions on where to get the original software distribution.
|
38
|
+
|
39
|
+
d) make other distribution arrangements with the author.
|
40
|
+
|
41
|
+
4. You may modify and include the part of the software into any other
|
42
|
+
software (possibly commercial). But some files in the distribution
|
43
|
+
are not written by the author, so that they are not under this terms.
|
44
|
+
|
45
|
+
5. The scripts and library files supplied as input to or produced as
|
46
|
+
output from the software do not automatically fall under the
|
47
|
+
copyright of the software, but belong to whomever generated them,
|
48
|
+
and may be sold commercially, and may be aggregated with this
|
49
|
+
software.
|
50
|
+
|
51
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
52
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
53
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
54
|
+
PURPOSE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
= trigger_switch_d
|
2
|
+
|
3
|
+
* http://github.com/pfspontus/trigger_switch_d
|
4
|
+
|
5
|
+
==License
|
6
|
+
See link:License.txt
|
7
|
+
|
8
|
+
==Requirements
|
9
|
+
|
10
|
+
Mac OSX
|
11
|
+
USB dongle (such as tellstick from http://www.telldus.se)
|
12
|
+
ruby-ftd2xx gem (git://github.com/pfspontus/ruby-ftd2xx)
|
13
|
+
ftd2xx USB drivers (available at http://ftdichip.com)
|
14
|
+
|
15
|
+
==Description
|
16
|
+
Scheduled (tsd) is run as a daemon without any need for user interaction.
|
17
|
+
It sends commands to remote triggered devices such as lamps and switches,
|
18
|
+
to activate/deactive them at scheduled times.
|
19
|
+
|
20
|
+
==Installation
|
21
|
+
1. Get source
|
22
|
+
|
23
|
+
<tt>git clone git://github.com/pfspontus/trigger_switch_d.git</tt>
|
24
|
+
|
25
|
+
2. install gem:
|
26
|
+
|
27
|
+
<tt>sudo gem install trigger_switch_d</tt>
|
28
|
+
|
29
|
+
==Usage
|
30
|
+
1. Register you remote triggered devices in a file called devices
|
31
|
+
using the following format:
|
32
|
+
---
|
33
|
+
- name: "yttertrapp"
|
34
|
+
switches:
|
35
|
+
- unit_code: "5"
|
36
|
+
house_code: A
|
37
|
+
model_name: plain_text
|
38
|
+
|
39
|
+
2. Create a schedule in a file called scheduled_actions using the
|
40
|
+
following format:
|
41
|
+
|
42
|
+
tänd yttertrapp klockan 08:15
|
43
|
+
|
44
|
+
where "tänd" is the action, yttertrapp is the device etc. Available
|
45
|
+
actions are "tänd" and "släck". Device names are the ones from step 1.
|
46
|
+
|
47
|
+
3. Copy the files devices and scheduled_actions to the sub-directory db
|
48
|
+
|
49
|
+
4. run ./bin/tsd
|
50
|
+
|
51
|
+
==Communicating with tsd when it is running
|
52
|
+
|
53
|
+
Start IRB from a terminal and use UNIXSocket.open("/tmp/com.adhocskill.trigger_switch_d")
|
54
|
+
to open a socket. Strings that tsd will respond to are:
|
55
|
+
|
56
|
+
* list_schedule
|
57
|
+
* list_devices
|
58
|
+
* bye (disconnects client socket without stopping daemon)
|
59
|
+
* stop (disconnects client socket and stops daemon)
|
60
|
+
|
61
|
+
The list of strings (commands) will get longer with time.
|
62
|
+
|
63
|
+
Here's an example session:
|
64
|
+
|
65
|
+
>> sock = UNIXSocket.open("/tmp/com.adhocskill.trigger_switch_d")
|
66
|
+
=> #<UNIXSocket:0x1017ede78>
|
67
|
+
>> sock.send("list_schedule",0)
|
68
|
+
=> 13
|
69
|
+
>> puts sock.recvfrom(1000)[0]
|
70
|
+
---
|
71
|
+
- "släck källare vid soluppgång"
|
72
|
+
- "släck källare klockan 00:15"
|
73
|
+
- "tänd källare klockan 04:00"
|
74
|
+
- "tänd yttertrapp vid solnedgång"
|
75
|
+
- "släck yttertrapp vid soluppgång"
|
76
|
+
- "tänd källare vid solnedgång"
|
77
|
+
=> nil
|
78
|
+
>> sock.send("bye",0)
|
79
|
+
=> 3
|
80
|
+
>> puts sock.recvfrom(1000)[0]
|
81
|
+
bye
|
82
|
+
=> nil
|
83
|
+
>>
|
84
|
+
|
85
|
+
==Sunrise and sunset
|
86
|
+
You can schedule an action to occur at sunrise or sunset by typing
|
87
|
+
"vid soluppgång" or "vid solnedgång" instead of "klockan HH:MM" when
|
88
|
+
you schedule your actions. As and example:
|
89
|
+
|
90
|
+
släck yttertrapp vid soluppgång
|
91
|
+
|
92
|
+
==Locale
|
93
|
+
The file lookup.dsl in the config folder, contains words associated with the
|
94
|
+
actions. The file is pretty much self explanatory feel free to set the words
|
95
|
+
to the language of your choice.
|
96
|
+
|
97
|
+
==File structure
|
98
|
+
bin:: executable scripts
|
99
|
+
config:: environment files
|
100
|
+
db:: files used by tsd
|
101
|
+
doc:: rdoc documentation of the whole project
|
102
|
+
feature:: cucumber feature/step files
|
103
|
+
lib:: project source
|
104
|
+
log:: scheduled puts a running log here
|
105
|
+
sample:: some sample files to put in db or config
|
106
|
+
spec:: rspec bdd files
|
data/bin/teach
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
# TriggerSwitchD, executes commands to activate/deactive remote switches.
|
4
|
+
# (c) Copyright 2010 Pontus Strömdahl, AdhocSkill.
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#
|
19
|
+
# ==Description
|
20
|
+
# teach is used to make a remote triggered device respond to an action
|
21
|
+
# specified by the user.
|
22
|
+
# ==Usage
|
23
|
+
# 1. Deside what channel/house code, unitcode and protocol/model you
|
24
|
+
# should use for your remote triggered device, for example:
|
25
|
+
#
|
26
|
+
# unit_code: 5
|
27
|
+
# house_code: A
|
28
|
+
# model_name: nexa
|
29
|
+
#
|
30
|
+
# 2. Refer to the documentation for your device to put it in selflearning
|
31
|
+
# mode, and then run:
|
32
|
+
#
|
33
|
+
# ./bin/teach A 5 nexa
|
34
|
+
|
35
|
+
$LOAD_PATH.push File.join(File.dirname(__FILE__),".." ,"lib" )
|
36
|
+
require 'tellstick'
|
37
|
+
|
38
|
+
#code to run tellstick app
|
39
|
+
output = Tellstick::TellstickIO.new
|
40
|
+
stick = Tellstick::create(output,ARGV[2])
|
41
|
+
stick.teach(ARGV[0],ARGV[1])
|
42
|
+
output.close
|
43
|
+
|
44
|
+
|
data/bin/tsd
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
|
2
|
+
|
3
|
+
# ==License
|
4
|
+
# TriggerSwitchD, executes commands to activate/deactive remote switches.
|
5
|
+
# (c) Copyright 2010 Pontus Strömdahl, AdhocSkill.
|
6
|
+
#
|
7
|
+
# This program is free software: you can redistribute it and/or modify
|
8
|
+
# it under the terms of the GNU General Public License as published by
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
10
|
+
# (at your option) any later version.
|
11
|
+
#
|
12
|
+
# This program is distributed in the hope that it will be useful,
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU General Public License
|
18
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
#
|
20
|
+
# ==Description
|
21
|
+
# Scheduled is run as a daemon without any need for user interaction.
|
22
|
+
# It sends commands to remote triggered devices such as lamps and switches,
|
23
|
+
# to activate/deactive them at scheduled times.
|
24
|
+
# ==Usage
|
25
|
+
# 1. Register you remote triggered devices in a file called devices
|
26
|
+
# using the following format:
|
27
|
+
# ---
|
28
|
+
# - name: "yttertrapp"
|
29
|
+
# switches:
|
30
|
+
# - unit_code: "5"
|
31
|
+
# house_code: A
|
32
|
+
# model_name: plain_text
|
33
|
+
#
|
34
|
+
# 2. Create a schedule in a file called scheduled_actions using the
|
35
|
+
# following format:
|
36
|
+
#
|
37
|
+
# tänd yttertrapp klockan 08:15
|
38
|
+
#
|
39
|
+
# where "tänd" is the action, yttertrapp is the device etc. Available
|
40
|
+
# actions are "tänd" and "släck". Device names are the ones from step 1.
|
41
|
+
#
|
42
|
+
# 3. Copy the files devices and scheduled_actions to the sub-directory db
|
43
|
+
#
|
44
|
+
# 4. run ./bin/scheduled
|
45
|
+
#
|
46
|
+
# ==Communicating with scheduled when it is running
|
47
|
+
# Can interact via IPC
|
48
|
+
# ==Sunrise and sunset
|
49
|
+
# You can schedule an action to occur at sunrise or sunset by typing
|
50
|
+
# "vid soluppgång" or "vid solnedgång" instead of "klockan HH:MM" when
|
51
|
+
# you schedule your actions. As and example:
|
52
|
+
#
|
53
|
+
# släck yttertrapp vid soluppgång
|
54
|
+
#
|
55
|
+
# ==Locale
|
56
|
+
# currently swedish to schedule actions
|
57
|
+
|
58
|
+
|
59
|
+
$LOAD_PATH.push File.join(File.dirname(__FILE__),".." ,"lib" )
|
60
|
+
require 'tellstick'
|
61
|
+
require 'trigger_switch_d'
|
62
|
+
|
63
|
+
if $0 == __FILE__
|
64
|
+
file = File.open("config/config.rb","r")
|
65
|
+
app = TriggerSwitchD::Application.new(file)
|
66
|
+
file.close
|
67
|
+
app.start
|
68
|
+
end
|
data/bin/turn_off
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
# TriggerSwitchD, executes commands to activate/deactive remote switches.
|
4
|
+
# (c) Copyright 2010 Pontus Strömdahl, AdhocSkill.
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#
|
19
|
+
# ==Usage
|
20
|
+
# 1. Deside what channel/house code, unitcode and protocol/model you
|
21
|
+
# should use for your remote triggered device, for example:
|
22
|
+
#
|
23
|
+
# unit_code: 5
|
24
|
+
# house_code: A
|
25
|
+
# model_name: nexa
|
26
|
+
#
|
27
|
+
# 2. To turn off device, run:
|
28
|
+
#
|
29
|
+
# ./bin/turn_off A 5 nexa
|
30
|
+
|
31
|
+
|
32
|
+
$LOAD_PATH.push File.join(File.dirname(__FILE__),".." ,"lib" )
|
33
|
+
require 'tellstick'
|
34
|
+
|
35
|
+
#code to run tellstick app
|
36
|
+
output = Tellstick::TellstickIO.new
|
37
|
+
stick = Tellstick::create(output,ARGV[2])
|
38
|
+
stick.turn_off(ARGV[0],ARGV[1])
|
39
|
+
output.close
|
40
|
+
|
41
|
+
|
42
|
+
|
data/bin/turn_on
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
# TriggerSwitchD, executes commands to activate/deactive remote switches.
|
4
|
+
# (c) Copyright 2010 Pontus Strömdahl, AdhocSkill.
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#
|
19
|
+
# ==Usage
|
20
|
+
# 1. Deside what channel/house code, unitcode and protocol/model you
|
21
|
+
# should use for your remote triggered device, for example:
|
22
|
+
#
|
23
|
+
# unit_code: 5
|
24
|
+
# house_code: A
|
25
|
+
# model_name: nexa
|
26
|
+
#
|
27
|
+
# 2. To turn on device, run:
|
28
|
+
#
|
29
|
+
# ./bin/turn_on A 5 nexa
|
30
|
+
|
31
|
+
|
32
|
+
$LOAD_PATH.push File.join(File.dirname(__FILE__),".." ,"lib" )
|
33
|
+
require 'tellstick'
|
34
|
+
|
35
|
+
#code to run tellstick app
|
36
|
+
output = Tellstick::TellstickIO.new
|
37
|
+
stick = Tellstick::create(output,ARGV[2])
|
38
|
+
stick.turn_on(ARGV[0],ARGV[1])
|
39
|
+
output.close
|
@@ -0,0 +1,117 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Tellstick::Tellstick</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Tellstick::Tellstick</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/tellstick/tellstick_rb.html">
|
59
|
+
lib/tellstick/tellstick.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
<div id="description">
|
82
|
+
<p>
|
83
|
+
use create to instasiate
|
84
|
+
</p>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
<!-- if includes -->
|
96
|
+
|
97
|
+
<div id="section">
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
<!-- if method_list -->
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
<div id="validator-badges">
|
113
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
114
|
+
</div>
|
115
|
+
|
116
|
+
</body>
|
117
|
+
</html>
|