def parse_light_set_waveform_optional(payload): reserved = BitParser.parse_int("u8", payload[0:8]) transient = BitParser.parse_int("s8", payload[8:16]) hue = BitParser.parse_int("u16", payload[16:32]) saturation = BitParser.parse_int("u16", payload[32:48]) brightness = BitParser.parse_int("u16", payload[48:64]) kelvin = BitParser.parse_int("u16", payload[64:80]) period = BitParser.parse_int("u32", payload[80:112]) cycles = BitParser.parse_float("f32", payload[112:144]) skew_ratio = BitParser.parse_int("s16", payload[144:160]) waveform = BitParser.parse_int("u8", payload[160:168]) set_hue = BitParser.parse_int("s8", payload[168:176]) set_saturation = BitParser.parse_int("s8", payload[176:184]) set_brightness = BitParser.parse_int("s8", payload[184:192]) set_kelvin = BitParser.parse_int("s8", payload[192:200]) return { "transient": transient, "hue": hue, "saturation": saturation, "brightness": brightness, "kelvin": kelvin, "period": period, "cycles": cycles, "skew_ratio": skew_ratio, "waveform": waveform, "set_hue": set_hue, "set_saturation": set_saturation, "set_brightness": set_brightness, "set_kelvin": set_kelvin }
def parse_device_state_wifi_info(payload): signal = BitParser.parse_float("f32", payload[0:32]) tx = BitParser.parse_int("u32", payload[32:64]) rx = BitParser.parse_int("u32", payload[64:96]) reserved = BitParser.parse_int("s16", payload[96:112]) return {"signal": signal, "tx": tx, "rx": rx}