tinkerforge 2.0.12 → 2.0.13
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/lib/tinkerforge/brick_dc.rb +2 -2
- data/lib/tinkerforge/brick_imu.rb +2 -2
- data/lib/tinkerforge/brick_master.rb +2 -2
- data/lib/tinkerforge/brick_servo.rb +2 -2
- data/lib/tinkerforge/brick_stepper.rb +2 -2
- data/lib/tinkerforge/bricklet_ambient_light.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_in.rb +2 -2
- data/lib/tinkerforge/bricklet_analog_out.rb +2 -2
- data/lib/tinkerforge/bricklet_barometer.rb +2 -2
- data/lib/tinkerforge/bricklet_current12.rb +2 -2
- data/lib/tinkerforge/bricklet_current25.rb +2 -2
- data/lib/tinkerforge/bricklet_distance_ir.rb +2 -2
- data/lib/tinkerforge/bricklet_distance_us.rb +2 -2
- data/lib/tinkerforge/bricklet_dual_button.rb +2 -2
- data/lib/tinkerforge/bricklet_dual_relay.rb +2 -2
- data/lib/tinkerforge/bricklet_gps.rb +28 -25
- data/lib/tinkerforge/bricklet_hall_effect.rb +2 -2
- data/lib/tinkerforge/bricklet_humidity.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_digital_in_4.rb +12 -13
- data/lib/tinkerforge/bricklet_industrial_digital_out_4.rb +11 -12
- data/lib/tinkerforge/bricklet_industrial_dual_0_20ma.rb +2 -2
- data/lib/tinkerforge/bricklet_industrial_quad_relay.rb +11 -12
- data/lib/tinkerforge/bricklet_io16.rb +20 -19
- data/lib/tinkerforge/bricklet_io4.rb +22 -22
- data/lib/tinkerforge/bricklet_joystick.rb +2 -2
- data/lib/tinkerforge/bricklet_lcd_16x2.rb +2 -2
- data/lib/tinkerforge/bricklet_lcd_20x4.rb +2 -2
- data/lib/tinkerforge/bricklet_led_strip.rb +47 -6
- data/lib/tinkerforge/bricklet_line.rb +2 -2
- data/lib/tinkerforge/bricklet_linear_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_moisture.rb +2 -2
- data/lib/tinkerforge/bricklet_motion_detector.rb +7 -3
- data/lib/tinkerforge/bricklet_multi_touch.rb +2 -2
- data/lib/tinkerforge/bricklet_piezo_buzzer.rb +2 -2
- data/lib/tinkerforge/bricklet_piezo_speaker.rb +2 -2
- data/lib/tinkerforge/bricklet_ptc.rb +2 -2
- data/lib/tinkerforge/bricklet_remote_switch.rb +71 -11
- data/lib/tinkerforge/bricklet_rotary_encoder.rb +2 -2
- data/lib/tinkerforge/bricklet_rotary_poti.rb +2 -2
- data/lib/tinkerforge/bricklet_segment_display_4x7.rb +2 -2
- data/lib/tinkerforge/bricklet_sound_intensity.rb +2 -2
- data/lib/tinkerforge/bricklet_temperature.rb +2 -2
- data/lib/tinkerforge/bricklet_temperature_ir.rb +2 -2
- data/lib/tinkerforge/bricklet_tilt.rb +2 -2
- data/lib/tinkerforge/bricklet_voltage.rb +2 -2
- data/lib/tinkerforge/bricklet_voltage_current.rb +2 -2
- data/lib/tinkerforge/version.rb +1 -1
- metadata +2 -2
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -22,6 +22,10 @@ module Tinkerforge
|
|
22
22
|
FUNCTION_GET_SWITCHING_STATE = 2 # :nodoc:
|
23
23
|
FUNCTION_SET_REPEATS = 4 # :nodoc:
|
24
24
|
FUNCTION_GET_REPEATS = 5 # :nodoc:
|
25
|
+
FUNCTION_SWITCH_SOCKET_A = 6 # :nodoc:
|
26
|
+
FUNCTION_SWITCH_SOCKET_B = 7 # :nodoc:
|
27
|
+
FUNCTION_DIM_SOCKET_B = 8 # :nodoc:
|
28
|
+
FUNCTION_SWITCH_SOCKET_C = 9 # :nodoc:
|
25
29
|
FUNCTION_GET_IDENTITY = 255 # :nodoc:
|
26
30
|
|
27
31
|
SWITCH_TO_OFF = 0 # :nodoc:
|
@@ -34,23 +38,23 @@ module Tinkerforge
|
|
34
38
|
def initialize(uid, ipcon)
|
35
39
|
super uid, ipcon
|
36
40
|
|
37
|
-
@api_version = [2, 0,
|
41
|
+
@api_version = [2, 0, 1]
|
38
42
|
|
39
43
|
@response_expected[FUNCTION_SWITCH_SOCKET] = RESPONSE_EXPECTED_FALSE
|
40
44
|
@response_expected[FUNCTION_GET_SWITCHING_STATE] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
41
45
|
@response_expected[CALLBACK_SWITCHING_DONE] = RESPONSE_EXPECTED_ALWAYS_FALSE
|
42
46
|
@response_expected[FUNCTION_SET_REPEATS] = RESPONSE_EXPECTED_FALSE
|
43
47
|
@response_expected[FUNCTION_GET_REPEATS] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
48
|
+
@response_expected[FUNCTION_SWITCH_SOCKET_A] = RESPONSE_EXPECTED_FALSE
|
49
|
+
@response_expected[FUNCTION_SWITCH_SOCKET_B] = RESPONSE_EXPECTED_FALSE
|
50
|
+
@response_expected[FUNCTION_DIM_SOCKET_B] = RESPONSE_EXPECTED_FALSE
|
51
|
+
@response_expected[FUNCTION_SWITCH_SOCKET_C] = RESPONSE_EXPECTED_FALSE
|
44
52
|
@response_expected[FUNCTION_GET_IDENTITY] = RESPONSE_EXPECTED_ALWAYS_TRUE
|
45
53
|
|
46
54
|
@callback_formats[CALLBACK_SWITCHING_DONE] = ''
|
47
55
|
end
|
48
56
|
|
49
|
-
#
|
50
|
-
# state (on or off) you want to switch to.
|
51
|
-
#
|
52
|
-
# A detailed description on how you can find the house and receiver code
|
53
|
-
# can be found :ref:`here <remote_switch_bricklet_house_and_receiver_code>`.
|
57
|
+
# This function is deprecated, use BrickletRemoteSwitch#switch_socket_a instead.
|
54
58
|
def switch_socket(house_code, receiver_code, switch_to)
|
55
59
|
send_request(FUNCTION_SWITCH_SOCKET, [house_code, receiver_code, switch_to], 'C C C', 0, '')
|
56
60
|
end
|
@@ -65,9 +69,9 @@ module Tinkerforge
|
|
65
69
|
send_request(FUNCTION_GET_SWITCHING_STATE, [], '', 1, 'C')
|
66
70
|
end
|
67
71
|
|
68
|
-
# Sets the number of times the code is send when BrickletRemoteSwitch#switch_socket
|
69
|
-
# The repeats basically correspond to the amount of time
|
70
|
-
# remote is pressed.
|
72
|
+
# Sets the number of times the code is send when of the BrickletRemoteSwitch#switch_socket
|
73
|
+
# functions is called. The repeats basically correspond to the amount of time
|
74
|
+
# that a button of the remote is pressed.
|
71
75
|
#
|
72
76
|
# Some dimmers are controlled by the length of a button pressed,
|
73
77
|
# this can be simulated by increasing the repeats.
|
@@ -82,6 +86,62 @@ module Tinkerforge
|
|
82
86
|
send_request(FUNCTION_GET_REPEATS, [], '', 1, 'C')
|
83
87
|
end
|
84
88
|
|
89
|
+
# To switch a type A socket you have to give the house code, receiver code and the
|
90
|
+
# state (on or off) you want to switch to.
|
91
|
+
#
|
92
|
+
# The house code and receiver code have a range of 0 to 31 (5bit).
|
93
|
+
#
|
94
|
+
# A detailed description on how you can figure out the house and receiver code
|
95
|
+
# can be found :ref:`here <remote_switch_bricklet_type_a_house_and_receiver_code>`.
|
96
|
+
#
|
97
|
+
# .. versionadded:: 2.0.1~(Plugin)
|
98
|
+
def switch_socket_a(house_code, receiver_code, switch_to)
|
99
|
+
send_request(FUNCTION_SWITCH_SOCKET_A, [house_code, receiver_code, switch_to], 'C C C', 0, '')
|
100
|
+
end
|
101
|
+
|
102
|
+
# To switch a type B socket you have to give the address, unit and the state
|
103
|
+
# (on or off) you want to switch to.
|
104
|
+
#
|
105
|
+
# The address has a range of 0 to 67108863 (26bit) and the unit has a range
|
106
|
+
# of 0 to 15 (4bit). To switch all devices with the same address use 255 for
|
107
|
+
# the unit.
|
108
|
+
#
|
109
|
+
# A detailed description on how you can teach a socket the address and unit can
|
110
|
+
# be found :ref:`here <remote_switch_bricklet_type_b_address_and_unit>`.
|
111
|
+
#
|
112
|
+
# .. versionadded:: 2.0.1~(Plugin)
|
113
|
+
def switch_socket_b(address, unit, switch_to)
|
114
|
+
send_request(FUNCTION_SWITCH_SOCKET_B, [address, unit, switch_to], 'L C C', 0, '')
|
115
|
+
end
|
116
|
+
|
117
|
+
# To control a type B dimmer you have to give the address, unit and the
|
118
|
+
# dim value you want to set the dimmer to.
|
119
|
+
#
|
120
|
+
# The address has a range of 0 to 67108863 (26bit), the unit and the dim value
|
121
|
+
# has a range of 0 to 15 (4bit).
|
122
|
+
#
|
123
|
+
# A detailed description on how you can teach a dimmer the address and unit can
|
124
|
+
# be found :ref:`here <remote_switch_bricklet_type_b_address_and_unit>`.
|
125
|
+
#
|
126
|
+
# .. versionadded:: 2.0.1~(Plugin)
|
127
|
+
def dim_socket_b(address, unit, dim_value)
|
128
|
+
send_request(FUNCTION_DIM_SOCKET_B, [address, unit, dim_value], 'L C C', 0, '')
|
129
|
+
end
|
130
|
+
|
131
|
+
# To switch a type C socket you have to give the system code, device code and the
|
132
|
+
# state (on or off) you want to switch to.
|
133
|
+
#
|
134
|
+
# The system code has a range of 'A' to 'P' (4bit) and the device code has a
|
135
|
+
# range of 1 to 16 (4bit).
|
136
|
+
#
|
137
|
+
# A detailed description on how you can figure out the system and device code
|
138
|
+
# can be found :ref:`here <remote_switch_bricklet_type_c_system_and_device_code>`.
|
139
|
+
#
|
140
|
+
# .. versionadded:: 2.0.1~(Plugin)
|
141
|
+
def switch_socket_c(system_code, device_code, switch_to)
|
142
|
+
send_request(FUNCTION_SWITCH_SOCKET_C, [system_code, device_code, switch_to], 'k C C', 0, '')
|
143
|
+
end
|
144
|
+
|
85
145
|
# Returns the UID, the UID where the Bricklet is connected to,
|
86
146
|
# the position, the hardware and firmware version as well as the
|
87
147
|
# device identifier.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- ruby encoding: utf-8 -*-
|
2
2
|
#############################################################
|
3
|
-
# This file was automatically generated on 2013-
|
3
|
+
# This file was automatically generated on 2013-12-19. #
|
4
4
|
# #
|
5
|
-
# Bindings Version 2.0.
|
5
|
+
# Bindings Version 2.0.13 #
|
6
6
|
# #
|
7
7
|
# If you have a bugfix for this file and want to commit it, #
|
8
8
|
# please fix the bug in the generator. You can find a link #
|
data/lib/tinkerforge/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinkerforge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email: matthias@tinkerforge.com
|