UNPKG

node-red-contrib-home-assistant-websocket

Version:
2 lines (1 loc) 569 B
"use strict";const{merge:n}=require("lodash"),i=require("./EventsHaNode"),{INTEGRATION_UNLOADED:a}=require("../const"),u={config:{outputs:1,entityType:{},config:{},exposeToHomeAssistant:()=>!0}};class c extends i{constructor({node:e,config:o,RED:s,status:r,nodeOptions:t={}}){t=n({},u,t),super({node:e,config:o,RED:s,status:r,nodeOptions:t})}onHaIntegration(e){super.onHaIntegration(e),e===a&&(this.node.error("Node-RED custom integration has been removed from Home Assistant it is needed for this node to function."),this.status.setFailed("Error"))}}module.exports=c;