tinderfridge 0.2.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinderfridge/device.rb +95 -1
  3. data/lib/tinderfridge/device_collection.rb +69 -0
  4. data/lib/tinderfridge/device_info.txt +5 -0
  5. data/lib/tinderfridge/devices/brick_hat/brick_hat.json +11 -0
  6. data/lib/tinderfridge/devices/brick_hat/brick_hat.rb +18 -0
  7. data/lib/tinderfridge/devices/brick_hat_zero/brick_hat_zero.json +11 -0
  8. data/lib/tinderfridge/devices/brick_hat_zero/brick_hat_zero.rb +14 -0
  9. data/lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.json +10 -0
  10. data/lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.rb +20 -0
  11. data/lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.json +10 -0
  12. data/lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.rb +19 -0
  13. data/lib/tinderfridge/devices/bricklet_analog_in_v3/bricklet_analog_in_v3.json +10 -0
  14. data/lib/tinderfridge/devices/bricklet_analog_out_v3/bricklet_analog_out_v3.json +10 -0
  15. data/lib/tinderfridge/devices/bricklet_barometer_v2/bricklet_barometer_v2.json +10 -0
  16. data/lib/tinderfridge/devices/bricklet_can_v2/bricklet_can_v2.json +11 -0
  17. data/lib/tinderfridge/devices/bricklet_co2_v2/bricklet_co2_v2.json +10 -0
  18. data/lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.json +10 -0
  19. data/lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.rb +31 -0
  20. data/lib/tinderfridge/devices/bricklet_compass/bricklet_compass.json +10 -0
  21. data/lib/tinderfridge/devices/bricklet_dc_v2/bricklet_dc_v2.json +11 -0
  22. data/lib/tinderfridge/devices/bricklet_distance_us_v2/bricklet_distance_us_v2.json +10 -0
  23. data/lib/tinderfridge/devices/bricklet_dmx/bricklet_dmx.json +10 -0
  24. data/lib/tinderfridge/devices/bricklet_dmx/bricklet_dmx.rb +18 -0
  25. data/lib/tinderfridge/devices/bricklet_e_paper_296x128/bricklet_e_paper_296x128.json +10 -0
  26. data/lib/tinderfridge/devices/bricklet_energy_monitor/bricklet_energy_monitor.json +10 -0
  27. data/lib/tinderfridge/devices/bricklet_gps_v2/bricklet_gps_v2.json +10 -0
  28. data/lib/tinderfridge/devices/{bricklet_gps_v2.rb → bricklet_gps_v2/bricklet_gps_v2.rb} +0 -0
  29. data/lib/tinderfridge/devices/bricklet_hall_effect_v2/bricklet_hall_effect_v2.json +10 -0
  30. data/lib/tinderfridge/devices/bricklet_humidity_v2/bricklet_humidity_v2.json +10 -0
  31. data/lib/tinderfridge/devices/bricklet_imu_v3/bricklet_imu_v3.json +10 -0
  32. data/lib/tinderfridge/devices/bricklet_industrial_counter/bricklet_industrial_counter.json +11 -0
  33. data/lib/tinderfridge/devices/bricklet_industrial_digital_in_4_v2/bricklet_industrial_digital_in_4_v2.json +11 -0
  34. data/lib/tinderfridge/devices/bricklet_industrial_digital_out_4_v2/bricklet_industrial_digital_out_4_v2.json +11 -0
  35. data/lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.json +10 -0
  36. data/lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.rb +20 -0
  37. data/lib/tinderfridge/devices/bricklet_industrial_ptc/bricklet_industrial_ptc.json +11 -0
  38. data/lib/tinderfridge/devices/bricklet_industrial_quad_relay_v2/bricklet_industrial_quad_relay_v2.json +11 -0
  39. data/lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.json +10 -0
  40. data/lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.rb +17 -0
  41. data/lib/tinderfridge/devices/bricklet_joystick_v2/bricklet_joystick_v2.json +10 -0
  42. data/lib/tinderfridge/devices/bricklet_joystick_v2/bricklet_joystick_v2.rb +15 -0
  43. data/lib/tinderfridge/devices/bricklet_laser_range_finder_v2/bricklet_laser_range_finder_v2.json +10 -0
  44. data/lib/tinderfridge/devices/bricklet_lcd_128x64/bricklet_lcd_128x64.json +10 -0
  45. data/lib/tinderfridge/devices/{bricklet_lcd_128x64.rb → bricklet_lcd_128x64/bricklet_lcd_128x64.rb} +0 -0
  46. data/lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.json +10 -0
  47. data/lib/tinderfridge/devices/{bricklet_led_strip_v2.rb → bricklet_led_strip_v2/bricklet_led_strip_v2.rb} +12 -0
  48. data/lib/tinderfridge/devices/bricklet_linear_poti_v2/bricklet_linear_poti_v2.json +10 -0
  49. data/lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.json +10 -0
  50. data/lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.rb +22 -0
  51. data/lib/tinderfridge/devices/bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.json +10 -0
  52. data/lib/tinderfridge/devices/bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.rb +42 -0
  53. data/lib/tinderfridge/devices/bricklet_multi_touch_v2/bricklet_multi_touch_v2.json +10 -0
  54. data/lib/tinderfridge/devices/bricklet_multi_touch_v2/bricklet_multi_touch_v2.rb +16 -0
  55. data/lib/tinderfridge/devices/bricklet_nfc/bricklet_nfc.json +10 -0
  56. data/lib/tinderfridge/devices/bricklet_nfc/bricklet_nfc.rb +16 -0
  57. data/lib/tinderfridge/devices/bricklet_oled_128x64_v2/bricklet_oled_128x64_v2.json +11 -0
  58. data/lib/tinderfridge/devices/bricklet_outdoor_weather/bricklet_outdoor_weather.json +10 -0
  59. data/lib/tinderfridge/devices/{bricklet_outdoor_weather.rb → bricklet_outdoor_weather/bricklet_outdoor_weather.rb} +0 -0
  60. data/lib/tinderfridge/devices/bricklet_performance_dc/bricklet_performance_dc.json +11 -0
  61. data/lib/tinderfridge/devices/bricklet_piezo_speaker_v2/bricklet_piezo_speaker_v2.json +10 -0
  62. data/lib/tinderfridge/devices/bricklet_real_time_clock_v2/bricklet_real_time_clock_v2.json +10 -0
  63. data/lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.json +10 -0
  64. data/lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.rb +15 -0
  65. data/lib/tinderfridge/devices/bricklet_rgb_led_button/bricklet_rgb_led_button.json +10 -0
  66. data/lib/tinderfridge/devices/{bricklet_rgb_led_button.rb → bricklet_rgb_led_button/bricklet_rgb_led_button.rb} +9 -0
  67. data/lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.json +10 -0
  68. data/lib/tinderfridge/devices/{bricklet_rgb_led_v2.rb → bricklet_rgb_led_v2/bricklet_rgb_led_v2.rb} +7 -0
  69. data/lib/tinderfridge/devices/bricklet_rotary_encoder_v2/bricklet_rotary_encoder_v2.json +10 -0
  70. data/lib/tinderfridge/devices/bricklet_rotary_encoder_v2/bricklet_rotary_encoder_v2.rb +20 -0
  71. data/lib/tinderfridge/devices/bricklet_rotary_poti_v2/bricklet_rotary_poti_v2.json +10 -0
  72. data/lib/tinderfridge/devices/bricklet_rs232_v2/bricklet_rs232_v2.json +11 -0
  73. data/lib/tinderfridge/devices/bricklet_rs485/bricklet_rs485.json +11 -0
  74. data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.json +10 -0
  75. data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.rb +128 -0
  76. data/lib/tinderfridge/devices/bricklet_servo_v2/bricklet_servo_v2.json +11 -0
  77. data/lib/tinderfridge/devices/bricklet_silent_stepper_v2/bricklet_silent_stepper_v2.json +11 -0
  78. data/lib/tinderfridge/devices/bricklet_sound_pressure_level/bricklet_sound_pressure_level.json +10 -0
  79. data/lib/tinderfridge/devices/bricklet_temperature_ir_v2/bricklet_temperature_ir_v2.json +10 -0
  80. data/lib/tinderfridge/devices/bricklet_temperature_v2/bricklet_temperature_v2.json +10 -0
  81. data/lib/tinderfridge/devices/bricklet_thermal_imaging/bricklet_thermal_imaging.json +10 -0
  82. data/lib/tinderfridge/devices/bricklet_thermocouple_v2/bricklet_thermocouple_v2.json +10 -0
  83. data/lib/tinderfridge/devices/bricklet_uv_light_v2/bricklet_uv_light_v2.json +10 -0
  84. data/lib/tinderfridge/devices/bricklet_voltage_current_v2/bricklet_voltage_current_v2.json +10 -0
  85. data/lib/tinderfridge/devices/bricklet_voltage_current_v2/bricklet_voltage_current_v2.rb +18 -0
  86. data/lib/tinderfridge/devices/bricklet_xmc1400_breakout/bricklet_xmc1400_breakout.json +10 -0
  87. data/lib/tinderfridge/ip_connection.rb +66 -10
  88. data/lib/tinderfridge/tinkerforge.rb +3 -0
  89. data/lib/tinderfridge/version.rb +1 -1
  90. metadata +98 -17
  91. data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2.rb +0 -20
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 20,
5
+ 5
6
+ ],
7
+ "weight": 2,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Compass.html",
9
+ "versions_identifier": "bricklets:compass"
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 15
6
+ ],
7
+ "weight": 12,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/DC_V2.html",
9
+ "versions_identifier": "bricklets:dc_v2",
10
+ "released": "2021-05-04"
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 35,
4
+ 35,
5
+ 20
6
+ ],
7
+ "weight": 9,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Distance_US_V2.html",
9
+ "versions_identifier": "bricklets:distance_us_v2"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 60,
4
+ 50,
5
+ 30
6
+ ],
7
+ "weight": 30,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/DMX.html",
9
+ "versions_identifier": "bricklets:dmx"
10
+ }
@@ -0,0 +1,18 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletDMX
4
+
5
+ # Returns the device's state.
6
+ def state
7
+ super.merge(
8
+ 'dmx_mode' => get_dmx_mode,
9
+ 'frame_duration' => get_frame_duration,
10
+ 'frame_error_count' => get_frame_error_count,
11
+ 'communication_led_config' => get_communication_led_config,
12
+ 'error_led_config' => get_error_led_config,
13
+ )
14
+ end
15
+
16
+ end
17
+
18
+ end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 100,
4
+ 40,
5
+ 6
6
+ ],
7
+ "weight": 20,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/EPaper_296x128.html",
9
+ "versions_identifier": "bricklets:e_paper_296x128"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 5
6
+ ],
7
+ "weight": 7,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Energy_Monitor.html",
9
+ "versions_identifier": "bricklets:energy_monitor"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 35,
5
+ 12
6
+ ],
7
+ "weight": 20,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/GPS_V2.html",
9
+ "versions_identifier": "bricklets:gps_v2"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 15,
5
+ 5
6
+ ],
7
+ "weight": 2,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Hall_Effect_V2.html",
9
+ "versions_identifier": "bricklets:hall_effect_v2"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 15,
5
+ 5
6
+ ],
7
+ "weight": 3,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Humidity_V2.html",
9
+ "versions_identifier": "bricklets:humidity_v2"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 25,
5
+ 5
6
+ ],
7
+ "weight": 3,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/IMU_V3.html",
9
+ "versions_identifier": "bricklets:imu_v3"
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 11
6
+ ],
7
+ "weight": 8.4,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_Counter.html",
9
+ "versions_identifier": "bricklets:industrial_counter",
10
+ "released": "2018-06-07"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 11
6
+ ],
7
+ "weight": 8.6,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_Digital_In_4_V2.html",
9
+ "versions_identifier": "bricklets:industrial_digital_in_4_v2",
10
+ "released": "2018-06-07"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 14
6
+ ],
7
+ "weight": 10,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_Digital_Out_4_V2.html",
9
+ "versions_identifier": "bricklets:industrial_digital_out_4_v2",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 25
6
+ ],
7
+ "weight": 29.4,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_Dual_Relay.html",
9
+ "versions_identifier": "bricklets:industrial_dual_relay"
10
+ }
@@ -0,0 +1,20 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletIndustrialDualRelay
4
+
5
+ # Returns the device's state.
6
+ def state
7
+ super.merge(
8
+ 'relays' => get_value.each_with_index.map do |v,i|
9
+ {
10
+ 'value' => v,
11
+ 'output' => v ? 'A' : 'B',
12
+ 'monoflop' => ['time', 'time_remaining'].zip( get_monoflop(i)[1,2] ).to_h,
13
+ }
14
+ end
15
+ )
16
+ end
17
+
18
+ end
19
+
20
+ end
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 12
6
+ ],
7
+ "weight": 11,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_PTC.html",
9
+ "versions_identifier": "bricklets:industrial_ptc",
10
+ "released": "2021-05-04"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 11
6
+ ],
7
+ "weight": 9,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_Quad_Relay_V2.html",
9
+ "versions_identifier": "bricklets:industrial_quad_relay_v2",
10
+ "released": "2018-06-07"
11
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 30,
4
+ 40,
5
+ 15
6
+ ],
7
+ "weight": 7.1,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Isolator.html",
9
+ "versions_identifier": "bricklets:isolator"
10
+ }
@@ -0,0 +1,17 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletIsolator
4
+
5
+ # Returns the device's state.
6
+ def state
7
+ super.merge(
8
+ 'statistics' => get_statistics,
9
+ 'spitfp_baudrate_config' => get_spitfp_baudrate_config,
10
+ 'spitfp_baudrate' => get_spitfp_baudrate,
11
+ 'isolator_spitfp_error_count' => get_isolator_spitfp_error_count,
12
+ )
13
+ end
14
+
15
+ end
16
+
17
+ end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 45,
5
+ 23
6
+ ],
7
+ "weight": 15,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Joystick_V2.html",
9
+ "versions_identifier": "bricklets:joystick_v2"
10
+ }
@@ -0,0 +1,15 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletJoystickV2
4
+
5
+ # Returns the device's state.
6
+ def state
7
+ super.merge(
8
+ 'position' => get_position,
9
+ 'pressed' => is_pressed,
10
+ )
11
+ end
12
+
13
+ end
14
+
15
+ end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 49,
4
+ 36,
5
+ 45
6
+ ],
7
+ "weight": 30,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Laser_Range_Finder_V2.html",
9
+ "versions_identifier": "bricklets:laser_range_finder_v2"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 55,
4
+ 85,
5
+ 8
6
+ ],
7
+ "weight": 55,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/LCD_128x64.html",
9
+ "versions_identifier": "bricklets:lcd_128x64"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 30,
4
+ 30,
5
+ 12
6
+ ],
7
+ "weight": 8.1,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/LED_Strip_V2.html",
9
+ "versions_identifier": "bricklets:led_strip_v2"
10
+ }
@@ -20,6 +20,18 @@ module Tinkerforge
20
20
  end
21
21
  end
22
22
 
23
+ # Returns the device's state.
24
+ def state
25
+ super.merge(
26
+ 'chip_type' => get_chip_type,
27
+ 'channel_mapping' => get_channel_mapping,
28
+ 'channels' => channels,
29
+ 'frame_duration' => get_frame_duration,
30
+ 'clock_frequency' => get_clock_frequency,
31
+ 'supply_voltage' => get_supply_voltage,
32
+ )
33
+ end
34
+
23
35
  private
24
36
 
25
37
  def lookup_channel_mapping(selector=nil)
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 85,
5
+ 20
6
+ ],
7
+ "weight": 14,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Linear_Poti_V2.html",
9
+ "versions_identifier": "bricklets:linear_poti_v2"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 25,
4
+ 45,
5
+ 30
6
+ ],
7
+ "weight": 6,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Motion_Detector_V2.html",
9
+ "versions_identifier": "bricklets:motion_detector_v2"
10
+ }
@@ -0,0 +1,22 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletMotionDetectorV2
4
+
5
+ # Switches off all three blue backlight LEDs.
6
+ def blackout
7
+ set_indicator(0, 0, 0)
8
+ true
9
+ end
10
+
11
+ # Returns the device's state.
12
+ def state
13
+ super.merge(
14
+ 'motion_detected' => get_motion_detected == 1,
15
+ 'sensitivity' => get_sensitivity,
16
+ 'indicator' => get_indicator,
17
+ )
18
+ end
19
+
20
+ end
21
+
22
+ end
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 145,
4
+ 20,
5
+ 28
6
+ ],
7
+ "weight": 67,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Motorized_Linear_Poti.html",
9
+ "versions_identifier": "bricklets:motorized_linear_poti"
10
+ }
@@ -0,0 +1,42 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletMotorizedLinearPoti
4
+
5
+ # Returns the position of the potentiometer (an integer in the range 0..100).
6
+ def position
7
+ get_position
8
+ end
9
+
10
+ # Moves the potentiometer to the given position.
11
+ #
12
+ # If the potentiometer was locked before, it will be locked at the new position.
13
+ # The drive mode (speed) will be the same as the last time the position was set.
14
+ def position=(position)
15
+ set_motor_position( position, *get_motor_position[1,2] )
16
+ end
17
+
18
+ alias move_to position=
19
+
20
+ # Locks the position of the potentiometer. If a position is given, moves to that position first.
21
+ def lock(position=nil)
22
+ set_motor_position( position || get_position, get_motor_position[1], true )
23
+ end
24
+
25
+ alias hold lock
26
+
27
+ # Releases the potentiometer, so its position can be changed by hand. If a position is given, moves to that position first.
28
+ def release(position=nil)
29
+ set_motor_position( position || get_position, get_motor_position[1], false )
30
+ end
31
+
32
+ # Returns the device's state.
33
+ def state
34
+ super.merge(
35
+ 'position' => get_position,
36
+ 'motor_position' => get_motor_position,
37
+ )
38
+ end
39
+
40
+ end
41
+
42
+ end