raspberry_pi_iot 0.0.12 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/doc/IoT.html +6 -4
  3. data/doc/RaspberryPiIoT.html +16 -10
  4. data/doc/_index.html +197 -21
  5. data/doc/class_list.html +1 -1
  6. data/doc/file.LICENSE.html +1 -1
  7. data/doc/file.README.html +15 -6
  8. data/doc/index.html +15 -6
  9. data/doc/method_list.html +590 -30
  10. data/doc/top-level-namespace.html +2 -2
  11. data/lib/iot/bh1750.rb +6 -4
  12. data/lib/iot/receptor.rb +6 -0
  13. data/lib/raspberry_pi.rb +1 -1
  14. data/lib/raspberry_pi_iot/version.rb +1 -1
  15. data/test/test.sh +5 -0
  16. data/test/test.txt +52 -169
  17. data/test/test_bh1750.rb +5 -0
  18. data/test/test_ky008.rb +41 -0
  19. metadata +2 -29
  20. data/doc/Actuator.html +0 -145
  21. data/doc/BH1750.html +0 -541
  22. data/doc/BME280.html +0 -276
  23. data/doc/BMP280.html +0 -276
  24. data/doc/BMxSensor.html +0 -557
  25. data/doc/BinaryActuator.html +0 -177
  26. data/doc/BinaryEffector.html +0 -246
  27. data/doc/BinaryReceptor.html +0 -387
  28. data/doc/BinarySensor.html +0 -168
  29. data/doc/Bus.html +0 -126
  30. data/doc/Button.html +0 -1276
  31. data/doc/DHT11.html +0 -287
  32. data/doc/DHT22.html +0 -287
  33. data/doc/DHTxxSensor.html +0 -361
  34. data/doc/DS18B20.html +0 -339
  35. data/doc/DigitalActuator.html +0 -164
  36. data/doc/DigitalEffector.html +0 -624
  37. data/doc/DigitalReceptor.html +0 -242
  38. data/doc/DigitalSensor.html +0 -162
  39. data/doc/Effector.html +0 -257
  40. data/doc/HCSR501.html +0 -172
  41. data/doc/HumitureSensor.html +0 -453
  42. data/doc/LED.html +0 -836
  43. data/doc/MAX44009.html +0 -830
  44. data/doc/RaspberryPi.html +0 -544
  45. data/doc/Receptor.html +0 -257
  46. data/doc/Sensor.html +0 -145
  47. data/doc/TemperatureSensor.html +0 -644
@@ -82,7 +82,7 @@
82
82
  <p class="children">
83
83
 
84
84
 
85
- <strong class="modules">Modules:</strong> <span class='object_link'><a href="Bus.html" title="Bus (module)">Bus</a></span>, <span class='object_link'><a href="IoT.html" title="IoT (module)">IoT</a></span>, <span class='object_link'><a href="RaspberryPi.html" title="RaspberryPi (module)">RaspberryPi</a></span>, <span class='object_link'><a href="RaspberryPiIoT.html" title="RaspberryPiIoT (module)">RaspberryPiIoT</a></span>
85
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="IoT.html" title="IoT (module)">IoT</a></span>, <span class='object_link'><a href="RaspberryPiIoT.html" title="RaspberryPiIoT (module)">RaspberryPiIoT</a></span>
86
86
 
87
87
 
88
88
 
@@ -100,7 +100,7 @@
100
100
  </div>
101
101
 
102
102
  <div id="footer">
103
- Generated on Mon Jun 8 16:36:37 2020 by
103
+ Generated on Wed Jun 10 16:52:49 2020 by
104
104
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
105
105
  0.9.20 (ruby-2.5.5).
106
106
  </div>
@@ -1,8 +1,9 @@
1
1
  require 'bus'
2
+ require_relative 'digital_receptor'
2
3
 
3
4
  module IoT
4
5
  # BH1750 - ambient light sensor
5
- class BH1750
6
+ class BH1750 < IoT::DigitalReceptor
6
7
  DEVICE = 0x23 # I2C sensor address
7
8
  POWER_DOWN = 0x00 # off state
8
9
  POWER_ON = 0x01 # on state
@@ -24,21 +25,22 @@ module IoT
24
25
  @device = I2CDevice.new(address: DEVICE, driver: I2CDevice::Driver::I2CDev.new(@i2c_bus))
25
26
  @resolution = ONE_TIME_HIGH_RES_MODE_1
26
27
  @length = 2
27
- @value = read_sensor
28
+ @value = read
28
29
  end
29
30
 
30
31
  # Read raw data from sensor and convert it to numeric
31
- def read_sensor
32
+ def read
32
33
  data = @device.i2cget(@resolution, @length)
33
34
  @value = to_f(data)
34
35
  end
35
36
 
36
37
  # Return value in Lux
37
38
  def lux
38
- read_sensor
39
+ read
39
40
  @value
40
41
  end
41
42
 
43
+
42
44
  def name
43
45
  @sensor_name
44
46
  end
@@ -20,6 +20,12 @@ module IoT
20
20
  @model
21
21
  end
22
22
 
23
+ def read
24
+ @value
25
+ end
26
+
27
+ alias read_sensor read
28
+
23
29
  protected
24
30
  def name=(name)
25
31
  @name = name
@@ -17,7 +17,7 @@ module RaspberryPi
17
17
 
18
18
  # Return hardware info as a hash
19
19
  def self.hardware_info
20
- info = {}
20
+ info = {"Model" => self.model_name}
21
21
  lines = ` pinout | grep ': '`
22
22
  lines << `cat /proc/cpuinfo | grep ': '`
23
23
  lines.split("\n").each do |line|
@@ -1,3 +1,3 @@
1
1
  module RaspberryPiIoT
2
- VERSION = "0.0.12"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -1,8 +1,13 @@
1
1
  #!/bin/bash
2
+ # if
2
3
  LIBRARY=gem
4
+ # then all the testing programs use the installed gem
5
+ # othewise they will use sources from the lib/.
6
+
3
7
  LOG=./test.txt
4
8
  rm $LOG
5
9
 
10
+ echo Testing with "$LIBRARY" library...
6
11
  for f in test_*.rb; do
7
12
  echo "=== $f ===============================================" >> $LOG
8
13
  ./$f $LIBRARY >> $LOG
@@ -1,290 +1,173 @@
1
1
  === test_bh1750.rb ===============================================
2
- Run options: --seed 12388
2
+ Run options: --seed 53298
3
3
 
4
4
  # Running:
5
5
 
6
- ...
6
+ ....
7
7
 
8
- Finished in 0.026289s, 114.1150 runs/s, 114.1150 assertions/s.
8
+ Finished in 0.027978s, 142.9696 runs/s, 142.9696 assertions/s.
9
9
 
10
- 3 runs, 3 assertions, 0 failures, 0 errors, 0 skips
10
+ 4 runs, 4 assertions, 0 failures, 0 errors, 0 skips
11
11
  -----------------------------------------------------------------
12
12
  === test_bme280.rb ===============================================
13
- Run options: --seed 6580
13
+ Run options: --seed 21081
14
14
 
15
15
  # Running:
16
16
 
17
- EEF
18
-
19
- Finished in 0.026644s, 112.5958 runs/s, 37.5319 assertions/s.
20
-
21
- 1) Error:
22
- RaspberryPiIoT_BMP280Test#test_temperature_value:
23
- NoMethodError: undefined method `unpack' for nil:NilClass
24
- /var/lib/gems/2.5.0/gems/i2c-bme280-0.1.2/lib/i2c/bme280.rb:113:in `data'
25
- /var/lib/gems/2.5.0/gems/i2c-bme280-0.1.2/lib/i2c/bme280.rb:30:in `all'
26
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:18:in `read_data'
27
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:14:in `initialize'
28
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:70:in `initialize'
29
- ./test_bme280.rb:11:in `new'
30
- ./test_bme280.rb:11:in `setup'
31
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:96:in `block (3 levels) in run'
32
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:195:in `capture_exceptions'
33
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:95:in `block (2 levels) in run'
34
- /usr/lib/ruby/vendor_ruby/minitest.rb:265:in `time_it'
35
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:94:in `block in run'
36
- /usr/lib/ruby/vendor_ruby/minitest.rb:360:in `on_signal'
37
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:211:in `with_info_handler'
38
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:93:in `run'
39
- /usr/lib/ruby/vendor_ruby/minitest.rb:960:in `run_one_method'
40
- /usr/lib/ruby/vendor_ruby/minitest.rb:334:in `run_one_method'
41
- /usr/lib/ruby/vendor_ruby/minitest.rb:321:in `block (2 levels) in run'
42
- /usr/lib/ruby/vendor_ruby/minitest.rb:320:in `each'
43
- /usr/lib/ruby/vendor_ruby/minitest.rb:320:in `block in run'
44
- /usr/lib/ruby/vendor_ruby/minitest.rb:360:in `on_signal'
45
- /usr/lib/ruby/vendor_ruby/minitest.rb:347:in `with_info_handler'
46
- /usr/lib/ruby/vendor_ruby/minitest.rb:319:in `run'
47
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `block in __run'
48
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `map'
49
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `__run'
50
- /usr/lib/ruby/vendor_ruby/minitest.rb:136:in `run'
51
- /usr/lib/ruby/vendor_ruby/minitest.rb:63:in `block in autorun'
52
-
53
- 2) Error:
54
- RaspberryPiIoT_BMP280Test#test_pressure_value:
55
- NoMethodError: undefined method `unpack' for nil:NilClass
56
- /var/lib/gems/2.5.0/gems/i2c-bme280-0.1.2/lib/i2c/bme280.rb:113:in `data'
57
- /var/lib/gems/2.5.0/gems/i2c-bme280-0.1.2/lib/i2c/bme280.rb:30:in `all'
58
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:18:in `read_data'
59
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:14:in `initialize'
60
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:70:in `initialize'
61
- ./test_bme280.rb:11:in `new'
62
- ./test_bme280.rb:11:in `setup'
63
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:96:in `block (3 levels) in run'
64
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:195:in `capture_exceptions'
65
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:95:in `block (2 levels) in run'
66
- /usr/lib/ruby/vendor_ruby/minitest.rb:265:in `time_it'
67
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:94:in `block in run'
68
- /usr/lib/ruby/vendor_ruby/minitest.rb:360:in `on_signal'
69
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:211:in `with_info_handler'
70
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:93:in `run'
71
- /usr/lib/ruby/vendor_ruby/minitest.rb:960:in `run_one_method'
72
- /usr/lib/ruby/vendor_ruby/minitest.rb:334:in `run_one_method'
73
- /usr/lib/ruby/vendor_ruby/minitest.rb:321:in `block (2 levels) in run'
74
- /usr/lib/ruby/vendor_ruby/minitest.rb:320:in `each'
75
- /usr/lib/ruby/vendor_ruby/minitest.rb:320:in `block in run'
76
- /usr/lib/ruby/vendor_ruby/minitest.rb:360:in `on_signal'
77
- /usr/lib/ruby/vendor_ruby/minitest.rb:347:in `with_info_handler'
78
- /usr/lib/ruby/vendor_ruby/minitest.rb:319:in `run'
79
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `block in __run'
80
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `map'
81
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `__run'
82
- /usr/lib/ruby/vendor_ruby/minitest.rb:136:in `run'
83
- /usr/lib/ruby/vendor_ruby/minitest.rb:63:in `block in autorun'
84
-
85
- 3) Failure:
17
+ F..
18
+
19
+ Finished in 0.041686s, 71.9659 runs/s, 287.8635 assertions/s.
20
+
21
+ 1) Failure:
86
22
  RaspberryPiIoT_BMP280Test#test_humidity_value [./test_bme280.rb:55]:
87
23
  Expected false to be truthy.
88
24
 
89
- 3 runs, 1 assertions, 1 failures, 2 errors, 0 skips
25
+ 3 runs, 12 assertions, 1 failures, 0 errors, 0 skips
90
26
  -----------------------------------------------------------------
91
27
  === test_bmp280.rb ===============================================
92
- Run options: --seed 40885
28
+ Run options: --seed 11637
93
29
 
94
30
  # Running:
95
31
 
96
- EE
97
-
98
- Finished in 0.016186s, 123.5606 runs/s, 0.0000 assertions/s.
99
-
100
- 1) Error:
101
- RaspberryPiIoT_BMP280Test#test_temperature_value:
102
- NoMethodError: undefined method `unpack' for nil:NilClass
103
- /var/lib/gems/2.5.0/gems/i2c-bme280-0.1.2/lib/i2c/bme280.rb:113:in `data'
104
- /var/lib/gems/2.5.0/gems/i2c-bme280-0.1.2/lib/i2c/bme280.rb:30:in `all'
105
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:18:in `read_data'
106
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:14:in `initialize'
107
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:64:in `initialize'
108
- ./test_bmp280.rb:11:in `new'
109
- ./test_bmp280.rb:11:in `setup'
110
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:96:in `block (3 levels) in run'
111
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:195:in `capture_exceptions'
112
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:95:in `block (2 levels) in run'
113
- /usr/lib/ruby/vendor_ruby/minitest.rb:265:in `time_it'
114
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:94:in `block in run'
115
- /usr/lib/ruby/vendor_ruby/minitest.rb:360:in `on_signal'
116
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:211:in `with_info_handler'
117
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:93:in `run'
118
- /usr/lib/ruby/vendor_ruby/minitest.rb:960:in `run_one_method'
119
- /usr/lib/ruby/vendor_ruby/minitest.rb:334:in `run_one_method'
120
- /usr/lib/ruby/vendor_ruby/minitest.rb:321:in `block (2 levels) in run'
121
- /usr/lib/ruby/vendor_ruby/minitest.rb:320:in `each'
122
- /usr/lib/ruby/vendor_ruby/minitest.rb:320:in `block in run'
123
- /usr/lib/ruby/vendor_ruby/minitest.rb:360:in `on_signal'
124
- /usr/lib/ruby/vendor_ruby/minitest.rb:347:in `with_info_handler'
125
- /usr/lib/ruby/vendor_ruby/minitest.rb:319:in `run'
126
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `block in __run'
127
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `map'
128
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `__run'
129
- /usr/lib/ruby/vendor_ruby/minitest.rb:136:in `run'
130
- /usr/lib/ruby/vendor_ruby/minitest.rb:63:in `block in autorun'
131
-
132
- 2) Error:
133
- RaspberryPiIoT_BMP280Test#test_pressure_value:
134
- NoMethodError: undefined method `unpack' for nil:NilClass
135
- /var/lib/gems/2.5.0/gems/i2c-bme280-0.1.2/lib/i2c/bme280.rb:113:in `data'
136
- /var/lib/gems/2.5.0/gems/i2c-bme280-0.1.2/lib/i2c/bme280.rb:30:in `all'
137
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:18:in `read_data'
138
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:14:in `initialize'
139
- /var/lib/gems/2.5.0/gems/raspberry_pi_iot-0.0.12/lib/iot/bmx_sensor.rb:64:in `initialize'
140
- ./test_bmp280.rb:11:in `new'
141
- ./test_bmp280.rb:11:in `setup'
142
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:96:in `block (3 levels) in run'
143
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:195:in `capture_exceptions'
144
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:95:in `block (2 levels) in run'
145
- /usr/lib/ruby/vendor_ruby/minitest.rb:265:in `time_it'
146
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:94:in `block in run'
147
- /usr/lib/ruby/vendor_ruby/minitest.rb:360:in `on_signal'
148
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:211:in `with_info_handler'
149
- /usr/lib/ruby/vendor_ruby/minitest/test.rb:93:in `run'
150
- /usr/lib/ruby/vendor_ruby/minitest.rb:960:in `run_one_method'
151
- /usr/lib/ruby/vendor_ruby/minitest.rb:334:in `run_one_method'
152
- /usr/lib/ruby/vendor_ruby/minitest.rb:321:in `block (2 levels) in run'
153
- /usr/lib/ruby/vendor_ruby/minitest.rb:320:in `each'
154
- /usr/lib/ruby/vendor_ruby/minitest.rb:320:in `block in run'
155
- /usr/lib/ruby/vendor_ruby/minitest.rb:360:in `on_signal'
156
- /usr/lib/ruby/vendor_ruby/minitest.rb:347:in `with_info_handler'
157
- /usr/lib/ruby/vendor_ruby/minitest.rb:319:in `run'
158
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `block in __run'
159
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `map'
160
- /usr/lib/ruby/vendor_ruby/minitest.rb:159:in `__run'
161
- /usr/lib/ruby/vendor_ruby/minitest.rb:136:in `run'
162
- /usr/lib/ruby/vendor_ruby/minitest.rb:63:in `block in autorun'
163
-
164
- 2 runs, 0 assertions, 0 failures, 2 errors, 0 skips
32
+ ..
33
+
34
+ Finished in 0.035056s, 57.0513 runs/s, 313.7822 assertions/s.
35
+
36
+ 2 runs, 11 assertions, 0 failures, 0 errors, 0 skips
165
37
  -----------------------------------------------------------------
166
38
  === test_button.rb ===============================================
167
- Run options: --seed 44312
39
+ Run options: --seed 65304
168
40
 
169
41
  # Running:
170
42
 
171
- Waiting for 1 long press (> 1 second)...
172
- .Waiting for 1 short press (< 1 second)...
43
+ Waiting for 1 short press (< 1 second)...
173
44
  .Waiting for double press (2 sequential short presses)...
174
45
  .Waiting for a press...
46
+ .Waiting for 1 long press (> 1 second)...
175
47
  .
176
48
 
177
- Finished in 60.033253s, 0.0666 runs/s, 0.0333 assertions/s.
49
+ Finished in 60.035713s, 0.0666 runs/s, 0.0333 assertions/s.
178
50
 
179
51
  4 runs, 2 assertions, 0 failures, 0 errors, 0 skips
180
52
  -----------------------------------------------------------------
181
53
  === test_dht11.rb ===============================================
182
- Run options: --seed 31229
54
+ Run options: --seed 40347
183
55
 
184
56
  # Running:
185
57
 
186
58
  ..
187
59
 
188
- Finished in 0.953396s, 2.0978 runs/s, 5.2444 assertions/s.
60
+ Finished in 0.953348s, 2.0979 runs/s, 5.2447 assertions/s.
189
61
 
190
62
  2 runs, 5 assertions, 0 failures, 0 errors, 0 skips
191
63
  -----------------------------------------------------------------
192
64
  === test_dht22.rb ===============================================
193
- Run options: --seed 39084
65
+ Run options: --seed 61166
194
66
 
195
67
  # Running:
196
68
 
197
69
  ..
198
70
 
199
- Finished in 1.477398s, 1.3537 runs/s, 3.3843 assertions/s.
71
+ Finished in 0.953121s, 2.0984 runs/s, 5.2459 assertions/s.
200
72
 
201
73
  2 runs, 5 assertions, 0 failures, 0 errors, 0 skips
202
74
  -----------------------------------------------------------------
203
75
  === test_ds18b20.rb ===============================================
204
- Run options: --seed 10331
76
+ Run options: --seed 17438
205
77
 
206
78
  # Running:
207
79
 
208
80
  .
209
81
 
210
- Finished in 0.925761s, 1.0802 runs/s, 4.3208 assertions/s.
82
+ Finished in 0.925298s, 1.0807 runs/s, 4.3229 assertions/s.
211
83
 
212
84
  1 runs, 4 assertions, 0 failures, 0 errors, 0 skips
213
85
  -----------------------------------------------------------------
214
86
  === test_helper.rb ===============================================
215
- Run options: --seed 14803
87
+ Run options: --seed 51807
216
88
 
217
89
  # Running:
218
90
 
219
91
 
220
92
 
221
- Finished in 0.001802s, 0.0000 runs/s, 0.0000 assertions/s.
93
+ Finished in 0.001973s, 0.0000 runs/s, 0.0000 assertions/s.
222
94
 
223
95
  0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
224
96
  -----------------------------------------------------------------
225
97
  === test_info.rb ===============================================
226
- Run options: --seed 56370
98
+ Run options: --seed 9430
227
99
 
228
100
  # Running:
229
101
 
230
102
  .....
231
103
 
232
- Finished in 1.410895s, 3.5439 runs/s, 8.5052 assertions/s.
104
+ Finished in 1.392537s, 3.5906 runs/s, 8.6174 assertions/s.
233
105
 
234
106
  5 runs, 12 assertions, 0 failures, 0 errors, 0 skips
235
107
  -----------------------------------------------------------------
108
+ === test_ky008.rb ===============================================
109
+ Run options: --seed 36040
110
+
111
+ # Running:
112
+
113
+ ...
114
+
115
+ Finished in 12.759853s, 0.2351 runs/s, 0.3135 assertions/s.
116
+
117
+ 3 runs, 4 assertions, 0 failures, 0 errors, 0 skips
118
+ -----------------------------------------------------------------
236
119
  === test_led.rb ===============================================
237
- Run options: --seed 14482
120
+ Run options: --seed 32256
238
121
 
239
122
  # Running:
240
123
 
241
124
  ....
242
125
 
243
- Finished in 12.511368s, 0.3197 runs/s, 0.3197 assertions/s.
126
+ Finished in 12.512438s, 0.3197 runs/s, 0.3197 assertions/s.
244
127
 
245
128
  4 runs, 4 assertions, 0 failures, 0 errors, 0 skips
246
129
  -----------------------------------------------------------------
247
130
  === test_led_rgb.rb ===============================================
248
- Run options: --seed 51148
131
+ Run options: --seed 33248
249
132
 
250
133
  # Running:
251
134
 
252
135
  .........
253
136
 
254
- Finished in 18.520137s, 0.4860 runs/s, 0.7019 assertions/s.
137
+ Finished in 18.519828s, 0.4860 runs/s, 0.7020 assertions/s.
255
138
 
256
139
  9 runs, 13 assertions, 0 failures, 0 errors, 0 skips
257
140
  -----------------------------------------------------------------
258
141
  === test_max44009_gy49.rb ===============================================
259
- Run options: --seed 46297
142
+ Run options: --seed 40209
260
143
 
261
144
  # Running:
262
145
 
263
146
  ...
264
147
 
265
- Finished in 0.027378s, 109.5757 runs/s, 109.5757 assertions/s.
148
+ Finished in 0.027353s, 109.6773 runs/s, 109.6773 assertions/s.
266
149
 
267
150
  3 runs, 3 assertions, 0 failures, 0 errors, 0 skips
268
151
  -----------------------------------------------------------------
269
152
  === test_Raspberry_Pi_IoT.rb ===============================================
270
- Run options: --seed 32025
153
+ Run options: --seed 43477
271
154
 
272
155
  # Running:
273
156
 
274
157
  .
275
158
 
276
- Finished in 0.003285s, 304.4013 runs/s, 304.4013 assertions/s.
159
+ Finished in 0.003202s, 312.3321 runs/s, 312.3321 assertions/s.
277
160
 
278
161
  1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
279
162
  -----------------------------------------------------------------
280
163
  === test_thermal.rb ===============================================
281
- Run options: --seed 61785
164
+ Run options: --seed 31887
282
165
 
283
166
  # Running:
284
167
 
285
168
  .
286
169
 
287
- Finished in 0.003480s, 287.3191 runs/s, 1149.2763 assertions/s.
170
+ Finished in 0.003941s, 253.7533 runs/s, 1015.0133 assertions/s.
288
171
 
289
172
  1 runs, 4 assertions, 0 failures, 0 errors, 0 skips
290
173
  -----------------------------------------------------------------
@@ -24,6 +24,11 @@ class RaspberryPiIoT_BH1750Test < MiniTest::Test
24
24
  assert hex.size == 1 && hex[0] == @addr_s
25
25
  end
26
26
 
27
+ def test_reading_sensor
28
+ value = @sensor.read
29
+ assert value > 0.0
30
+ end
31
+
27
32
  def test_sensor_value
28
33
  value = @sensor.lux
29
34
  assert value > 0.0