UNPKG

node-red-contrib-home-assistant-websocket

Version:
93 lines (92 loc) 2.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = [ { version: 0, up: (schema) => { const newSchema = { ...schema, version: 0, }; return newSchema; }, }, { version: 1, up: (schema) => { const newSchema = { ...schema, version: 1, sunday: true, monday: true, tuesday: true, wednesday: true, thursday: true, friday: true, saturday: true, }; return newSchema; }, }, { version: 2, up: (schema) => { const isDefaultPayload = schema.payloadType === 'jsonata' && schema.payload === '$entity().state'; const newSchema = { ...schema, version: 2, outputProperties: [ { property: 'payload', propertyType: 'msg', value: isDefaultPayload ? '' : schema.payload, valueType: isDefaultPayload ? 'entityState' : schema.payloadType, }, { property: 'data', propertyType: 'msg', value: '', valueType: 'entity', }, { property: 'topic', propertyType: 'msg', value: '', valueType: 'triggerId', }, ], payload: undefined, payloadType: undefined, }; return newSchema; }, }, { version: 3, up: (schema) => { const newSchema = { ...schema, version: 3, exposeAsEntityConfig: '', }; newSchema.debugenabled = undefined; newSchema.exposeToHomeAssistant = undefined; newSchema.haConfig = undefined; return newSchema; }, }, { version: 4, up: (schema) => { const newSchema = { ...schema, version: 4, ignorePastDate: false, }; return newSchema; }, }, ];