Skip to content

Commit

Permalink
add test for fade_ms in matrix_light
Browse files Browse the repository at this point in the history
  • Loading branch information
jabdoa2 committed May 11, 2016
1 parent 51ae367 commit d93d989
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mpf/tests/machine_files/shows/config/test_shows.yaml
Expand Up @@ -30,6 +30,11 @@ matrix_lights:
label: Test 1
tags: tag1
debug: True
light_03:
number: 2
label: Test 1
fade_ms: 1s
debug: True

gis:
gi_01:
Expand Down
12 changes: 12 additions & 0 deletions mpf/tests/test_DeviceMatrixLight.py
Expand Up @@ -122,6 +122,18 @@ def testOneSecondFadeUp(self):
self.machine_run()
self.assertFalse(light.fade_in_progress)

light = self.machine.lights.light_03
light.clear_stack()
self.assertEqual(1000, light.default_fade_ms)

self.advance_time_and_run(1)
self.assertEqual(0, light.hw_driver.current_brightness)
light.on()
self.advance_time_and_run(.5)
self.assertEqual(127, light.hw_driver.current_brightness)
self.advance_time_and_run(.5)
self.assertEqual(255, light.hw_driver.current_brightness)

def testInterruptFadeOut(self):
"""Interrupt (kill) a one second fade from white to off"""

Expand Down

0 comments on commit d93d989

Please sign in to comment.