tinderfridge 0.7.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tinderfridge/devices/bricklet_accelerometer_v2/bricklet_accelerometer_v2.json +11 -0
  3. data/lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.json +2 -1
  4. data/lib/tinderfridge/devices/bricklet_analog_out_v3/bricklet_analog_out_v3.json +2 -1
  5. data/lib/tinderfridge/devices/bricklet_barometer_v2/bricklet_barometer_v2.json +2 -1
  6. data/lib/tinderfridge/devices/bricklet_distance_ir_v2/bricklet_distance_ir_v2.json +11 -0
  7. data/lib/tinderfridge/devices/bricklet_dual_button_v2/bricklet_dual_button_v2.json +11 -0
  8. data/lib/tinderfridge/devices/bricklet_industrial_analog_out_v2/bricklet_industrial_analog_out_v2.json +11 -0
  9. data/lib/tinderfridge/devices/bricklet_industrial_dual_0_20ma_v2/bricklet_industrial_dual_0_20ma_v2.json +11 -0
  10. data/lib/tinderfridge/devices/bricklet_industrial_dual_ac_relay/bricklet_industrial_dual_ac_relay.json +11 -0
  11. data/lib/tinderfridge/devices/bricklet_industrial_dual_analog_in_v2/bricklet_industrial_dual_analog_in_v2.json +11 -0
  12. data/lib/tinderfridge/devices/bricklet_io16_v2/bricklet_io16_v2.json +11 -0
  13. data/lib/tinderfridge/devices/bricklet_io4_v2/bricklet_io4_v2.json +11 -0
  14. data/lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.json +2 -1
  15. data/lib/tinderfridge/devices/bricklet_load_cell_v2/bricklet_load_cell_v2.json +11 -0
  16. data/lib/tinderfridge/devices/bricklet_one_wire/bricklet_one_wire.json +11 -0
  17. data/lib/tinderfridge/devices/bricklet_particulate_matter/bricklet_particulate_matter.json +11 -0
  18. data/lib/tinderfridge/devices/bricklet_ptc_v2/bricklet_ptc_v2.json +11 -0
  19. data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.json +2 -1
  20. data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.rb +23 -1
  21. data/lib/tinderfridge/devices/bricklet_solid_state_relay_v2/bricklet_solid_state_relay_v2.json +11 -0
  22. data/lib/tinderfridge/version.rb +1 -1
  23. metadata +18 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61c196b035feb056ef219545b4fb18b0d31143ec45dce191fd24abba736c6c06
4
- data.tar.gz: b8f7e262293e0c1f42648f57360818bc160bef744d3bf4e1424c31f81658fe84
3
+ metadata.gz: c1f848437f1877596a58521fdbe213042f6561b42a91c91b60eca2fd3ab1a690
4
+ data.tar.gz: '09c7adcf40fabf6eae5ca89316428aeb6cabfa5f4abccbaaf27bd3901535afca'
5
5
  SHA512:
6
- metadata.gz: 68b64abcf925c879f4962b505c4ae06b9cdf3d4fad9964c34e1d33cbe1dc72fffee805a7a1651fe9b4d0cdc3c2c93a53a593dafdc0ad28f8fea93e20a3fc2c0b
7
- data.tar.gz: b3a2980b1f8d21b9044b59b8e40b62bf148fc5a18505b3391f1c7047796df5139e2782e50872cac01acf1a29bb8b52cfe14fea0fca8b706c9a6fb3d120ebbfc5
6
+ metadata.gz: a84bc2687015ef1c65dd61cac031a7b6e6ff57e22a811784e6160dd5b002badf5f55f11c3883ffa754a6f42d0b5a6e5a085a4c930700c899956d06ec8f533d98
7
+ data.tar.gz: c12dcf3ef70b1111f665a3098ab213a75819c2953b3c7cb2ebc020bd00b016588ec70ca0bebbdf72666a84edcc4be345f7aaa67c8ee4f8841262c1fc4afb80a7
@@ -0,0 +1,11 @@
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/Accelerometer_V2.html",
9
+ "versions_identifier": "bricklets:accelerometer_v2",
10
+ "released": "2019-01-29"
11
+ }
@@ -6,5 +6,6 @@
6
6
  ],
7
7
  "weight": 2.1,
8
8
  "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Air_Quality.html",
9
- "versions_identifier": "bricklets:air_quality"
9
+ "versions_identifier": "bricklets:air_quality",
10
+ "released": "2018-09-27"
10
11
  }
@@ -6,5 +6,6 @@
6
6
  ],
7
7
  "weight": 8,
8
8
  "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Analog_Out_V3.html",
9
- "versions_identifier": "bricklets:analog_out_v3"
9
+ "versions_identifier": "bricklets:analog_out_v3",
10
+ "released": "2018-09-27"
10
11
  }
@@ -6,5 +6,6 @@
6
6
  ],
7
7
  "weight": 1.6,
8
8
  "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Barometer_V2.html",
9
- "versions_identifier": "bricklets:barometer_v2"
9
+ "versions_identifier": "bricklets:barometer_v2",
10
+ "released": "2018-09-27"
10
11
  }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 45,
4
+ 13,
5
+ 5
6
+ ],
7
+ "weight": 8,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Distance_IR_V2.html",
9
+ "versions_identifier": "bricklets:distance_ir_v2",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 45,
4
+ 20,
5
+ 10
6
+ ],
7
+ "weight": 5.5,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Dual_Button_V2.html",
9
+ "versions_identifier": "bricklets:dual_button_v2",
10
+ "released": "2018-09-27"
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_Analog_Out_V2.html",
9
+ "versions_identifier": "bricklets:industrial_analog_out_v2",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 11
6
+ ],
7
+ "weight": 8,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_Dual_020mA_V2.html",
9
+ "versions_identifier": "bricklets:industrial_dual_0_20ma_v2",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 40,
4
+ 40,
5
+ 16
6
+ ],
7
+ "weight": 11,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Industrial_Dual_AC_Relay.html",
9
+ "versions_identifier": "bricklets:industrial_dual_ac_relay",
10
+ "released": "2020-10-27"
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_Dual_Analog_In_V2.html",
9
+ "versions_identifier": "bricklets:industrial_dual_analog_in_v2",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 35,
4
+ 75,
5
+ 14
6
+ ],
7
+ "weight": 30,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/IO16_V2.html",
9
+ "versions_identifier": "bricklets:io16_v2",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 35,
4
+ 35,
5
+ 14
6
+ ],
7
+ "weight": 15,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/IO4_V2.html",
9
+ "versions_identifier": "bricklets:io4_v2",
10
+ "released": "2018-06-07"
11
+ }
@@ -6,5 +6,6 @@
6
6
  ],
7
7
  "weight": 8.1,
8
8
  "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/LED_Strip_V2.html",
9
- "versions_identifier": "bricklets:led_strip_v2"
9
+ "versions_identifier": "bricklets:led_strip_v2",
10
+ "released": "2018-06-07"
10
11
  }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 30,
4
+ 30,
5
+ 14
6
+ ],
7
+ "weight": 7.3,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Load_Cell_V2.html",
9
+ "versions_identifier": "bricklets:load_cell_v2",
10
+ "released": "2018-06-07"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 30,
4
+ 30,
5
+ 14
6
+ ],
7
+ "weight": 6.5,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/One_Wire.html",
9
+ "versions_identifier": "bricklets:one_wire",
10
+ "released": "2018-09-27"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 70,
4
+ 40,
5
+ 15
6
+ ],
7
+ "weight": 36.3,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Particulate_Matter.html",
9
+ "versions_identifier": "bricklets:particulate_matter",
10
+ "released": "2018-06-07"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 35,
4
+ 30,
5
+ 15
6
+ ],
7
+ "weight": 9,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/PTC_V2.html",
9
+ "versions_identifier": "bricklets:ptc_v2",
10
+ "released": "2018-06-07"
11
+ }
@@ -6,5 +6,6 @@
6
6
  ],
7
7
  "weight": 11,
8
8
  "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Segment_Display_4x7_V2.html",
9
- "versions_identifier": "bricklets:segment_display_4x7_v2"
9
+ "versions_identifier": "bricklets:segment_display_4x7_v2",
10
+ "released": "2019-05-20"
10
11
  }
@@ -12,7 +12,7 @@ module Tinkerforge
12
12
 
13
13
  # Returns the state of all 35 segments.
14
14
  def segments
15
- send_request FUNCTION_GET_SEGMENTS, [], '', 14, '?35'
15
+ get_segments.flatten
16
16
  end
17
17
 
18
18
  # Sets the state of all 35 segments.
@@ -123,6 +123,28 @@ module Tinkerforge
123
123
  }
124
124
  end
125
125
 
126
+ # Displays an 8-segment bar graph for 1 or 2 values in the range 0..1.
127
+ #
128
+ # @example
129
+ # my_bricklet.bar_graph 0.5
130
+ # my_bricklet.bar_graph 0.5, 0.8
131
+ def bar_graph(value1, value2=value1)
132
+ value1, value2 = [value1, value2].map { |v| (v.to_f.clamp(0,1) * 8).round }
133
+
134
+ frame = [false] * 35
135
+
136
+ [ 5, 1, 13, 9, 21, 17, 29, 25 ].first(value1).each do |n|
137
+ frame[n] = true
138
+ end
139
+
140
+ [ 4, 2, 12, 10, 20, 18, 28, 26 ].first(value2).each do |n|
141
+ frame[n] = true
142
+ end
143
+
144
+ self.segments = frame
145
+ [value1, value2]
146
+ end
147
+
126
148
  end
127
149
 
128
150
  end
@@ -0,0 +1,11 @@
1
+ {
2
+ "dimensions": [
3
+ 19,
4
+ 33.4,
5
+ 5
6
+ ],
7
+ "weight": 2,
8
+ "documentation_en_url": "https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Solid_State_Relay_V2.html",
9
+ "versions_identifier": "bricklets:solid_state_relay_v2",
10
+ "released": "2018-02-26"
11
+ }
@@ -3,7 +3,7 @@ require 'tinkerforge/version'
3
3
  module Tinkerforge
4
4
 
5
5
  # Tinderfridge version.
6
- TINDERFRIDGE_VERSION = '0.7.0'
6
+ TINDERFRIDGE_VERSION = '0.8.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.7.0
4
+ version: 0.8.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-05-19 00:00:00.000000000 Z
11
+ date: 2021-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tinkerforge
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '2.1'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 2.1.27
22
+ version: 2.1.28
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '2.1'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 2.1.27
32
+ version: 2.1.28
33
33
  description:
34
34
  email:
35
35
  executables: []
@@ -45,6 +45,7 @@ files:
45
45
  - lib/tinderfridge/devices/brick_hat/brick_hat.rb
46
46
  - lib/tinderfridge/devices/brick_hat_zero/brick_hat_zero.json
47
47
  - lib/tinderfridge/devices/brick_hat_zero/brick_hat_zero.rb
48
+ - lib/tinderfridge/devices/bricklet_accelerometer_v2/bricklet_accelerometer_v2.json
48
49
  - lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.json
49
50
  - lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.rb
50
51
  - lib/tinderfridge/devices/bricklet_ambient_light_v3/bricklet_ambient_light_v3.json
@@ -58,9 +59,11 @@ files:
58
59
  - lib/tinderfridge/devices/bricklet_color_v2/bricklet_color_v2.rb
59
60
  - lib/tinderfridge/devices/bricklet_compass/bricklet_compass.json
60
61
  - lib/tinderfridge/devices/bricklet_dc_v2/bricklet_dc_v2.json
62
+ - lib/tinderfridge/devices/bricklet_distance_ir_v2/bricklet_distance_ir_v2.json
61
63
  - lib/tinderfridge/devices/bricklet_distance_us_v2/bricklet_distance_us_v2.json
62
64
  - lib/tinderfridge/devices/bricklet_dmx/bricklet_dmx.json
63
65
  - lib/tinderfridge/devices/bricklet_dmx/bricklet_dmx.rb
66
+ - lib/tinderfridge/devices/bricklet_dual_button_v2/bricklet_dual_button_v2.json
64
67
  - lib/tinderfridge/devices/bricklet_e_paper_296x128/bricklet_e_paper_296x128.json
65
68
  - lib/tinderfridge/devices/bricklet_energy_monitor/bricklet_energy_monitor.json
66
69
  - lib/tinderfridge/devices/bricklet_gps_v2/bricklet_gps_v2.json
@@ -68,13 +71,19 @@ files:
68
71
  - lib/tinderfridge/devices/bricklet_hall_effect_v2/bricklet_hall_effect_v2.json
69
72
  - lib/tinderfridge/devices/bricklet_humidity_v2/bricklet_humidity_v2.json
70
73
  - lib/tinderfridge/devices/bricklet_imu_v3/bricklet_imu_v3.json
74
+ - lib/tinderfridge/devices/bricklet_industrial_analog_out_v2/bricklet_industrial_analog_out_v2.json
71
75
  - lib/tinderfridge/devices/bricklet_industrial_counter/bricklet_industrial_counter.json
72
76
  - lib/tinderfridge/devices/bricklet_industrial_digital_in_4_v2/bricklet_industrial_digital_in_4_v2.json
73
77
  - lib/tinderfridge/devices/bricklet_industrial_digital_out_4_v2/bricklet_industrial_digital_out_4_v2.json
78
+ - lib/tinderfridge/devices/bricklet_industrial_dual_0_20ma_v2/bricklet_industrial_dual_0_20ma_v2.json
79
+ - lib/tinderfridge/devices/bricklet_industrial_dual_ac_relay/bricklet_industrial_dual_ac_relay.json
80
+ - lib/tinderfridge/devices/bricklet_industrial_dual_analog_in_v2/bricklet_industrial_dual_analog_in_v2.json
74
81
  - lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.json
75
82
  - lib/tinderfridge/devices/bricklet_industrial_dual_relay/bricklet_industrial_dual_relay.rb
76
83
  - lib/tinderfridge/devices/bricklet_industrial_ptc/bricklet_industrial_ptc.json
77
84
  - lib/tinderfridge/devices/bricklet_industrial_quad_relay_v2/bricklet_industrial_quad_relay_v2.json
85
+ - lib/tinderfridge/devices/bricklet_io16_v2/bricklet_io16_v2.json
86
+ - lib/tinderfridge/devices/bricklet_io4_v2/bricklet_io4_v2.json
78
87
  - lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.json
79
88
  - lib/tinderfridge/devices/bricklet_isolator/bricklet_isolator.rb
80
89
  - lib/tinderfridge/devices/bricklet_joystick_v2/bricklet_joystick_v2.json
@@ -85,6 +94,7 @@ files:
85
94
  - lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.json
86
95
  - lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.rb
87
96
  - lib/tinderfridge/devices/bricklet_linear_poti_v2/bricklet_linear_poti_v2.json
97
+ - lib/tinderfridge/devices/bricklet_load_cell_v2/bricklet_load_cell_v2.json
88
98
  - lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.json
89
99
  - lib/tinderfridge/devices/bricklet_motion_detector_v2/bricklet_motion_detector_v2.rb
90
100
  - lib/tinderfridge/devices/bricklet_motorized_linear_poti/bricklet_motorized_linear_poti.json
@@ -94,10 +104,13 @@ files:
94
104
  - lib/tinderfridge/devices/bricklet_nfc/bricklet_nfc.json
95
105
  - lib/tinderfridge/devices/bricklet_nfc/bricklet_nfc.rb
96
106
  - lib/tinderfridge/devices/bricklet_oled_128x64_v2/bricklet_oled_128x64_v2.json
107
+ - lib/tinderfridge/devices/bricklet_one_wire/bricklet_one_wire.json
97
108
  - lib/tinderfridge/devices/bricklet_outdoor_weather/bricklet_outdoor_weather.json
98
109
  - lib/tinderfridge/devices/bricklet_outdoor_weather/bricklet_outdoor_weather.rb
110
+ - lib/tinderfridge/devices/bricklet_particulate_matter/bricklet_particulate_matter.json
99
111
  - lib/tinderfridge/devices/bricklet_performance_dc/bricklet_performance_dc.json
100
112
  - lib/tinderfridge/devices/bricklet_piezo_speaker_v2/bricklet_piezo_speaker_v2.json
113
+ - lib/tinderfridge/devices/bricklet_ptc_v2/bricklet_ptc_v2.json
101
114
  - lib/tinderfridge/devices/bricklet_real_time_clock_v2/bricklet_real_time_clock_v2.json
102
115
  - lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.json
103
116
  - lib/tinderfridge/devices/bricklet_remote_switch_v2/bricklet_remote_switch_v2.rb
@@ -114,6 +127,7 @@ files:
114
127
  - lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.rb
115
128
  - lib/tinderfridge/devices/bricklet_servo_v2/bricklet_servo_v2.json
116
129
  - lib/tinderfridge/devices/bricklet_silent_stepper_v2/bricklet_silent_stepper_v2.json
130
+ - lib/tinderfridge/devices/bricklet_solid_state_relay_v2/bricklet_solid_state_relay_v2.json
117
131
  - lib/tinderfridge/devices/bricklet_sound_pressure_level/bricklet_sound_pressure_level.json
118
132
  - lib/tinderfridge/devices/bricklet_temperature_ir_v2/bricklet_temperature_ir_v2.json
119
133
  - lib/tinderfridge/devices/bricklet_temperature_v2/bricklet_temperature_v2.json