tinderfridge 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinderfridge/device.rb +53 -3
  3. data/lib/tinderfridge/device_collection.rb +16 -0
  4. data/lib/tinderfridge/devices/brick_hat/brick_hat.json +10 -0
  5. data/lib/tinderfridge/devices/{brick_hat.rb → brick_hat/brick_hat.rb} +0 -0
  6. data/lib/tinderfridge/devices/brick_hat_zero/brick_hat_zero.json +10 -0
  7. data/lib/tinderfridge/devices/{brick_hat_zero.rb → brick_hat_zero/brick_hat_zero.rb} +0 -0
  8. data/lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.json +3 -0
  9. data/lib/tinderfridge/devices/{bricklet_air_quality.rb → bricklet_air_quality/bricklet_air_quality.rb} +0 -0
  10. data/lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.json +3 -0
  11. data/lib/tinderfridge/devices/{bricklet_ambient_light_v3.rb → bricklet_ambient_light_v3/bricklet_ambient_light_v3.rb} +0 -0
  12. data/lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.json +3 -0
  13. data/lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.rb +31 -0
  14. data/lib/tinderfridge/devices/bricklet_dmx/bricklet_dmx.json +3 -0
  15. data/lib/tinderfridge/devices/{bricklet_dmx.rb → bricklet_dmx/bricklet_dmx.rb} +0 -0
  16. data/lib/tinderfridge/devices/bricklet_gps_v2/bricklet_gps_v2.json +3 -0
  17. data/lib/tinderfridge/devices/{bricklet_gps_v2.rb → bricklet_gps_v2/bricklet_gps_v2.rb} +0 -0
  18. data/lib/tinderfridge/devices/bricklet_imu_v3/bricklet_imu_v3.json +3 -0
  19. data/lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.json +3 -0
  20. data/lib/tinderfridge/devices/{bricklet_industrial_dual_relay.rb → bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.rb} +0 -0
  21. data/lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.json +3 -0
  22. data/lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.rb +17 -0
  23. data/lib/tinderfridge/devices/bricklet_joystick_v2/bricklet_joystick_v2.json +3 -0
  24. data/lib/tinderfridge/devices/{bricklet_joystick_v2.rb → bricklet_joystick_v2/bricklet_joystick_v2.rb} +0 -0
  25. data/lib/tinderfridge/devices/bricklet_lcd_128x64/bricklet_lcd_128x64.json +3 -0
  26. data/lib/tinderfridge/devices/{bricklet_lcd_128x64.rb → bricklet_lcd_128x64/bricklet_lcd_128x64.rb} +0 -0
  27. data/lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.json +3 -0
  28. data/lib/tinderfridge/devices/{bricklet_led_strip_v2.rb → bricklet_led_strip_v2/bricklet_led_strip_v2.rb} +0 -0
  29. data/lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.json +3 -0
  30. data/lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.rb +22 -0
  31. data/lib/tinderfridge/devices/bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.json +3 -0
  32. data/lib/tinderfridge/devices/{bricklet_motorized_linear_poti.rb → bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.rb} +0 -0
  33. data/lib/tinderfridge/devices/bricklet_multi_touch_v2/bricklet_multi_touch_v2.json +3 -0
  34. data/lib/tinderfridge/devices/{bricklet_multi_touch_v2.rb → bricklet_multi_touch_v2/bricklet_multi_touch_v2.rb} +0 -0
  35. data/lib/tinderfridge/devices/bricklet_nfc/bricklet_nfc.json +3 -0
  36. data/lib/tinderfridge/devices/{bricklet_nfc.rb → bricklet_nfc/bricklet_nfc.rb} +0 -0
  37. data/lib/tinderfridge/devices/bricklet_outdoor_weather/bricklet_outdoor_weather.json +3 -0
  38. data/lib/tinderfridge/devices/{bricklet_outdoor_weather.rb → bricklet_outdoor_weather/bricklet_outdoor_weather.rb} +0 -0
  39. data/lib/tinderfridge/devices/bricklet_performance_dc/bricklet_performance_dc.json +3 -0
  40. data/lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.json +3 -0
  41. data/lib/tinderfridge/devices/{bricklet_remote_switch_v2.rb → bricklet_remote_switch_v2/bricklet_remote_switch_v2.rb} +0 -0
  42. data/lib/tinderfridge/devices/bricklet_rgb_led_button/bricklet_rgb_led_button.json +3 -0
  43. data/lib/tinderfridge/devices/{bricklet_rgb_led_button.rb → bricklet_rgb_led_button/bricklet_rgb_led_button.rb} +1 -1
  44. data/lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.json +3 -0
  45. data/lib/tinderfridge/devices/{bricklet_rgb_led_v2.rb → bricklet_rgb_led_v2/bricklet_rgb_led_v2.rb} +0 -0
  46. data/lib/tinderfridge/devices/bricklet_rotary_encoder_v2/bricklet_rotary_encoder_v2.json +3 -0
  47. data/lib/tinderfridge/devices/{bricklet_rotary_encoder_v2.rb → bricklet_rotary_encoder_v2/bricklet_rotary_encoder_v2.rb} +0 -0
  48. data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.json +3 -0
  49. data/lib/tinderfridge/devices/{bricklet_segment_display_4x7_v2.rb → bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.rb} +0 -0
  50. data/lib/tinderfridge/devices/bricklet_servo_v2/bricklet_servo_v2.json +3 -0
  51. data/lib/tinderfridge/devices/bricklet_voltage_current_v2/bricklet_voltage_current_v2.json +3 -0
  52. data/lib/tinderfridge/devices/bricklet_voltage_current_v2/bricklet_voltage_current_v2.rb +18 -0
  53. data/lib/tinderfridge/ip_connection.rb +46 -4
  54. data/lib/tinderfridge/tinkerforge.rb +3 -0
  55. data/lib/tinderfridge/version.rb +1 -1
  56. metadata +51 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7b851b2ea04d7ab8385d6ca4f11cece38721b4cb09dd7afbd449e84d9e4e2a7
4
- data.tar.gz: 19e264699bc41886fe56fa954339d04b118994d39990cb0e834d7a8b5fb1f0e2
3
+ metadata.gz: f93f157ac5afd9dd2b5a6108889f8b00b58df36c16a78faea7fa788ac64ef37d
4
+ data.tar.gz: b28896b7b8938c3d58a043e0c3ff804f253dbcb8fc5b8605ee6fb2efc4a7b92f
5
5
  SHA512:
6
- metadata.gz: 7694f3b62443011a1658034d015a50485f491cee038ce87f820b58e35bf017ce857a21a25a8aae33b92602164100e04a50fc5094679da1164a0592a845852b5b
7
- data.tar.gz: fd7b21aac321ae3b25be1857da5e6c91cbc26d7f3bc839fd5934774de35dd9730a5bdfa13ed103f8d4d3bfb4f533d87a325f01f20ec6db30991a24511a0f6e7d
6
+ metadata.gz: 2b436ea8162a3d32352a3b5d37a6cd3b5efdebb76cb21f51f9cf6fc393ba4a03eaed7bb0385c9471e80eb5c91ba20d56e89e4d425c02f4f7f3475947bf74fc57
7
+ data.tar.gz: 24671e0d6c6ff57bfb4bdb4094919c70803cdb7f63cf814c25c879e3c2d9555cbb803dba3c9dff6cc14cac2a4ad339af754993fcb4594ec8309e70ded461d7b1
@@ -1,6 +1,7 @@
1
1
  require 'tinkerforge/ip_connection'
2
2
 
3
3
  module Tinkerforge
4
+
4
5
  class Device
5
6
 
6
7
  #----------------------------------------------------------------------#
@@ -41,7 +42,7 @@ module Tinkerforge
41
42
  def inherited(klass)
42
43
  if info = Tinkerforge.device_info(klass)
43
44
  begin
44
- require("tinderfridge/devices/#{info[2][1]}")
45
+ require("tinderfridge/devices/#{info[2][1]}/#{info[2][1]}")
45
46
  rescue LoadError
46
47
  # No extension found for this device
47
48
  end
@@ -81,6 +82,16 @@ module Tinkerforge
81
82
  "%s (%s@%s:%s)" % [self.class, @uid_string, ipcon.host, ipcon.port]
82
83
  end
83
84
 
85
+ # Returns the device's properties.
86
+ def properties
87
+ @properties ||= {
88
+ 'device_identifier' => device_identifier,
89
+ 'device_display_name' => device_display_name,
90
+ }.merge load_properties
91
+ end
92
+
93
+ alias props properties
94
+
84
95
  # Returns the device's state.
85
96
  def state
86
97
  identity = get_identity
@@ -88,8 +99,6 @@ module Tinkerforge
88
99
  [
89
100
  [ 'uid' , uid_string ],
90
101
  [ 'update_time' , Time.now.gmtime ],
91
- [ 'device_identifier' , device_identifier ],
92
- [ 'device_display_name', device_display_name ],
93
102
  [ 'firmware_version' , identity[4].join('.') ],
94
103
 
95
104
  [ 'connected', { 'uid' => identity[1], 'position' => identity[2] } ],
@@ -102,6 +111,20 @@ module Tinkerforge
102
111
  ].compact.to_h
103
112
  end
104
113
 
114
+ # Opens the online documentation for the device (Mac OS only).
115
+ #
116
+ # When the URL for the documentation is not known, does nothing.
117
+ def open_documentation
118
+ if properties['documentation_en_url'] and ( RUBY_PLATFORM =~ /darwin/ )
119
+ `open #{properties['documentation_en_url']}`
120
+ properties['documentation_en_url']
121
+ else
122
+ nil
123
+ end
124
+ end
125
+
126
+ alias doc open_documentation
127
+
105
128
  # Identifies a Tinkerforge device by blinking its status led.
106
129
  #
107
130
  # Supports recent devices. When invoked on older devices, does nothing.
@@ -122,5 +145,32 @@ module Tinkerforge
122
145
  end
123
146
  end
124
147
 
148
+ private
149
+
150
+ def load_properties
151
+ if device_info
152
+ properties_file = File.join(
153
+ File.dirname(__FILE__),
154
+ 'devices',
155
+ device_info[2][1],
156
+ device_info[2][1],
157
+ ) + '.json'
158
+
159
+ if File.readable? properties_file
160
+ begin
161
+ require 'json'
162
+ JSON.load File.read properties_file
163
+ rescue
164
+ {}
165
+ end
166
+ else
167
+ {}
168
+ end
169
+ else
170
+ {}
171
+ end
172
+ end
173
+
125
174
  end
175
+
126
176
  end
@@ -63,11 +63,27 @@ module Tinkerforge
63
63
  end.size
64
64
  end
65
65
 
66
+ # Returns the properties of devices in the collection.
67
+ def properties
68
+ smap 'properties'
69
+ end
70
+
71
+ alias props properties
72
+
66
73
  # Returns the state of devices in the collection.
67
74
  def state
68
75
  smap 'state'
69
76
  end
70
77
 
78
+ # Opens the online documentation for the devices in the collection (Mac OS only).
79
+ #
80
+ # When the URL for a device's documentation is not known, does nothing.
81
+ def open_documentation
82
+ smap 'open_documentation'
83
+ end
84
+
85
+ alias doc open_documentation
86
+
71
87
  # Turns off light sources such as screens and RGB LEDs for devices in the collection.
72
88
  #
73
89
  # Ignores devices that do not support the blackout method.
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 65,
4
+ 56,
5
+ 25
6
+ ],
7
+ "weight": 30,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricks/HAT_Brick.html",
9
+ "versions_identifier": "bricklets:hat"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "dimensions": [
3
+ 65,
4
+ 30,
5
+ 5
6
+ ],
7
+ "weight": 12,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricks/HAT_Zero_Brick.html",
9
+ "versions_identifier": "bricklets:hat_zero"
10
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Air_Quality.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Ambient_Light_V3.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Color_V2.html"
3
+ }
@@ -0,0 +1,31 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletColorV2
4
+
5
+ GAINS = [1, 4, 16, 60]
6
+ INTEGRATION_TIMES = [2.4, 24, 101, 154, 700]
7
+
8
+ # Switches off the Bricklet's white LED.
9
+ def blackout
10
+ set_light false
11
+ true
12
+ end
13
+
14
+ # Returns the device's state.
15
+ def state
16
+ super.merge(
17
+ 'configuration' => config = get_configuration,
18
+ 'gain' => GAINS[ config[0] ],
19
+ 'integration_time' => INTEGRATION_TIMES[ config[1] ],
20
+ 'color_rgbc' => color = get_color,
21
+ 'illuminance_raw' => illum = get_illuminance,
22
+ 'illuminance' => illum * 700.0 / GAINS[ config[0] ] / INTEGRATION_TIMES[ config[1] ],
23
+ 'color_temperature' => get_color_temperature,
24
+ 'saturated' => color[0,3].include?(65535),
25
+ 'light' => get_light,
26
+ )
27
+ end
28
+
29
+ end
30
+
31
+ end
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/DMX.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/GPS_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/IMU_V3.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_Dual_Relay.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Isolator.html"
3
+ }
@@ -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,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Joystick_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/LCD_128x64.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/LED_Strip_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Motion_Detector_V2.html"
3
+ }
@@ -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,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Motorized_Linear_Poti.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Multi_Touch_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/NFC.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Outdoor_Weather.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Performance_DC.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Remote_Switch_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/RGB_LED_Button.html"
3
+ }
@@ -25,7 +25,7 @@ module Tinkerforge
25
25
  super.merge(
26
26
  'color_rgb' => get_color,
27
27
  'color_calibration' => get_color_calibration,
28
- 'pressed' => ( get_button_state == 0 ) ? true : false,
28
+ 'pressed' => get_button_state == 0,
29
29
  )
30
30
  end
31
31
 
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/RGB_LED_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Rotary_Encoder_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Segment_Display_4x7_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Servo_V2.html"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Voltage_Current_V2.html"
3
+ }
@@ -0,0 +1,18 @@
1
+ module Tinkerforge
2
+
3
+ class BrickletVoltageCurrentV2
4
+
5
+ # Returns the device's state.
6
+ def state
7
+ super.merge(
8
+ 'voltage' => get_voltage,
9
+ 'current' => get_current,
10
+ 'power' => get_power,
11
+ 'configuration' => get_configuration,
12
+ 'calibration' => get_calibration,
13
+ )
14
+ end
15
+
16
+ end
17
+
18
+ end
@@ -4,10 +4,10 @@ module Tinkerforge
4
4
 
5
5
  class IPConnection
6
6
 
7
- # Returns the host for the IP Connection object.
7
+ # Returns the host for the IP Connection.
8
8
  attr_reader :host
9
9
 
10
- # Returns the port for the IP Connection object.
10
+ # Returns the port for the IP Connection.
11
11
  attr_reader :port
12
12
 
13
13
  # Returns a programmer-friendly representation of the object.
@@ -15,11 +15,36 @@ module Tinkerforge
15
15
  "%s (%s:%s)" % [self.class, host, port]
16
16
  end
17
17
 
18
+ # Returns the state of the IP Connection.
19
+ def state
20
+ {
21
+ 'host' => host,
22
+ 'port' => port,
23
+ 'connection_state' => get_connection_state,
24
+ 'auto_reconnect' => get_auto_reconnect,
25
+ 'timeout' => get_timeout,
26
+ 'log_size' => log_size,
27
+ }
28
+ end
29
+
18
30
  # Returns true if connected to localhost, false if connected via the network.
19
31
  def localhost?
20
32
  @localhost ||= %w(localhost 127.0.0.1 ::1).include? host
21
33
  end
22
34
 
35
+ # Returns the size (in bytes) of the Brick Daemon log file, if connected to localhost. Nil if connected via the network.
36
+ def log_size
37
+ if local_log_path
38
+ if File.exist? local_log_path
39
+ File.size local_log_path
40
+ else
41
+ 0
42
+ end
43
+ else
44
+ nil
45
+ end
46
+ end
47
+
23
48
  # Returns a Tinkerforge::DeviceCollection with devices discovered for this IP Connection. Discovery may take a few moments.
24
49
  #
25
50
  # Accepts an optional argument for the number of seconds to wait, otherwise returns immediately.
@@ -42,7 +67,9 @@ module Tinkerforge
42
67
  case args[6]
43
68
  when 0, 1
44
69
  unless list.key?(args[0])
45
- list[args[0]] = device_instance_from_enum_data(args)
70
+ if dev = device_instance_from_enum_data(args)
71
+ list[args[0]] = dev
72
+ end
46
73
  end
47
74
  when 2
48
75
  list.delete args[0]
@@ -58,13 +85,28 @@ module Tinkerforge
58
85
 
59
86
  private
60
87
 
88
+ # The path for the Brick Daemon log file, if connected to Brickd on the same computer.
89
+ def local_log_path
90
+ @local_log_path ||=
91
+ if localhost?
92
+ if Gem.win_platform?
93
+ 'C:\ProgramData\Tinkerforge\Brickd\brickd.log'
94
+ else
95
+ '/var/log/brickd.log'
96
+ end
97
+ else
98
+ nil
99
+ end
100
+ end
101
+
61
102
  # Takes the args supplied by an enumeration callback, and returns a device instance.
62
103
  def device_instance_from_enum_data(enum_data)
63
104
  if dev_info = Tinkerforge.device_info(enum_data[5])
64
105
  require "tinkerforge/#{dev_info[2][1]}"
65
106
  Tinkerforge.const_get(dev_info[2][0]).new enum_data[0], self
66
107
  else
67
- raise "Unknown device type #{enum_data[5]} (#{enum_data[0]})"
108
+ warn "Unknown Device Identifier: #{enum_data[5]} (UID: #{enum_data[0]})"
109
+ nil
68
110
  end
69
111
  end
70
112
 
@@ -2,6 +2,9 @@ require 'tinkerforge/ip_connection'
2
2
 
3
3
  module Tinkerforge
4
4
 
5
+ ALL_VERSIONS_URL = 'https://download.tinkerforge.com/all_versions.txt'
6
+ LATEST_VERSIONS_URL = 'https://download.tinkerforge.com/latest_versions.txt'
7
+
5
8
  # Returns the directory where Tinkerforge bindings appear to be installed.
6
9
  def self.lib_dir
7
10
  File.dirname File.dirname Device.instance_method('uid').source_location.first
@@ -3,7 +3,7 @@ require 'tinkerforge/version'
3
3
  module Tinkerforge
4
4
 
5
5
  # Tinderfridge version.
6
- TINDERFRIDGE_VERSION = '0.5.0'
6
+ TINDERFRIDGE_VERSION = '0.6.0'
7
7
 
8
8
  # About Tinkerforge & Tinderfridge.
9
9
  def self.about
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinderfridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - lllist.eu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-12 00:00:00.000000000 Z
11
+ date: 2021-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tinkerforge
@@ -41,25 +41,55 @@ files:
41
41
  - lib/tinderfridge/device_collection.rb
42
42
  - lib/tinderfridge/device_info.rb
43
43
  - lib/tinderfridge/device_info.txt
44
- - lib/tinderfridge/devices/brick_hat.rb
45
- - lib/tinderfridge/devices/brick_hat_zero.rb
46
- - lib/tinderfridge/devices/bricklet_air_quality.rb
47
- - lib/tinderfridge/devices/bricklet_ambient_light_v3.rb
48
- - lib/tinderfridge/devices/bricklet_dmx.rb
49
- - lib/tinderfridge/devices/bricklet_gps_v2.rb
50
- - lib/tinderfridge/devices/bricklet_industrial_dual_relay.rb
51
- - lib/tinderfridge/devices/bricklet_joystick_v2.rb
52
- - lib/tinderfridge/devices/bricklet_lcd_128x64.rb
53
- - lib/tinderfridge/devices/bricklet_led_strip_v2.rb
54
- - lib/tinderfridge/devices/bricklet_motorized_linear_poti.rb
55
- - lib/tinderfridge/devices/bricklet_multi_touch_v2.rb
56
- - lib/tinderfridge/devices/bricklet_nfc.rb
57
- - lib/tinderfridge/devices/bricklet_outdoor_weather.rb
58
- - lib/tinderfridge/devices/bricklet_remote_switch_v2.rb
59
- - lib/tinderfridge/devices/bricklet_rgb_led_button.rb
60
- - lib/tinderfridge/devices/bricklet_rgb_led_v2.rb
61
- - lib/tinderfridge/devices/bricklet_rotary_encoder_v2.rb
62
- - lib/tinderfridge/devices/bricklet_segment_display_4x7_v2.rb
44
+ - lib/tinderfridge/devices/brick_hat/brick_hat.json
45
+ - lib/tinderfridge/devices/brick_hat/brick_hat.rb
46
+ - lib/tinderfridge/devices/brick_hat_zero/brick_hat_zero.json
47
+ - lib/tinderfridge/devices/brick_hat_zero/brick_hat_zero.rb
48
+ - lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.json
49
+ - lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.rb
50
+ - lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.json
51
+ - lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.rb
52
+ - lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.json
53
+ - lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.rb
54
+ - lib/tinderfridge/devices/bricklet_dmx/bricklet_dmx.json
55
+ - lib/tinderfridge/devices/bricklet_dmx/bricklet_dmx.rb
56
+ - lib/tinderfridge/devices/bricklet_gps_v2/bricklet_gps_v2.json
57
+ - lib/tinderfridge/devices/bricklet_gps_v2/bricklet_gps_v2.rb
58
+ - lib/tinderfridge/devices/bricklet_imu_v3/bricklet_imu_v3.json
59
+ - lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.json
60
+ - lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.rb
61
+ - lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.json
62
+ - lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.rb
63
+ - lib/tinderfridge/devices/bricklet_joystick_v2/bricklet_joystick_v2.json
64
+ - lib/tinderfridge/devices/bricklet_joystick_v2/bricklet_joystick_v2.rb
65
+ - lib/tinderfridge/devices/bricklet_lcd_128x64/bricklet_lcd_128x64.json
66
+ - lib/tinderfridge/devices/bricklet_lcd_128x64/bricklet_lcd_128x64.rb
67
+ - lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.json
68
+ - lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.rb
69
+ - lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.json
70
+ - lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.rb
71
+ - lib/tinderfridge/devices/bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.json
72
+ - lib/tinderfridge/devices/bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.rb
73
+ - lib/tinderfridge/devices/bricklet_multi_touch_v2/bricklet_multi_touch_v2.json
74
+ - lib/tinderfridge/devices/bricklet_multi_touch_v2/bricklet_multi_touch_v2.rb
75
+ - lib/tinderfridge/devices/bricklet_nfc/bricklet_nfc.json
76
+ - lib/tinderfridge/devices/bricklet_nfc/bricklet_nfc.rb
77
+ - lib/tinderfridge/devices/bricklet_outdoor_weather/bricklet_outdoor_weather.json
78
+ - lib/tinderfridge/devices/bricklet_outdoor_weather/bricklet_outdoor_weather.rb
79
+ - lib/tinderfridge/devices/bricklet_performance_dc/bricklet_performance_dc.json
80
+ - lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.json
81
+ - lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.rb
82
+ - lib/tinderfridge/devices/bricklet_rgb_led_button/bricklet_rgb_led_button.json
83
+ - lib/tinderfridge/devices/bricklet_rgb_led_button/bricklet_rgb_led_button.rb
84
+ - lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.json
85
+ - lib/tinderfridge/devices/bricklet_rgb_led_v2/bricklet_rgb_led_v2.rb
86
+ - lib/tinderfridge/devices/bricklet_rotary_encoder_v2/bricklet_rotary_encoder_v2.json
87
+ - lib/tinderfridge/devices/bricklet_rotary_encoder_v2/bricklet_rotary_encoder_v2.rb
88
+ - lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.json
89
+ - lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.rb
90
+ - lib/tinderfridge/devices/bricklet_servo_v2/bricklet_servo_v2.json
91
+ - lib/tinderfridge/devices/bricklet_voltage_current_v2/bricklet_voltage_current_v2.json
92
+ - lib/tinderfridge/devices/bricklet_voltage_current_v2/bricklet_voltage_current_v2.rb
63
93
  - lib/tinderfridge/ip_connection.rb
64
94
  - lib/tinderfridge/tinkerforge.rb
65
95
  - lib/tinderfridge/version.rb