2016-11-18 04:20:26 +00:00
|
|
|
# This is hwconfig for "emulation" for cases when there's no real hardware.
|
|
|
|
# It just prints information to console.
|
|
|
|
class LEDClass:
|
|
|
|
|
|
|
|
def __init__(self, id):
|
2016-12-23 14:24:24 +00:00
|
|
|
self.id = "LED(%d):" % id
|
2016-11-18 04:20:26 +00:00
|
|
|
|
|
|
|
def value(self, v):
|
2016-12-23 14:24:24 +00:00
|
|
|
print(self.id, v)
|
2016-11-18 04:20:26 +00:00
|
|
|
|
2017-10-08 22:22:30 +01:00
|
|
|
def on(self):
|
|
|
|
self.value(1)
|
|
|
|
|
|
|
|
def off(self):
|
|
|
|
self.value(0)
|
|
|
|
|
2016-11-18 04:20:26 +00:00
|
|
|
|
|
|
|
LED = LEDClass(1)
|
|
|
|
LED2 = LEDClass(12)
|