From c125bb4de31c68d0292148b0b8d2369fdb66bf80 Mon Sep 17 00:00:00 2001 From: Nik_Dev Date: Mon, 24 May 2021 13:26:19 +0300 Subject: [PATCH] ver. 3.3.6 --- package-lock.json | 2 +- package.json | 2 +- src/index.ts | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13ff541..31254f8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "homebridge-philips-air", - "version": "3.3.5", + "version": "3.3.6", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 3193459..42f9b33 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "displayName": "Homebridge Philips Air", "name": "homebridge-philips-air", - "version": "3.3.5", + "version": "3.3.6", "description": "Homebridge Plugin for Philips Air Purifiers", "main": "dist/index.js", "repository": { diff --git a/src/index.ts b/src/index.ts index 6cdd05c..9231707 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,6 +25,7 @@ const PLUGIN_NAME = 'homebridge-philips-air'; const PLATFORM_NAME = 'philipsAir'; const pathToModule = require.resolve(PLUGIN_NAME); const pathTopyaircontrol = pathToModule.replace('dist/index.js', 'node_modules/philips-air/pyaircontrol.py'); +const pathToSensorFiles = pathToModule.replace('dist/index.js', 'sensor/'); enum CommandType { Polling = 0, @@ -229,7 +230,7 @@ class PhilipsAirPlatform implements DynamicPlatformPlugin { } if (purifier.config.logger) { if (purifier.config.temperature_sensor) { - const logger_temp = fs.createWriteStream('/usr/lib/node_modules/homebridge-philips-air/sensor/temp.txt', { + const logger_temp = fs.createWriteStream(pathToSensorFiles + 'temp.txt', { flags: 'w' }); if (!error || !stderr || !error && !stderr) { @@ -238,7 +239,7 @@ class PhilipsAirPlatform implements DynamicPlatformPlugin { } } if (purifier.config.humidity_sensor) { - const logger_hum = fs.createWriteStream('/usr/lib/node_modules/homebridge-philips-air/sensor/hum.txt', { + const logger_hum = fs.createWriteStream(pathToSensorFiles + 'hum.txt', { flags: 'w' }); if (!error || !stderr || !error && !stderr) {