def __init__( self, device, name, state, timeout=None, timestamp=None, message=None, children=None, **junk ): self.device = device self.name = name self.state = checks.dictionary(state, const.State) self.timeout = timeout self.timestamp = timestamp self.message = message self.children = checks.children(children, self.child_class)
def __init__(self, device, value, name=None, **junk): self.device = device self.name = name self.value = checks.dictionary(value, const.BLOBEnable)
def __init__(self, *args, rule, **kwargs): super().__init__(*args, **kwargs) self.rule = checks.dictionary(rule, const.SwitchRule)
def __init__(self, *args, perm, timeout=None, **kwargs): super().__init__(*args, **kwargs) self.perm = checks.dictionary(perm, const.Permissions) self.timeout = timeout
def check_value(self, value): return checks.dictionary(value, const.SwitchState)
def state_(self, value): self._state = checks.dictionary(value, const.State) self.device.send_message(self.to_set_message())
def check_value(self, value): value = checks.dictionary(value, const.SwitchState) return self._vector.apply_rule(self, value)