@constructorfleet/ultimate-govee
Version:
Library for interacting with Govee devices written in Typescript.
30 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.HumidiferUVCState = exports.UVCStateName = void 0;
const _ultimate_govee_common_1 = require("../../../../../common");
const states_1 = require("../../../states");
exports.UVCStateName = 'isUVCActive';
class HumidiferUVCState extends states_1.DeviceOpState {
constructor(device, opType = _ultimate_govee_common_1.OpType.REPORT, identifier = [0x1a]) {
super({ opType, identifier }, device, exports.UVCStateName, undefined);
this.stateToCommand = (state) => {
return {
command: {
data: {
command: [(0, _ultimate_govee_common_1.asOpCode)(0x33, this.identifier, state ? 0x01 : 0x00)],
},
},
status: {
op: {
command: [[state ? 0x01 : 0x00]],
},
},
};
};
}
parseOpCommand(opCommand) {
this.stateValue.next(opCommand[0] === 0x01);
}
}
exports.HumidiferUVCState = HumidiferUVCState;
//# sourceMappingURL=humidifier.uvc.js.map