def __init__(self, period=500): self.state = self.STATE_BUTTON_START self.start_time = 0 self.period = period self.click_state = self.STATE_CLICK_START self.indicator = Indicator(PinSet(Sonoff.GREEN_LED)) self.relay = PinSet(Sonoff.RELAY) self.smartconfig = SM(self.indicator) self.iostate = False