From bb5c8cf737274d3178fc7f487e0ac2afe0245b0b Mon Sep 17 00:00:00 2001 From: Sebastian Haesselbarth Date: Mon, 3 Oct 2022 10:56:32 +0200 Subject: [PATCH] chore: release v1.2.1 - Fix getting data directory --- README.md | 2 +- build/main.js | 2 +- build/main.js.map | 4 ++-- io-package.json | 11 +++++------ package-lock.json | 2 +- package.json | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7e429d3..cb8e036 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ You can read other values but I think you can't write other values. Other values https://github.com/sebilm/ioBroker.nibeuplink/blob/master/nibe-fetcher.js#L41 ## Changelog -### **WORK IN PROGRESS** +### 1.2.1 (2022-10-03) - Fix getting data directory ### 1.2.0 (2022-10-02) diff --git a/build/main.js b/build/main.js index 7d3ae76..a29fd13 100644 --- a/build/main.js +++ b/build/main.js @@ -100,7 +100,7 @@ class NibeUplink extends utils.Adapter { this.setState("info.currentError", { val: "Missing settings!", ack: true }); return; } - const dataDir = path.normalize(utils.controllerDir + "/" + utils.getAbsoluteDefaultDataDir()); + const dataDir = utils.getAbsoluteDefaultDataDir(); let storeDir = path.join(dataDir, "nibeuplink"); try { if (!fs.existsSync(storeDir)) { diff --git a/build/main.js.map b/build/main.js.map index a85ff0f..2d17b3f 100644 --- a/build/main.js.map +++ b/build/main.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../src/main.ts"], - "sourcesContent": ["/*\n * nibeuplink adapter\n */\n\nimport * as utils from '@iobroker/adapter-core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as fetcher from './nibe-fetcher';\n\n// Helper functions:\n\n// For todays date;\ndeclare global {\n interface Date {\n today(): string;\n }\n}\nDate.prototype.today = function (): string {\n return (\n this.getFullYear() +\n '-' +\n (this.getMonth() + 1 < 10 ? '0' : '') +\n (this.getMonth() + 1) +\n '-' +\n (this.getDate() < 10 ? '0' : '') +\n this.getDate()\n );\n};\n\n// For the time now\ndeclare global {\n interface Date {\n timeNow(): string;\n }\n}\nDate.prototype.timeNow = function (): string {\n return (\n (this.getHours() < 10 ? '0' : '') +\n this.getHours() +\n ':' +\n (this.getMinutes() < 10 ? '0' : '') +\n this.getMinutes() +\n ':' +\n (this.getSeconds() < 10 ? '0' : '') +\n this.getSeconds()\n );\n};\n\nasync function createDeviceAsync(adapter: NibeUplink, path: string, name: string): Promise {\n await adapter.setObjectNotExistsAsync(path, {\n type: 'device',\n common: {\n name: name,\n role: 'text',\n },\n native: {},\n });\n}\n\nasync function createChannelAsync(adapter: NibeUplink, path: string, name: string): Promise {\n await adapter.setObjectNotExistsAsync(path, {\n type: 'channel',\n common: {\n name: name,\n role: 'text',\n },\n native: {},\n });\n}\n\nfunction setProperty(obj: any, propertyName: K, value: any): void {\n obj[propertyName] = value;\n}\n\nclass NibeUplink extends utils.Adapter {\n public constructor(options: Partial = {}) {\n super({\n ...options,\n name: 'nibeuplink',\n });\n this.on('ready', this.onReady.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n // this.on('objectChange', this.onObjectChange.bind(this));\n // this.on('message', this.onMessage.bind(this));\n this.on('unload', this.onUnload.bind(this));\n }\n\n private fetcher: fetcher.Fetcher | undefined;\n\n /**\n * Is called when databases are connected and adapter received configuration.\n */\n private async onReady(): Promise {\n // Initialize your adapter here\n\n this.log.info('Starting adapter.');\n\n let refreshInterval: number = this.config.Interval * 60;\n if (refreshInterval < 60) {\n refreshInterval = 60;\n }\n\n const identifier: string = this.config.Identifier.trim();\n const secret: string = this.config.Secret.trim();\n const callbackURL: string = this.config.CallbackURL.trim();\n const configured: boolean = this.config.Configured;\n\n let error = false;\n if (identifier == '' || identifier == null) {\n if (configured != false) {\n this.log.error('Missing Identifier in the settings!');\n }\n error = true;\n }\n if (secret == '' || secret == null) {\n if (configured != false) {\n this.log.error('Missing Secret in the settings!');\n }\n error = true;\n }\n if (callbackURL == '' || callbackURL == null) {\n if (configured != false) {\n this.log.error('Missing Callback URL in the settings!');\n }\n error = true;\n }\n if (this.config.SystemId == '' || this.config.SystemId == null) {\n if (configured != false) {\n this.log.error('Missing System ID in the settings!');\n }\n error = true;\n }\n if (error) {\n this.setState('info.connection', { val: false, ack: true });\n this.setState('info.currentError', { val: 'Missing settings!', ack: true });\n return;\n }\n\n const dataDir: string = path.normalize(utils.controllerDir + '/' + utils.getAbsoluteDefaultDataDir());\n let storeDir: string = path.join(dataDir, 'nibeuplink');\n try {\n // create directory\n if (!fs.existsSync(storeDir)) {\n fs.mkdirSync(storeDir);\n }\n } catch (err) {\n this.log.error('Could not create storage directory (' + storeDir + '): ' + err);\n storeDir = __dirname;\n }\n const storeFile = path.join(storeDir, 'session.' + this.instance + '.json');\n const manageId = !this.config.ManageId ? 'MANAGE' : this.config.ManageId;\n\n this.fetcher = new fetcher.Fetcher(\n {\n clientId: identifier,\n clientSecret: secret,\n redirectUri: callbackURL,\n interval: refreshInterval,\n authCode: this.config.AuthCode.trim(),\n systemId: this.config.SystemId,\n language: this.config.Language,\n enableManage: this.config.EnableManageSupport,\n managedParameters: this.config.ManagedParameters,\n sessionStore: storeFile,\n },\n this,\n );\n\n this.fetcher.on('data', async (d) => {\n const data = d as fetcher.Data;\n this.log.debug('Data received.');\n this.log.silly(JSON.stringify(data, null, ' '));\n\n this.setState('info.connection', { val: true, expire: refreshInterval + 30, ack: true });\n\n const newDate = new Date();\n const datetime = newDate.today() + ' ' + newDate.timeNow();\n this.setState('info.updateTime', { val: datetime, ack: true });\n this.setState('info.currentError', { val: '', ack: true });\n\n data.unitData.forEach(async (unit) => {\n const unitPath = `UNIT_${unit.systemUnitId}`;\n await createDeviceAsync(this, unitPath, `${unit.name} (${unit.product})`);\n unit.categories?.forEach(async (category) => {\n const categoryPath = `${unitPath}.${category.categoryId}`;\n await createChannelAsync(this, categoryPath, category.name);\n category.parameters.forEach(async (parameter) => {\n const key = parameter['key'];\n let title = parameter['title'];\n const designation = parameter['designation'];\n if (designation != null && designation != '') {\n title = `${title} (${designation})`;\n }\n const valuePath = `${categoryPath}.${key}`;\n\n await this.setObjectNotExistsAsync(valuePath, {\n type: 'state',\n common: {\n name: title,\n type: 'number',\n role: 'value',\n unit: parameter['unit'],\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(valuePath, { val: parameter['value'], ack: true });\n\n const displayPath = `${categoryPath}.${key}_DISPLAY`;\n await this.setObjectNotExistsAsync(displayPath, {\n type: 'state',\n common: {\n name: `${title} [Display]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(displayPath, { val: parameter['displayValue'], ack: true });\n\n if (unit.systemUnitId == 0) {\n // update deprecated subpath values if present (pre 0.4.0):\n const oldValuePath = `${category.categoryId}.${key}`;\n this.getObject(oldValuePath, (err, obj) => {\n if (obj != null) {\n this.setState(oldValuePath, { val: parameter['value'], ack: true });\n }\n });\n const oldDisplayPath = `${category.categoryId}.${key}_DISPLAY`;\n this.getObject(oldDisplayPath, (err, obj) => {\n if (obj != null) {\n this.setState(oldDisplayPath, { val: parameter['displayValue'], ack: true });\n }\n });\n }\n });\n });\n });\n if (data.manageData != null) {\n const manageName = !this.config.ManageName ? 'Manage' : this.config.ManageName;\n await createDeviceAsync(this, manageId, manageName);\n data.manageData.forEach(async (manageData) => {\n const unit = manageData.unit;\n manageData.parameters.forEach(async (parameter) => {\n const parameterId = parameter.parameterId.toString();\n const conf = this.config.ManagedParameters.find((x) => x.unit == unit && x.parameter == parameterId);\n let key;\n if (conf != null && conf.id) {\n key = conf.id;\n } else {\n key = `${unit}_${parameterId}_${parameter.key}`;\n }\n let title;\n if (conf != null && conf.name) {\n title = conf.name;\n } else {\n title = parameter.title;\n const designation = parameter.designation;\n if (designation != null && designation != '') {\n title = `${title} (${designation})`;\n }\n }\n const valuePath = `${manageId}.${key}`;\n\n await this.setObjectNotExistsAsync(valuePath, {\n type: 'state',\n common: {\n name: title,\n type: 'number',\n role: 'value',\n unit: parameter['unit'],\n read: true,\n write: true,\n },\n native: {\n deviceUnit: unit,\n parameterId: parameter.parameterId,\n divideBy: parameter.divideBy,\n },\n });\n await this.setStateAsync(valuePath, { val: parameter['value'], ack: true });\n\n const displayPath = `${manageId}.${key}_DISPLAY`;\n await this.setObjectNotExistsAsync(displayPath, {\n type: 'state',\n common: {\n name: `${title} [Display]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(displayPath, { val: parameter['displayValue'], ack: true });\n });\n });\n }\n this.log.debug('Data processed.');\n });\n\n this.fetcher.on('error', (data) => {\n this.log.error('' + data);\n\n this.setState('info.connection', { val: false, ack: true });\n\n const newDate = new Date();\n const datetime = newDate.today() + ' ' + newDate.timeNow();\n this.setState('info.lastErrorTime', { val: datetime, ack: true });\n this.setState('info.lastError', { val: '' + data, ack: true });\n this.setState('info.currentError', { val: '' + data, ack: true });\n });\n\n if (this.config.EnableManageSupport === true) {\n this.subscribeStates(`${manageId}.*`);\n }\n\n this.log.info('Adapter started.');\n }\n\n /**\n * Is called when adapter shuts down - callback has to be called under any circumstances!\n */\n private onUnload(callback: () => void): void {\n try {\n if (this.fetcher != null) {\n this.fetcher.stop();\n }\n this.fetcher = undefined;\n this.setState('info.connection', { val: false, ack: true });\n this.log.info('Cleaned everything up...');\n callback();\n } catch (e) {\n callback();\n }\n }\n\n // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor.\n // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`.\n // /**\n // * Is called if a subscribed object changes\n // */\n // private onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void {\n // if (obj) {\n // // The object was changed\n // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`);\n // } else {\n // // The object was deleted\n // this.log.info(`object ${id} deleted`);\n // }\n // }\n\n /**\n * Is called if a subscribed state changes\n */\n private async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise {\n if (state != null && state.ack === false && state.val != null && this.fetcher != null) {\n this.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`);\n const obj = await this.getObjectAsync(id);\n if (\n obj != null &&\n obj.native != null &&\n obj.native.parameterId != null &&\n obj.native.parameterId != '' &&\n obj.native.deviceUnit != null &&\n obj.native.deviceUnit != ''\n ) {\n const params = {};\n const parameterId = obj.native.parameterId as number;\n setProperty(params, parameterId.toString(), state.val.toString());\n try {\n await this.fetcher.setParams(obj.native.deviceUnit, params);\n } catch (error) {\n const errorPath = `${id}_ERROR`;\n await this.setObjectNotExistsAsync(errorPath, {\n type: 'state',\n common: {\n name: `${obj.common.name} [Error]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n const errorMessage = error instanceof Error ? error.message : String(error);\n await this.setStateAsync(errorPath, { val: errorMessage, ack: true });\n }\n await this.fetcher.getParams(obj.native.deviceUnit, [obj.native.parameterId]);\n }\n }\n }\n\n // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor.\n // /**\n // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ...\n // * Using this method requires \"common.messagebox\" property to be set to true in io-package.json\n // */\n // private onMessage(obj: ioBroker.Message): void {\n // if (typeof obj === 'object' && obj.message) {\n // if (obj.command === 'send') {\n // // e.g. send email or pushover or whatever\n // this.log.info('send command');\n\n // // Send response in callback if required\n // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback);\n // }\n // }\n // }\n}\n\nif (require.main !== module) {\n // Export the constructor in compact mode\n module.exports = (options: Partial | undefined) => new NibeUplink(options);\n} else {\n // otherwise start the instance directly\n (() => new NibeUplink())();\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;AAIA,YAAuB;AACvB,SAAoB;AACpB,WAAsB;AACtB,cAAyB;AAUzB,KAAK,UAAU,QAAQ,WAAoB;AACvC,SACI,KAAK,YAAY,IACjB,OACC,KAAK,SAAS,IAAI,IAAI,KAAK,MAAM,OACjC,KAAK,SAAS,IAAI,KACnB,OACC,KAAK,QAAQ,IAAI,KAAK,MAAM,MAC7B,KAAK,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@iobroker/adapter-core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as fetcher from './nibe-fetcher';\n\n// Helper functions:\n\n// For todays date;\ndeclare global {\n interface Date {\n today(): string;\n }\n}\nDate.prototype.today = function (): string {\n return (\n this.getFullYear() +\n '-' +\n (this.getMonth() + 1 < 10 ? '0' : '') +\n (this.getMonth() + 1) +\n '-' +\n (this.getDate() < 10 ? '0' : '') +\n this.getDate()\n );\n};\n\n// For the time now\ndeclare global {\n interface Date {\n timeNow(): string;\n }\n}\nDate.prototype.timeNow = function (): string {\n return (\n (this.getHours() < 10 ? '0' : '') +\n this.getHours() +\n ':' +\n (this.getMinutes() < 10 ? '0' : '') +\n this.getMinutes() +\n ':' +\n (this.getSeconds() < 10 ? '0' : '') +\n this.getSeconds()\n );\n};\n\nasync function createDeviceAsync(adapter: NibeUplink, path: string, name: string): Promise {\n await adapter.setObjectNotExistsAsync(path, {\n type: 'device',\n common: {\n name: name,\n role: 'text',\n },\n native: {},\n });\n}\n\nasync function createChannelAsync(adapter: NibeUplink, path: string, name: string): Promise {\n await adapter.setObjectNotExistsAsync(path, {\n type: 'channel',\n common: {\n name: name,\n role: 'text',\n },\n native: {},\n });\n}\n\nfunction setProperty(obj: any, propertyName: K, value: any): void {\n obj[propertyName] = value;\n}\n\nclass NibeUplink extends utils.Adapter {\n public constructor(options: Partial = {}) {\n super({\n ...options,\n name: 'nibeuplink',\n });\n this.on('ready', this.onReady.bind(this));\n this.on('stateChange', this.onStateChange.bind(this));\n // this.on('objectChange', this.onObjectChange.bind(this));\n // this.on('message', this.onMessage.bind(this));\n this.on('unload', this.onUnload.bind(this));\n }\n\n private fetcher: fetcher.Fetcher | undefined;\n\n /**\n * Is called when databases are connected and adapter received configuration.\n */\n private async onReady(): Promise {\n // Initialize your adapter here\n\n this.log.info('Starting adapter.');\n\n let refreshInterval: number = this.config.Interval * 60;\n if (refreshInterval < 60) {\n refreshInterval = 60;\n }\n\n const identifier: string = this.config.Identifier.trim();\n const secret: string = this.config.Secret.trim();\n const callbackURL: string = this.config.CallbackURL.trim();\n const configured: boolean = this.config.Configured;\n\n let error = false;\n if (identifier == '' || identifier == null) {\n if (configured != false) {\n this.log.error('Missing Identifier in the settings!');\n }\n error = true;\n }\n if (secret == '' || secret == null) {\n if (configured != false) {\n this.log.error('Missing Secret in the settings!');\n }\n error = true;\n }\n if (callbackURL == '' || callbackURL == null) {\n if (configured != false) {\n this.log.error('Missing Callback URL in the settings!');\n }\n error = true;\n }\n if (this.config.SystemId == '' || this.config.SystemId == null) {\n if (configured != false) {\n this.log.error('Missing System ID in the settings!');\n }\n error = true;\n }\n if (error) {\n this.setState('info.connection', { val: false, ack: true });\n this.setState('info.currentError', { val: 'Missing settings!', ack: true });\n return;\n }\n\n const dataDir: string = utils.getAbsoluteDefaultDataDir();\n let storeDir: string = path.join(dataDir, 'nibeuplink');\n try {\n // create directory\n if (!fs.existsSync(storeDir)) {\n fs.mkdirSync(storeDir);\n }\n } catch (err) {\n this.log.error('Could not create storage directory (' + storeDir + '): ' + err);\n storeDir = __dirname;\n }\n const storeFile = path.join(storeDir, 'session.' + this.instance + '.json');\n const manageId = !this.config.ManageId ? 'MANAGE' : this.config.ManageId;\n\n this.fetcher = new fetcher.Fetcher(\n {\n clientId: identifier,\n clientSecret: secret,\n redirectUri: callbackURL,\n interval: refreshInterval,\n authCode: this.config.AuthCode.trim(),\n systemId: this.config.SystemId,\n language: this.config.Language,\n enableManage: this.config.EnableManageSupport,\n managedParameters: this.config.ManagedParameters,\n sessionStore: storeFile,\n },\n this,\n );\n\n this.fetcher.on('data', async (d) => {\n const data = d as fetcher.Data;\n this.log.debug('Data received.');\n this.log.silly(JSON.stringify(data, null, ' '));\n\n this.setState('info.connection', { val: true, expire: refreshInterval + 30, ack: true });\n\n const newDate = new Date();\n const datetime = newDate.today() + ' ' + newDate.timeNow();\n this.setState('info.updateTime', { val: datetime, ack: true });\n this.setState('info.currentError', { val: '', ack: true });\n\n data.unitData.forEach(async (unit) => {\n const unitPath = `UNIT_${unit.systemUnitId}`;\n await createDeviceAsync(this, unitPath, `${unit.name} (${unit.product})`);\n unit.categories?.forEach(async (category) => {\n const categoryPath = `${unitPath}.${category.categoryId}`;\n await createChannelAsync(this, categoryPath, category.name);\n category.parameters.forEach(async (parameter) => {\n const key = parameter['key'];\n let title = parameter['title'];\n const designation = parameter['designation'];\n if (designation != null && designation != '') {\n title = `${title} (${designation})`;\n }\n const valuePath = `${categoryPath}.${key}`;\n\n await this.setObjectNotExistsAsync(valuePath, {\n type: 'state',\n common: {\n name: title,\n type: 'number',\n role: 'value',\n unit: parameter['unit'],\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(valuePath, { val: parameter['value'], ack: true });\n\n const displayPath = `${categoryPath}.${key}_DISPLAY`;\n await this.setObjectNotExistsAsync(displayPath, {\n type: 'state',\n common: {\n name: `${title} [Display]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(displayPath, { val: parameter['displayValue'], ack: true });\n\n if (unit.systemUnitId == 0) {\n // update deprecated subpath values if present (pre 0.4.0):\n const oldValuePath = `${category.categoryId}.${key}`;\n this.getObject(oldValuePath, (err, obj) => {\n if (obj != null) {\n this.setState(oldValuePath, { val: parameter['value'], ack: true });\n }\n });\n const oldDisplayPath = `${category.categoryId}.${key}_DISPLAY`;\n this.getObject(oldDisplayPath, (err, obj) => {\n if (obj != null) {\n this.setState(oldDisplayPath, { val: parameter['displayValue'], ack: true });\n }\n });\n }\n });\n });\n });\n if (data.manageData != null) {\n const manageName = !this.config.ManageName ? 'Manage' : this.config.ManageName;\n await createDeviceAsync(this, manageId, manageName);\n data.manageData.forEach(async (manageData) => {\n const unit = manageData.unit;\n manageData.parameters.forEach(async (parameter) => {\n const parameterId = parameter.parameterId.toString();\n const conf = this.config.ManagedParameters.find((x) => x.unit == unit && x.parameter == parameterId);\n let key;\n if (conf != null && conf.id) {\n key = conf.id;\n } else {\n key = `${unit}_${parameterId}_${parameter.key}`;\n }\n let title;\n if (conf != null && conf.name) {\n title = conf.name;\n } else {\n title = parameter.title;\n const designation = parameter.designation;\n if (designation != null && designation != '') {\n title = `${title} (${designation})`;\n }\n }\n const valuePath = `${manageId}.${key}`;\n\n await this.setObjectNotExistsAsync(valuePath, {\n type: 'state',\n common: {\n name: title,\n type: 'number',\n role: 'value',\n unit: parameter['unit'],\n read: true,\n write: true,\n },\n native: {\n deviceUnit: unit,\n parameterId: parameter.parameterId,\n divideBy: parameter.divideBy,\n },\n });\n await this.setStateAsync(valuePath, { val: parameter['value'], ack: true });\n\n const displayPath = `${manageId}.${key}_DISPLAY`;\n await this.setObjectNotExistsAsync(displayPath, {\n type: 'state',\n common: {\n name: `${title} [Display]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n await this.setStateAsync(displayPath, { val: parameter['displayValue'], ack: true });\n });\n });\n }\n this.log.debug('Data processed.');\n });\n\n this.fetcher.on('error', (data) => {\n this.log.error('' + data);\n\n this.setState('info.connection', { val: false, ack: true });\n\n const newDate = new Date();\n const datetime = newDate.today() + ' ' + newDate.timeNow();\n this.setState('info.lastErrorTime', { val: datetime, ack: true });\n this.setState('info.lastError', { val: '' + data, ack: true });\n this.setState('info.currentError', { val: '' + data, ack: true });\n });\n\n if (this.config.EnableManageSupport === true) {\n this.subscribeStates(`${manageId}.*`);\n }\n\n this.log.info('Adapter started.');\n }\n\n /**\n * Is called when adapter shuts down - callback has to be called under any circumstances!\n */\n private onUnload(callback: () => void): void {\n try {\n if (this.fetcher != null) {\n this.fetcher.stop();\n }\n this.fetcher = undefined;\n this.setState('info.connection', { val: false, ack: true });\n this.log.info('Cleaned everything up...');\n callback();\n } catch (e) {\n callback();\n }\n }\n\n // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor.\n // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`.\n // /**\n // * Is called if a subscribed object changes\n // */\n // private onObjectChange(id: string, obj: ioBroker.Object | null | undefined): void {\n // if (obj) {\n // // The object was changed\n // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`);\n // } else {\n // // The object was deleted\n // this.log.info(`object ${id} deleted`);\n // }\n // }\n\n /**\n * Is called if a subscribed state changes\n */\n private async onStateChange(id: string, state: ioBroker.State | null | undefined): Promise {\n if (state != null && state.ack === false && state.val != null && this.fetcher != null) {\n this.log.debug(`state ${id} changed: ${state.val} (ack = ${state.ack})`);\n const obj = await this.getObjectAsync(id);\n if (\n obj != null &&\n obj.native != null &&\n obj.native.parameterId != null &&\n obj.native.parameterId != '' &&\n obj.native.deviceUnit != null &&\n obj.native.deviceUnit != ''\n ) {\n const params = {};\n const parameterId = obj.native.parameterId as number;\n setProperty(params, parameterId.toString(), state.val.toString());\n try {\n await this.fetcher.setParams(obj.native.deviceUnit, params);\n } catch (error) {\n const errorPath = `${id}_ERROR`;\n await this.setObjectNotExistsAsync(errorPath, {\n type: 'state',\n common: {\n name: `${obj.common.name} [Error]`,\n type: 'string',\n role: 'text',\n read: true,\n write: false,\n },\n native: {},\n });\n const errorMessage = error instanceof Error ? error.message : String(error);\n await this.setStateAsync(errorPath, { val: errorMessage, ack: true });\n }\n await this.fetcher.getParams(obj.native.deviceUnit, [obj.native.parameterId]);\n }\n }\n }\n\n // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor.\n // /**\n // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ...\n // * Using this method requires \"common.messagebox\" property to be set to true in io-package.json\n // */\n // private onMessage(obj: ioBroker.Message): void {\n // if (typeof obj === 'object' && obj.message) {\n // if (obj.command === 'send') {\n // // e.g. send email or pushover or whatever\n // this.log.info('send command');\n\n // // Send response in callback if required\n // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback);\n // }\n // }\n // }\n}\n\nif (require.main !== module) {\n // Export the constructor in compact mode\n module.exports = (options: Partial | undefined) => new NibeUplink(options);\n} else {\n // otherwise start the instance directly\n (() => new NibeUplink())();\n}\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AAAA,MAChF;AAAA,IACJ;AAAA,EACJ;AAkBJ;AAEA,IAAI,QAAQ,SAAS,QAAQ;AAEzB,SAAO,UAAU,CAAC,YAAuD,IAAI,WAAW,OAAO;AACnG,OAAO;AAEH,GAAC,MAAM,IAAI,WAAW,GAAG;AAC7B;", "names": ["path"] } diff --git a/io-package.json b/io-package.json index 0a1ce0a..000b377 100644 --- a/io-package.json +++ b/io-package.json @@ -1,11 +1,13 @@ { "common": { "name": "nibeuplink", - "version": "1.2.0", + "version": "1.2.1", "news": { + "1.2.1": { + "en": "Fix getting data directory" + }, "1.2.0": { - "en": "Requires js-controller >= 3.3.22 and admin >= 5.0.0\nUpdate some files from up-to-date adapter creator\nBump dependencies", - "de": "Erfordert js-controller >= 3.3.22 und Admin >= 5.0.0\nEinige Dateien vom aktuellen Adapter Creator wurden aktualisiert\nAbhängigkeiten angehoben" + "en": "Requires js-controller >= 3.3.22 and admin >= 5.0.0\nUpdate some files from up-to-date adapter creator\nBump dependencies" }, "1.1.1": { "en": "Fix write support (does not send zero) #6 #128\nBump dependencies" @@ -21,9 +23,6 @@ }, "0.5.3": { "en": "Bump dependencies" - }, - "0.5.2": { - "en": "Change default callback URL to own GitHub Pages\nBump dependencies" } }, "title": "Nibe Uplink", diff --git a/package-lock.json b/package-lock.json index 0451706..4473f5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "iobroker.nibeuplink", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 550d2c9..6424ebf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.nibeuplink", - "version": "1.2.0", + "version": "1.2.1", "description": "With this adapter data of a Nibe heat pump can be read from Nibe Uplink.", "author": { "name": "Sebastian Haesselbarth",