diff --git a/lib/Localization.js b/lib/Localization.js index 012d8cc..9a48af2 100644 --- a/lib/Localization.js +++ b/lib/Localization.js @@ -18,7 +18,7 @@ const Labels = { err1ignition: 'Theft Alarm Notification. Illegal Vehicle Movement Occurred.', err1silent: 'Theft Alarm Notification. Unauthorized Vibration Occurred.', err1other: 'Illegal Access Occurred.', - confirm: 'Confirm action execution', + confirm: 'Default confirm action execution', batteryHeater: 'The battery is warming up', preACContInfo: 'Pre A/C did not fulfill Permission conditions. Please check conditions:\n' + 'Power supply mode of the electric motor switch: OFF\n' @@ -29,6 +29,24 @@ const Labels = { + 'Quick charging is not being performed\n' + 'The EV remote-ECU is normal\n' + 'The plug-in hybrid EV system is normal\n ', + evseSlow: 'Confirmation: EVSE Slow Charge', + evseFastCharge: 'Confirmation: EVSE Fast Charge', + evseDisableCharge: 'Confirmation: EVSE Disable Charger', + cooling10Mins: 'Confirmation: Cooling Mode 10 Mins', + cooling20Mins: 'Confirmation: Cooling Mode 20 Mins', + cooling30Mins: 'Confirmation: Cooling Mode 30 Mins', + windscreen10Mins: 'Confirmation: Windscreen Mode 10 Mins', + windscreen20Mins: 'Confirmation: Windscreen Mode 20 Mins', + windscreen30Mins: 'Confirmation: Windscreen Mode 30 Mins', + heating10Mins: 'Confirmation: Heating Mode 10 Mins', + heating20Mins: 'Confirmation: Heating Mode 20 Mins', + heating30Mins: 'Confirmation: Heating Mode 30 Mins', + airconOn: 'Confirmation: Air conditioner On', + airconOff: 'Confirmation: Air conditioner Off', + headlightsOn: 'Confirmation: Headlights On', + headlightsOff: 'Confirmation: Headlights Off', + parkinglightsOn: 'Confirmation: Parkinglights On', + parkinglightsOff: 'Confirmation: Parkinglights Off', }; function getLabels() { diff --git a/lib/RussianLanguage.js b/lib/RussianLanguage.js index 1b5c810..a1a40f0 100644 --- a/lib/RussianLanguage.js +++ b/lib/RussianLanguage.js @@ -15,7 +15,25 @@ const RussianLabels = { err1ignition: 'Предупреждение противоугонной системы. Попытка доступа незарегистрированным ключем.', err1silent: 'Предупреждение противоугонной системы. Зарегистрирована вибрация автомобиля.', err1other: 'Предупреждение противоугонной системы. Нелегальный доступ к автомобилю.', - confirm: 'Подтверждение выполнения операции', + confirm: 'Подтверждение выполнения операции по умолчанию', batteryHeater: 'Силовая батарея разогревается', + cooling10Mins: 'Подтверждение: Режим Охлаждения на 10 Мин.', + cooling20Mins: 'Подтверждение: Режим Охлаждения на 20 Мин.', + cooling30Mins: 'Подтверждение: Режим Охлаждения на 30 Мин.', + windscreen10Mins: 'Подтверждение: Обогрев лобового окна на 10 мин.', + windscreen20Mins: 'Подтверждение: Обогрев лобового окна на 20 мин.', + windscreen30Mins: 'Подтверждение: Обогрев лобового окна на 30 мин.', + heating10Mins: 'Подтверждение: Режим Отопителя на 10 мин.', + heating20Mins: 'Подтверждение: Режим Отопителя на 20 мин.', + heating30Mins: 'Подтверждение: Режим Отопителя на 30 мин.', + airconOn: 'Подтверждение: Включить Климат контроль', + airconOff: 'Подтверждение: Отключить Климат Контроль', + headlightsOn: 'Подтверждение: Включить Фары', + headlightsOff: 'Подтверждение: Выключить Фары', + parkinglightsOn: 'Подтверждение: Включить Парковочные огни', + parkinglightsOff: 'Подтверждение: Выключить Парковочные огни', + evseSlow: 'Подтверждение: EVSE Медленая зарядка', + evseFastCharge: 'Подтверждение: EVSE Быстрая зарядка', + evseDisableCharge: 'Подтверждение: EVSE Отключить зарядку ', }; module.exports.RussianLabels = RussianLabels; diff --git a/lib/env.js b/lib/env.js index 12e680a..367ec93 100644 --- a/lib/env.js +++ b/lib/env.js @@ -50,6 +50,24 @@ const defaultSettings = { confirm: 'sms', batteryHeater: 'none', preACContInfo: 'none', + cooling10Mins: 'sms', + cooling20Mins: 'sms', + cooling30Mins: 'sms', + windscreen10Mins: 'sms', + windscreen20Mins: 'sms', + windscreen30Mins: 'sms', + heating10Mins: 'sms', + heating20Mins: 'sms', + heating30Mins: 'sms', + airconOn: 'sms', + airconOff: 'sms', + headlightsOn: 'sms', + headlightsOff: 'sms', + parkinglightsOn: 'sms', + parkinglightsOff: 'sms', + evseSlow: 'none', + evseFastCharge: 'none', + evseDisableCharge: 'none', }, batteryFactory: 1.063829787, }; @@ -132,15 +150,11 @@ function readConfig() { if (!configJson.notifications) { configJson.notifications = defaultSettings.notifications; } - if (!configJson.notifications.confirm) { - configJson.notifications.confirm = defaultSettings.notifications.confirm; - } - if (!configJson.notifications.batteryHeater) { - configJson.notifications.batteryHeater = defaultSettings.notifications.batteryHeater; - } - if (!configJson.notifications.preACContInfo) { - configJson.notifications.preACContInfo = defaultSettings.notifications.preACContInfo; - } + Object.keys(defaultSettings.notifications).forEach((k) => { + if (!configJson.notifications[k]) { + configJson.notifications[k] = defaultSettings.notifications[k]; + } + }); if (!configJson.cron) { configJson.cron = defaultSettings.cron; } diff --git a/lib/smartthingsConnection.js b/lib/smartthingsConnection.js index 80cfeff..786d5db 100644 --- a/lib/smartthingsConnection.js +++ b/lib/smartthingsConnection.js @@ -385,6 +385,14 @@ async function updateSmartthingsDevices() { } } +function getActionNotification(device, rc) { + const notification = rc.notifications[device.actionId]; + if (notification === undefined || notification === null) { + return rc.notifications.confirm; + } + return notification; +} + function executeActionRes(rc, device) { if (device && device.actionId === 'forceUpdate') { updateSmartthingsDevices().then(() => { @@ -398,7 +406,7 @@ function executeActionRes(rc, device) { const promise = executeAction(device.id, rc); if (promise) { promise.then(async () => { - const notification = rc.notifications.confirm; + const notification = getActionNotification(device, rc); if (notification === 'both' || notification === 'sms') { addSMSNotification2(`${device.actionId} successfully executed`, rc); } diff --git a/package.json b/package.json index dc25fec..d41ebfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "smartthings-phevctl", - "version": "1.5.10", + "version": "1.6.0", "description": "smartthings remote ctrl", "main": "smartthings-phevctl.js", "scripts": { diff --git a/ui/asset-manifest.json b/ui/asset-manifest.json index 0525b35..e08a284 100644 --- a/ui/asset-manifest.json +++ b/ui/asset-manifest.json @@ -3,20 +3,20 @@ "main.css": "/static/css/main.7b86c5c1.chunk.css", "main.js": "/static/js/main.d8cb817e.chunk.js", "main.js.map": "/static/js/main.d8cb817e.chunk.js.map", - "runtime-main.js": "/static/js/runtime-main.bc57b7d3.js", - "runtime-main.js.map": "/static/js/runtime-main.bc57b7d3.js.map", + "runtime-main.js": "/static/js/runtime-main.92016c65.js", + "runtime-main.js.map": "/static/js/runtime-main.92016c65.js.map", "static/css/2.54787924.chunk.css": "/static/css/2.54787924.chunk.css", "static/js/2.c5ab04a9.chunk.js": "/static/js/2.c5ab04a9.chunk.js", "static/js/2.c5ab04a9.chunk.js.map": "/static/js/2.c5ab04a9.chunk.js.map", - "static/js/3.03f8f9b3.chunk.js": "/static/js/3.03f8f9b3.chunk.js", - "static/js/3.03f8f9b3.chunk.js.map": "/static/js/3.03f8f9b3.chunk.js.map", + "static/js/3.52e02c89.chunk.js": "/static/js/3.52e02c89.chunk.js", + "static/js/3.52e02c89.chunk.js.map": "/static/js/3.52e02c89.chunk.js.map", "index.html": "/index.html", "static/css/2.54787924.chunk.css.map": "/static/css/2.54787924.chunk.css.map", "static/css/main.7b86c5c1.chunk.css.map": "/static/css/main.7b86c5c1.chunk.css.map", "static/js/2.c5ab04a9.chunk.js.LICENSE.txt": "/static/js/2.c5ab04a9.chunk.js.LICENSE.txt" }, "entrypoints": [ - "static/js/runtime-main.bc57b7d3.js", + "static/js/runtime-main.92016c65.js", "static/css/2.54787924.chunk.css", "static/js/2.c5ab04a9.chunk.js", "static/css/main.7b86c5c1.chunk.css", diff --git a/ui/index.html b/ui/index.html index 9148453..81c9d39 100644 --- a/ui/index.html +++ b/ui/index.html @@ -1 +1 @@ -