Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
"""message for that initializes the Stick"""
# init doesn't send MAC address
PlugwiseRequest.__init__(self, '')
def __init__(self, mac):
PlugwiseRequest.__init__(self, mac)
def __init__(self, mac, permission):
PlugwiseRequest.__init__(self, mac)
val = 1 if permission == True else 0
self.args.append(Int(val, length=2))
def __init__(self, mac, log_address):
PlugwiseRequest.__init__(self, mac)
self.args.append(LogAddr(log_address, 8))
def __init__(self, mac, on):
PlugwiseRequest.__init__(self, mac)
val = 1 if on == True else 0
self.args.append(Int(val, length=2))
#the second parameter is always 0x01
self.args.append(Int(1, length=2))
def __init__(self, mac, taskId):
PlugwiseRequest.__init__(self, mac)
self.args.append(Int(taskId, length=2))
def __init__(self, idx, schedule_chunk):
# PrepareScedule doesn't send MAC address
PlugwiseRequest.__init__(self, '')
self.args.append(Int(16*idx, length=4))
for i in range(0,8):
self.args.append(SInt(schedule_chunk[i], length=4))
def __init__(self, mac, usage, production):
PlugwiseRequest.__init__(self, mac)
self.args.append(Int(usage, length=4))
self.args.append(Int(production, length=4))
def __init__(self, mac, dt):
PlugwiseRequest.__init__(self, mac)
self.args.append(StringVal(dt.second, 2))
self.args.append(StringVal(dt.minute, 2))
self.args.append(StringVal(dt.hour, 2))
self.args.append(StringVal(dt.weekday() + 1, 2))
self.args.append(StringVal(dt.day, 2))
self.args.append(StringVal(dt.month, 2))
self.args.append(StringVal((dt.year-PLUGWISE_EPOCH), 2))
def __init__(self, mac, on):
PlugwiseRequest.__init__(self, mac)
#TODO: Make sure that '01' means enable, and '00' disable joining
val = 1 if on == True else 0
self.args.append(Int(val, length=2))