/* nodejs-poolController. An application to control pool equipment. Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021, 2022. Russell Goldin, tagyoureit. russ.goldin@gmail.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ import { Inbound } from "../Messages"; import { state } from "../../../State"; import { sys, ControllerType } from "../../../Equipment"; import { logger } from "../../../../logger/Logger"; export class IntelliValveStateMessage { public static process(msg: Inbound) { if (sys.controllerType === ControllerType.Unknown) return; // We only want to process the messages that are coming from IntelliValve. if (msg.source !== 12) return; switch (msg.action) { case 82: // This is hail from the valve that says it is not bound yet. break; default: logger.info(`IntelliValve sent an unknown action ${msg.action}`); break; } state.emitEquipmentChanges(); } }