UNPKG

homebridge-xiaomi-roborock-vacuum

Version:

Xiaomi Vacuum Cleaner - 1st (Mi Robot), 2nd (Roborock S50 + S55), 3rd Generation (Roborock S6) and S5 Max - plugin for Homebridge.

26 lines 788 B
"use strict"; const log = require("../../log"); const Packet = require("../../../lib/packet"); exports.command = "packet <hexData>"; exports.description = "Decode a miIO UDP packet"; exports.builder = { token: { required: true, description: "Token to use for decoding", }, }; exports.handler = function (argv) { const packet = new Packet(); packet.token = Buffer.from(argv.token, "hex"); const raw = Buffer.from(argv.hexData, "hex"); packet.raw = raw; const data = packet.data; if (!data) { log.error("Could not extract data from packet, check your token and packet data"); } else { log.plain("Hex: ", data.toString("hex")); log.plain("String: ", data.toString()); } }; //# sourceMappingURL=packet.js.map