UNPKG

@constructorfleet/ultimate-govee

Version:

Library for interacting with Govee devices written in Typescript.

30 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IceMakerMakingIceState = exports.MakingIceStateName = void 0; const states_1 = require("../../../states"); const types_1 = require("./types"); exports.MakingIceStateName = 'makeIce'; class IceMakerMakingIceState extends states_1.DeviceState { constructor(device, statusState) { super(device, exports.MakingIceStateName, undefined); this.statusState = statusState; this.stateToCommand = () => { return undefined; }; this.statusState.subscribe((status) => { if (status === undefined) { return; } this.stateValue.next(status === types_1.IceMakerStatus.MAKING_ICE); }); } setState(nextState) { if (nextState === undefined) { this.logger.warn('Value not provided, ignoring command'); return []; } return this.statusState.setState(nextState ? types_1.IceMakerStatus.MAKING_ICE : types_1.IceMakerStatus.STANDBY); } } exports.IceMakerMakingIceState = IceMakerMakingIceState; //# sourceMappingURL=ice-maker.make-ice.js.map