16 lines
515 B
Python
16 lines
515 B
Python
|
|
from model import Switcher, SwitcherGroup
|
|
|
|
class DummySwitcher(Switcher):
|
|
def __init__(self, group: SwitcherGroup, name: str, conf):
|
|
super().__init__(group, name)
|
|
self.conf = conf
|
|
|
|
def _status_change(self, new_status: str):
|
|
printf("DummySwitcher %s: Status change %s -> %s" % (self.name, self.status, new_status))
|
|
|
|
def _obtain_actual_status(self):
|
|
"""Our dummy switcher is always off in the initial state"""
|
|
if self.status == "unknown":
|
|
return "off"
|