Beispiel #1
0
 def __init__(self):
     super().__init__()
     self.time = Time()
     self.day_of_week = Int(0, 2)
     self.unknown = Int(0, 2)
     self.unknown2 = Int(0, 4)
     self.params += [self.time, self.day_of_week, self.unknown, self.unknown2]
Beispiel #2
0
 def __init__(self):
     super().__init__()
     self.group = Int(0, length=2)
     self.power_state = Int(0, length=2)
     self.params += [
         self.group,
         self.power_state,
     ]
Beispiel #3
0
 def __init__(self):
     super().__init__()
     self.in_RSSI = Int(0, length=2)
     self.out_RSSI = Int(0, length=2)
     self.ping_ms = Int(0, length=4)
     self.params += [
         self.in_RSSI,
         self.out_RSSI,
         self.ping_ms,
     ]
Beispiel #4
0
    def __init__(self, mac, reset_timer: int, sensitivity: int, light: bool):
        super().__init__(mac)

        reset_timer_value = Int(reset_timer, length=2)
        # Sensitivity: HIGH(0x14),  MEDIUM(0x1E),  OFF(0xFF)
        sensitivity_value = Int(sensitivity, length=2)
        light_temp = 1 if light == True else 0
        light_value = Int(light_temp, length=2)
        self.args += [
            sensitivity_value,
            light_value,
            reset_timer_value,
        ]
Beispiel #5
0
 def __init__(self):
     super().__init__()
     self.unknown1 = Int(0, length=2)
     self.network_is_online = Int(0, length=2)
     self.circle_plus_mac = String(None, length=16)
     self.network_id = Int(0, length=4)
     self.unknown2 = Int(0, length=2)
     self.params += [
         self.unknown1,
         self.network_is_online,
         self.circle_plus_mac,
         self.network_id,
         self.unknown2,
     ]
Beispiel #6
0
 def __init__(self):
     super().__init__()
     self.pulse_1s = Int(0, 4)
     self.pulse_8s = Int(0, 4)
     self.pulse_hour_consumed = Int(0, 8)
     self.pulse_hour_produced = Int(0, 8)
     self.nanosecond_offset = Int(0, 4)
     self.params += [
         self.pulse_1s,
         self.pulse_8s,
         self.pulse_hour_consumed,
         self.pulse_hour_produced,
         self.nanosecond_offset,
     ]
Beispiel #7
0
    def __init__(self):
        super().__init__()

        self.time = RealClockTime()
        self.day_of_week = Int(0, length=2)
        self.date = RealClockDate()
        self.params += [self.time, self.day_of_week, self.date]
Beispiel #8
0
 def __init__(self):
     super().__init__()
     self.datetime = DateTime()
     self.last_logaddr = LogAddr(0, length=8)
     self.relay_state = Int(0, length=2)
     self.hz = Int(0, length=2)
     self.hw_ver = String(None, length=12)
     self.fw_ver = UnixTimestamp(0)
     self.node_type = Int(0, length=2)
     self.params += [
         self.datetime,
         self.last_logaddr,
         self.relay_state,
         self.hz,
         self.hw_ver,
         self.fw_ver,
         self.node_type,
     ]
Beispiel #9
0
 def __init__(self, mac, dt):
     super().__init__(mac)
     passed_days = dt.day - 1
     month_minutes = (passed_days * 24 * 60) + (dt.hour * 60) + dt.minute
     d = DateTime(dt.year, dt.month, month_minutes)
     t = Time(dt.hour, dt.minute, dt.second)
     day_of_week = Int(dt.weekday(), 2)
     # FIXME: use LogAddr instead
     log_buf_addr = String("FFFFFFFF", 8)
     self.args += [d, log_buf_addr, t, day_of_week]
Beispiel #10
0
 def __init__(self):
     super().__init__()
     self.logdate1 = DateTime()
     self.pulses1 = Int(0, 8)
     self.logdate2 = DateTime()
     self.pulses2 = Int(0, 8)
     self.logdate3 = DateTime()
     self.pulses3 = Int(0, 8)
     self.logdate4 = DateTime()
     self.pulses4 = Int(0, 8)
     self.logaddr = LogAddr(0, length=8)
     self.params += [
         self.logdate1,
         self.pulses1,
         self.logdate2,
         self.pulses2,
         self.logdate3,
         self.pulses3,
         self.logdate4,
         self.pulses4,
         self.logaddr,
     ]
Beispiel #11
0
    def __init__(
        self,
        mac,
        stay_active: int,
        maintenance_interval: int,
        sleep_for: int,
        sync_clock: bool,
        clock_interval: int,
    ):
        super().__init__(mac)

        stay_active_val = Int(stay_active, length=2)
        sleep_for_val = Int(sleep_for, length=4)
        maintenance_interval_val = Int(maintenance_interval, length=4)
        val = 1 if sync_clock == True else 0
        clock_sync_val = Int(val, length=2)
        clock_interval_val = Int(clock_interval, length=4)
        self.args += [
            stay_active_val,
            maintenance_interval_val,
            sleep_for_val,
            clock_sync_val,
            clock_interval_val,
        ]
Beispiel #12
0
 def __init__(self):
     super().__init__()
     self.channel = String(None, length=2)
     self.source_mac_id = String(None, length=16)
     self.extended_pan_id = String(None, length=16)
     self.unique_network_id = String(None, length=16)
     self.new_node_mac_id = String(None, length=16)
     self.pan_id = String(None, length=4)
     self.idx = Int(0, length=2)
     self.params += [
         self.channel,
         self.source_mac_id,
         self.extended_pan_id,
         self.unique_network_id,
         self.new_node_mac_id,
         self.pan_id,
         self.idx,
     ]
Beispiel #13
0
 def __init__(self, mac, interval):
     super().__init__(mac)
     self.args.append(Int(interval, length=2))
Beispiel #14
0
 def __init__(self, mac, configure: bool, relais_state: bool):
     super().__init__(mac)
     set_or_get = Int(1 if configure == True else 0, length=2)
     relais = Int(1 if relais_state == True else 0, length=2)
     self.args += [set_or_get, relais]
Beispiel #15
0
 def __init__(self, mac, accept: bool):
     super().__init__(mac)
     accept_value = 1 if accept == True else 0
     self.args.append(Int(accept_value, length=2))
Beispiel #16
0
 def __init__(self, accept: bool):
     super().__init__("")
     # TODO: Make sure that '01' means enable, and '00' disable joining
     val = 1 if accept == True else 0
     self.args.append(Int(val, length=2))
Beispiel #17
0
 def __init__(self):
     super().__init__()
     self.node_mac = String(None, length=16)
     self.node_address = Int(0, length=2)
     self.params += [self.node_mac, self.node_address]
Beispiel #18
0
 def __init__(self):
     super().__init__()
     set_or_get = Int(0, length=2)
     relais = Int(0, length=2)
     self.params += [set_or_get, relais]
Beispiel #19
0
 def __init__(self):
     super().__init__()
     self.existing = Int(0, 2)
     self.allowed = Int(0, 2)
     self.params += [self.existing, self.allowed]
Beispiel #20
0
 def __init__(self):
     super().__init__()
     self.ack_id = Int(0, length=2)
Beispiel #21
0
 def __init__(self):
     super().__init__()
     self.humidity = Int(0, length=4)
     self.temperature = Int(0, length=4)
     self.params += [self.humidity, self.temperature]
Beispiel #22
0
 def __init__(self, mac, usage, production):
     super().__init__(mac)
     self.args.append(Int(usage, length=4))
     self.args.append(Int(production, length=4))
Beispiel #23
0
 def __init__(self, mac, dt):
     super().__init__(mac)
     t = RealClockTime(dt.hour, dt.minute, dt.second)
     day_of_week = Int(dt.weekday(), 2)
     d = RealClockDate(dt.day, dt.month, dt.year)
     self.args += [t, day_of_week, d]
Beispiel #24
0
 def __init__(self):
     super().__init__()
     self.awake_type = Int(0, length=2)
     self.params += [self.awake_type]
Beispiel #25
0
 def __init__(self, mac, taskId):
     super().__init__(mac)
     self.args.append(Int(taskId, length=2))
Beispiel #26
0
 def __init__(self):
     super().__init__()
     self.status = Int(0, 4)
     self.params += [self.status]
Beispiel #27
0
 def __init__(self, mac, on):
     super().__init__(mac)
     val = 1 if on == True else 0
     self.args.append(Int(val, length=2))
Beispiel #28
0
 def __init__(self):
     super().__init__()
     self.node_mac_id = String(None, length=16)
     self.status = Int(0, 2)
     self.params += [self.node_mac_id, self.status]
Beispiel #29
0
 def __init__(self, mac, node_address):
     super().__init__(mac)
     self.args.append(Int(node_address, length=2))
Beispiel #30
0
 def __init__(self):
     super().__init__()
     self.features = Int(0, 16)
     self.params += [self.features]