mirror of
https://github.com/home-assistant/operating-system.git
synced 2026-02-23 11:15:57 +00:00
* Update Buildroot to 2019-02.3 * Fix enter script * Update ova_defconfig * Fix network manager * Remove runc patches * Use same docker version * Fix build * Fix vmtools * Fix depens * Fix handling with tempfiles * Fix permission handling * Fix cp * Cleanup * Fix mounts
28 lines
466 B
Python
28 lines
466 B
Python
from automat import MethodicalMachine
|
|
|
|
|
|
class Led(object):
|
|
_machine = MethodicalMachine()
|
|
|
|
@_machine.state()
|
|
def led_on(self):
|
|
"led is on"
|
|
|
|
@_machine.state(initial=True)
|
|
def led_off(self):
|
|
"led is off"
|
|
|
|
@_machine.input()
|
|
def turn_on(self):
|
|
"turn the led on"
|
|
|
|
@_machine.output()
|
|
def _light(self):
|
|
print("light")
|
|
|
|
led_off.upon(turn_on, enter=led_on, outputs=[_light])
|
|
|
|
|
|
led = Led()
|
|
led.turn_on()
|