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 @@ -Outlander PHEV Smartthings server
\ No newline at end of file +Outlander PHEV Smartthings server
\ No newline at end of file diff --git a/ui/static/js/3.03f8f9b3.chunk.js b/ui/static/js/3.03f8f9b3.chunk.js deleted file mode 100644 index 97a6d04..0000000 --- a/ui/static/js/3.03f8f9b3.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonpremote-ctrl-ui"]=this["webpackJsonpremote-ctrl-ui"]||[]).push([[3],{392:function(t,e,n){"use strict";n.r(e),n.d(e,"getCLS",(function(){return p})),n.d(e,"getFCP",(function(){return g})),n.d(e,"getFID",(function(){return F})),n.d(e,"getLCP",(function(){return k})),n.d(e,"getTTFB",(function(){return C}));var i,a,r,o,c=function(t,e){return{name:t,value:void 0===e?-1:e,delta:0,entries:[],id:"v1-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)}},u=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((function(t){return t.getEntries().map(e)}));return n.observe({type:t,buffered:!0}),n}}catch(t){}},s=function(t,e){var n=function n(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(t(i),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},f=function(t){addEventListener("pageshow",(function(e){e.persisted&&t(e)}),!0)},d="function"==typeof WeakSet?new WeakSet:new Set,m=function(t,e,n){var i;return function(){e.value>=0&&(n||d.has(e)||"hidden"===document.visibilityState)&&(e.delta=e.value-(i||0),(e.delta||void 0===i)&&(i=e.value,t(e)))}},p=function(t,e){var n,i=c("CLS",0),a=function(t){t.hadRecentInput||(i.value+=t.value,i.entries.push(t),n())},r=u("layout-shift",a);r&&(n=m(t,i,e),s((function(){r.takeRecords().map(a),n()})),f((function(){i=c("CLS",0),n=m(t,i,e)})))},v=-1,l=function(){return"hidden"===document.visibilityState?0:1/0},h=function(){s((function(t){var e=t.timeStamp;v=e}),!0)},S=function(){return v<0&&(v=l(),h(),f((function(){setTimeout((function(){v=l(),h()}),0)}))),{get timeStamp(){return v}}},g=function(t,e){var n,i=S(),a=c("FCP"),r=u("paint",(function(t){"first-contentful-paint"===t.name&&(r&&r.disconnect(),t.startTime=0&&a1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){E(t,e),a()},i=function(){a()},a=function(){removeEventListener("pointerup",n,y),removeEventListener("pointercancel",i,y)};addEventListener("pointerup",n,y),addEventListener("pointercancel",i,y)}(e,t):E(e,t)}},b=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,T,y)}))},F=function(t,e){var n,r=S(),p=c("FID"),v=function(t){t.startTime=0&&(n||u.has(t)||\"hidden\"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},f=function(e,t){var n,i=a(\"CLS\",0),u=function(e){e.hadRecentInput||(i.value+=e.value,i.entries.push(e),n())},f=r(\"layout-shift\",u);f&&(n=s(e,i,t),o((function(){f.takeRecords().map(u),n()})),c((function(){i=a(\"CLS\",0),n=s(e,i,t)})))},m=-1,v=function(){return\"hidden\"===document.visibilityState?0:1/0},d=function(){o((function(e){var t=e.timeStamp;m=t}),!0)},p=function(){return m<0&&(m=v(),d(),c((function(){setTimeout((function(){m=v(),d()}),0)}))),{get timeStamp(){return m}}},l=function(e,t){var n,i=p(),o=a(\"FCP\"),f=r(\"paint\",(function(e){\"first-contentful-paint\"===e.name&&(f&&f.disconnect(),e.startTime=0&&t1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){y(e,t),a()},i=function(){a()},a=function(){removeEventListener(\"pointerup\",n,h),removeEventListener(\"pointercancel\",i,h)};addEventListener(\"pointerup\",n,h),addEventListener(\"pointercancel\",i,h)}(t,e):y(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,E,h)}))},L=function(n,f){var m,v=p(),d=a(\"FID\"),l=function(e){e.startTime=0&&(n||m.has(e)||"hidden"===document.visibilityState)&&(e.delta=e.value-(i||0),(e.delta||void 0===i)&&(i=e.value,t(e)))}},d=function(t,e){var n,i=u("CLS",0),r=function(t){t.hadRecentInput||(i.value+=t.value,i.entries.push(t),n())},a=c("layout-shift",r);a&&(n=p(t,i,e),f((function(){a.takeRecords().map(r),n()})),s((function(){i=u("CLS",0),n=p(t,i,e)})))},v=-1,l=function(){return"hidden"===document.visibilityState?0:1/0},h=function(){f((function(t){var e=t.timeStamp;v=e}),!0)},g=function(){return v<0&&(v=l(),h(),s((function(){setTimeout((function(){v=l(),h()}),0)}))),{get timeStamp(){return v}}},S=function(t,e){var n,i=g(),r=u("FCP"),a=function(t){"first-contentful-paint"===t.name&&(f&&f.disconnect(),t.startTime=0&&r1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var n=function(){w(t,e),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,y),removeEventListener("pointercancel",i,y)};addEventListener("pointerup",n,y),addEventListener("pointercancel",i,y)}(e,t):w(e,t)}},b=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,T,y)}))},F=function(t,e){var n,a=g(),d=u("FID"),v=function(t){t.startTime=0&&(n||u.has(t)||\"hidden\"===document.visibilityState)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},s=function(e,t){var n,i=a(\"CLS\",0),u=function(e){e.hadRecentInput||(i.value+=e.value,i.entries.push(e),n())},s=r(\"layout-shift\",u);s&&(n=f(e,i,t),o((function(){s.takeRecords().map(u),n()})),c((function(){i=a(\"CLS\",0),n=f(e,i,t)})))},m=-1,p=function(){return\"hidden\"===document.visibilityState?0:1/0},v=function(){o((function(e){var t=e.timeStamp;m=t}),!0)},d=function(){return m<0&&(m=p(),v(),c((function(){setTimeout((function(){m=p(),v()}),0)}))),{get timeStamp(){return m}}},l=function(e,t){var n,i=d(),o=a(\"FCP\"),s=function(e){\"first-contentful-paint\"===e.name&&(p&&p.disconnect(),e.startTime=0&&t1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){y(e,t),a()},i=function(){a()},a=function(){removeEventListener(\"pointerup\",n,h),removeEventListener(\"pointercancel\",i,h)};addEventListener(\"pointerup\",n,h),addEventListener(\"pointercancel\",i,h)}(t,e):y(t,e)}},w=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,E,h)}))},L=function(n,s){var m,p=d(),v=a(\"FID\"),l=function(e){e.startTime