tinderfridge 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tinderfridge/devices/bricklet_accelerometer_v2/bricklet_accelerometer_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_air_quality/bricklet_air_quality.json +2 -1
- data/lib/tinderfridge/devices/bricklet_analog_out_v3/bricklet_analog_out_v3.json +2 -1
- data/lib/tinderfridge/devices/bricklet_barometer_v2/bricklet_barometer_v2.json +2 -1
- data/lib/tinderfridge/devices/bricklet_distance_ir_v2/bricklet_distance_ir_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_dual_button_v2/bricklet_dual_button_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_industrial_analog_out_v2/bricklet_industrial_analog_out_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_industrial_dual_0_20ma_v2/bricklet_industrial_dual_0_20ma_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_industrial_dual_ac_relay/bricklet_industrial_dual_ac_relay.json +11 -0
- data/lib/tinderfridge/devices/bricklet_industrial_dual_analog_in_v2/bricklet_industrial_dual_analog_in_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_io16_v2/bricklet_io16_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_io4_v2/bricklet_io4_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_led_strip_v2/bricklet_led_strip_v2.json +2 -1
- data/lib/tinderfridge/devices/bricklet_load_cell_v2/bricklet_load_cell_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_one_wire/bricklet_one_wire.json +11 -0
- data/lib/tinderfridge/devices/bricklet_particulate_matter/bricklet_particulate_matter.json +11 -0
- data/lib/tinderfridge/devices/bricklet_ptc_v2/bricklet_ptc_v2.json +11 -0
- data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.json +2 -1
- data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.rb +23 -1
- data/lib/tinderfridge/devices/bricklet_solid_state_relay_v2/bricklet_solid_state_relay_v2.json +11 -0
- data/lib/tinderfridge/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1f848437f1877596a58521fdbe213042f6561b42a91c91b60eca2fd3ab1a690
|
4
|
+
data.tar.gz: '09c7adcf40fabf6eae5ca89316428aeb6cabfa5f4abccbaaf27bd3901535afca'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a84bc2687015ef1c65dd61cac031a7b6e6ff57e22a811784e6160dd5b002badf5f55f11c3883ffa754a6f42d0b5a6e5a085a4c930700c899956d06ec8f533d98
|
7
|
+
data.tar.gz: c12dcf3ef70b1111f665a3098ab213a75819c2953b3c7cb2ebc020bd00b016588ec70ca0bebbdf72666a84edcc4be345f7aaa67c8ee4f8841262c1fc4afb80a7
|
@@ -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
|
+
}
|
data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.json
CHANGED
@@ -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
|
}
|
data/lib/tinderfridge/devices/bricklet_segment_display_4x7_v2/bricklet_segment_display_4x7_v2.rb
CHANGED
@@ -12,7 +12,7 @@ module Tinkerforge
|
|
12
12
|
|
13
13
|
# Returns the state of all 35 segments.
|
14
14
|
def segments
|
15
|
-
|
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
|
data/lib/tinderfridge/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
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
|