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.
18 lines • 489 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.callbackify = callbackify;
/**
* Converts a method/promise to the callback approach.
* @param fn Method or Promise to run.
* @param callback Callback to call with the result of `fn`.
*/
async function callbackify(fn, callback) {
try {
const result = await fn();
callback(null, result);
}
catch (err) {
callback(err);
}
}
//# sourceMappingURL=callbackify.js.map