node-red-contrib-home-assistant-websocket
Version:
Node-RED integration with Home Assistant through websocket and REST API
19 lines (18 loc) • 721 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Websocket_1 = require("../../homeAssistant/Websocket");
const Events_1 = __importDefault(require("./Events"));
class ClientEvents extends Events_1.default {
constructor({ node, emitter }) {
super({ node, emitter });
this.emitter.on(Websocket_1.ClientEvent.Error, this.onHaEventsError.bind(this));
}
onHaEventsError(err) {
if (err === null || err === void 0 ? void 0 : err.message)
this.node.error(err.message);
}
}
exports.default = ClientEvents;
;