@@ -420,50 +420,54 @@ tests:
420420 # ----- Hardware tests -----
421421
422422 - name : " Temperature in plausible range"
423- action : call
424- method : temperature
425- expect_range : [10.0, 45.0]
423+ action : script
424+ script : |
425+ t, _, _ = dev.read_one_shot()
426+ result = 10.0 <= t <= 45.0
427+ expect_true : true
426428 mode : [hardware]
427429
428430 - name : " Pressure in plausible range"
429- action : call
430- method : pressure_hpa
431- expect_range : [900.0, 1100.0]
431+ action : script
432+ script : |
433+ _, p, _ = dev.read_one_shot()
434+ result = 900.0 <= p <= 1100.0
435+ expect_true : true
432436 mode : [hardware]
433437
434438 - name : " Humidity in plausible range"
435- action : call
436- method : humidity
437- expect_range : [5.0, 95.0]
439+ action : script
440+ script : |
441+ _, _, h = dev.read_one_shot()
442+ result = 5.0 <= h <= 95.0
443+ expect_true : true
438444 mode : [hardware]
439445
440- - name : " read() returns three plausible values"
446+ - name : " read_one_shot returns three plausible values"
441447 action : script
442448 script : |
443- t, p, h = dev.read ()
449+ t, p, h = dev.read_one_shot ()
444450 result = 10.0 <= t <= 45.0 and 900.0 <= p <= 1100.0 and 5.0 <= h <= 95.0
445451 expect_true : true
446452 mode : [hardware]
447453
448- - name : " read_one_shot returns three plausible values"
454+ - name : " Continuous mode produces plausible values"
449455 action : script
450456 script : |
451- t, p, h = dev.read_one_shot()
457+ from time import sleep_ms
458+ dev.set_continuous()
459+ sleep_ms(100)
460+ t, p, h = dev.read()
461+ dev.power_off()
452462 result = 10.0 <= t <= 45.0 and 900.0 <= p <= 1100.0 and 5.0 <= h <= 95.0
453463 expect_true : true
454464 mode : [hardware]
455465
456466 - name : " Readings feel correct"
457467 action : manual
458468 display :
459- - method : temperature
460- label : " Temperature"
461- unit : " C"
462- - method : pressure_hpa
463- label : " Pressure"
464- unit : " hPa"
465- - method : humidity
466- label : " Humidity"
467- unit : " %RH"
469+ - method : read_one_shot
470+ label : " T, P, H"
468471 prompt : " Do the values look reasonable?"
472+ expect_true : true
469473 mode : [hardware]
0 commit comments