UNPKG

homebridge-green-mountain-grills

Version:

A dynamic platform plugin for homebridge to provide access to your GMG WiFi smoker.

46 lines 1.46 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.SmokerService = void 0; const GMGClient_1 = __importDefault(require("./GMGClient")); class SmokerService { constructor(log, ipAddress) { this.log = log; this.gmgClient = new GMGClient_1.default({ host: ipAddress, logger: log }); } async getSmoker() { try { const modafw = await this.gmgClient.getGrillModelAndFirmware(); return { ipAddress: await this.gmgClient.discoverGrill(), deviceId: await this.gmgClient.getGrillId(), status: await this.gmgClient.getGrillStatus(), deviceModel: modafw.model, firmware: modafw.firmware }; } catch (e) { this.log.error(e); return Promise.reject(e); } } async getStatus() { return this.gmgClient.getGrillStatus(); } turnGrillOn() { this.gmgClient.powerOnGrill(); } turnGrillOff() { this.gmgClient.powerOffGrill(); } setFoodTemp(value) { this.gmgClient.setFoodTemp(value); } setGrillTemp(value) { this.gmgClient.setGrillTemp(value); } } exports.SmokerService = SmokerService; //# sourceMappingURL=gmg-service.js.map