1 from Components.Element import Element
3 # this is not a GUI renderer.
4 class FrontpanelLed(Element):
5 def __init__(self, which = 0, patterns = [(20, 0, 0xffffffff),(20, 0x55555555, 0x84fc8c04)], boolean = True):
8 self.patterns = patterns
11 def changed(self, *args, **kwargs):
13 val = self.source.boolean and 0 or 1
15 val = self.source.value
17 (speed, pattern, pattern_4bit) = self.patterns[val]
20 open("/proc/stb/fp/led%d_pattern" % self.which, "w").write("%08x" % pattern)
25 open("/proc/stb/fp/led_set_pattern", "w").write("%08x" % pattern_4bit)
26 open("/proc/stb/fp/led_set_speed", "w").write("%d" % speed)
30 open("/proc/stb/fp/led_pattern_speed", "w").write("%d" % speed)