def set_StateON(self): if self.get_State() == False: R.switch_On(self.relayobj) else: return False
def __init__(self, relayobj, initial): self.relayobj = relayobj self.initial = initial if self.initial == "ON": if R.Relay.in_on(self.relayobj) == False: R.switch_On(self.relayobj)