bt-sensors-plugin-sk 1.2.6-beta-6a → 1.2.6-beta-6d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BTSensor.js +13 -3
- package/index.js +22 -15
- package/package.json +2 -2
- package/public/847.js +1 -1
- package/public/{698.js → 998.js} +5 -5
- package/public/remoteEntry.js +1 -1
- package/sensor_classes/EctiveBMS.js +9 -6
- package/sensor_classes/Junctek.js +3 -3
- package/sensor_classes/KilovaultHLXPlus.js +1 -1
- package/sensor_classes/MercurySmartcraft.js +10 -10
- package/sensor_classes/VictronBatteryMonitor.js +2 -2
- package/src/components/PluginConfigurationPanel.js +4 -1
- /package/public/{698.js.LICENSE.txt → 998.js.LICENSE.txt} +0 -0
package/public/remoteEntry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var bt_sensors_plugin_sk;(()=>{"use strict";var e,r,t,n,o,a,i,u,s,l,f,d,c,p,h,v,g,b,m,y,w,k={43237:(e,r,t)=>{var n={"./PluginConfigurationPanel":()=>Promise.all([t.e(
|
|
1
|
+
var bt_sensors_plugin_sk;(()=>{"use strict";var e,r,t,n,o,a,i,u,s,l,f,d,c,p,h,v,g,b,m,y,w,k={43237:(e,r,t)=>{var n={"./PluginConfigurationPanel":()=>Promise.all([t.e(998),t.e(847)]).then((()=>()=>t(62995)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},S={};function _(e){var r=S[e];if(void 0!==r)return r.exports;var t=S[e]={id:e,loaded:!1,exports:{}};return k[e].call(t.exports,t,t.exports,_),t.loaded=!0,t.exports}_.m=k,_.c=S,_.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return _.d(r,{a:r}),r},_.d=(e,r)=>{for(var t in r)_.o(r,t)&&!_.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},_.f={},_.e=e=>Promise.all(Object.keys(_.f).reduce(((r,t)=>(_.f[t](e,r),r)),[])),_.u=e=>e+".js",_.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),_.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="bt-sensors-plugin-sk:",_.l=(t,n,o,a)=>{if(e[t])e[t].push(n);else{var i,u;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var f=s[l];if(f.getAttribute("src")==t||f.getAttribute("data-webpack")==r+o){i=f;break}}i||(u=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,_.nc&&i.setAttribute("nonce",_.nc),i.setAttribute("data-webpack",r+o),i.src=t),e[t]=[n];var d=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},c=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),u&&document.head.appendChild(i)}},_.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},_.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{_.S={};var e={},r={};_.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];_.o(_.S,t)||(_.S[t]={});var a=_.S[t],i="bt-sensors-plugin-sk",u=[];return"default"===t&&((e,r,t,n)=>{var o=a[e]=a[e]||{},u=o[r];(!u||!u.loaded&&(1!=!u.eager?n:i>u.from))&&(o[r]={get:()=>_.e(159).then((()=>()=>_(96540))),from:i,eager:!1})})("react","16.14.0"),e[t]=u.length?Promise.all(u).then((()=>e[t]=1)):1}}})(),(()=>{var e;_.g.importScripts&&(e=_.g.location+"");var r=_.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),_.p=e})(),t=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},n=(e,r)=>{e=t(e),r=t(r);for(var n=0;;){if(n>=e.length)return n<r.length&&"u"!=(typeof r[n])[0];var o=e[n],a=(typeof o)[0];if(n>=r.length)return"u"==a;var i=r[n],u=(typeof i)[0];if(a!=u)return"o"==a&&"n"==u||"s"==u||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}},o=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,a=1;a<e.length;a++)n--,t+="u"==(typeof(u=e[a]))[0]?"-":(n>0?".":"")+(n=2,u);return t}var i=[];for(a=1;a<e.length;a++){var u=e[a];i.push(0===u?"not("+s()+")":1===u?"("+s()+" || "+s()+")":2===u?i.pop()+" "+i.pop():o(u))}return s();function s(){return i.pop().replace(/^\((.+)\)$/,"$1")}},a=(e,r)=>{if(0 in e){r=t(r);var n=e[0],o=n<0;o&&(n=-n-1);for(var i=0,u=1,s=!0;;u++,i++){var l,f,d=u<e.length?(typeof e[u])[0]:"";if(i>=r.length||"o"==(f=(typeof(l=r[i]))[0]))return!s||("u"==d?u>n&&!o:""==d!=o);if("u"==f){if(!s||"u"!=d)return!1}else if(s)if(d==f)if(u<=n){if(l!=e[u])return!1}else{if(o?l>e[u]:l<e[u])return!1;l!=e[u]&&(s=!1)}else if("s"!=d&&"n"!=d){if(o||u<=n)return!1;s=!1,u--}else{if(u<=n||f<d!=o)return!1;s=!1}else"s"!=d&&"n"!=d&&(s=!1,u--)}}var c=[],p=c.pop.bind(c);for(i=1;i<e.length;i++){var h=e[i];c.push(1==h?p()|p():2==h?p()&p():h?a(h,r):!p())}return!!p()},i=(e,r)=>e&&_.o(e,r),u=e=>(e.loaded=1,e.get()),s=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),l=(e,r,t)=>{var o=t?s(e[r]):e[r];return(r=Object.keys(o).reduce(((e,r)=>!e||n(e,r)?r:e),0))&&o[r]},f=(e,r,t,o)=>{var i=o?s(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!a(t,r)||e&&!n(e,r)?e:r),0))&&i[r]},d=(e,r,t,n,a)=>{var i=e[t];return"No satisfying version ("+o(n)+")"+(a?" for eager consumption":"")+" of shared module "+t+" found in shared scope "+r+".\nAvailable versions: "+Object.keys(i).map((e=>e+" from "+i[e].from)).join(", ")},c=e=>{throw new Error(e)},h=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(p=e=>function(r,t,n,o,a){var i=_.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,_.S[r],t,!1,o,a)):e(r,_.S[r],t,n,o,a)})(((e,r,t,n,o)=>i(r,t)?u(l(r,t,n)):h(e,t,o))),g=p(((e,r,t,n,o,a)=>{if(!i(r,t))return h(e,t,a);var s=f(r,t,o,n);return s?u(s):a?a():void c(d(r,e,t,o,n))})),b={},m={21490:()=>g("default","react",!1,[,[1,17,0,0],[1,16,8,0],1],(()=>_.e(540).then((()=>()=>_(96540))))),42417:()=>g("default","react",!1,[0,16,8,0],(()=>_.e(540).then((()=>()=>_(96540))))),44167:()=>v("default","react",!1,(()=>_.e(540).then((()=>()=>_(96540))))),57920:()=>g("default","react",!1,[,[0,17],[1,16,14,0],1],(()=>_.e(540).then((()=>()=>_(96540))))),61104:()=>g("default","react",!1,[,[1,16,0,0,,0],[1,15,0,0],[2,0,14,0],1,1],(()=>_.e(540).then((()=>()=>_(96540))))),62085:()=>g("default","react",!1,[1,16,14,0],(()=>_.e(540).then((()=>()=>_(96540))))),86528:()=>g("default","react",!1,[1,16,13,1],(()=>_.e(540).then((()=>()=>_(96540))))),87227:()=>g("default","react",!1,[0,16,6,0],(()=>_.e(540).then((()=>()=>_(96540))))),96932:()=>g("default","react",!1,[0,15,0,0],(()=>_.e(540).then((()=>()=>_(96540))))),98271:()=>g("default","react",!1,[0,0,14,0],(()=>_.e(540).then((()=>()=>_(96540)))))},y={847:[21490,42417,44167,57920,61104,62085,86528,87227,96932,98271]},w={},_.f.consumes=(e,r)=>{_.o(y,e)&&y[e].forEach((e=>{if(_.o(b,e))return r.push(b[e]);if(!w[e]){var t=r=>{b[e]=0,_.m[e]=t=>{delete _.c[e],t.exports=r()}};w[e]=!0;var n=r=>{delete b[e],_.m[e]=t=>{throw delete _.c[e],r}};try{var o=m[e]();o.then?r.push(b[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}}))},(()=>{var e={592:0};_.f.j=(r,t)=>{var n=_.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=_.p+_.u(r),i=new Error;_.l(a,(t=>{if(_.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,i,u]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in i)_.o(i,n)&&(_.m[n]=i[n]);u&&u(_)}for(r&&r(t);s<a.length;s++)o=a[s],_.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=self.webpackChunkbt_sensors_plugin_sk=self.webpackChunkbt_sensors_plugin_sk||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var j=_(43237);bt_sensors_plugin_sk=j})();
|
|
@@ -33,11 +33,8 @@ const testData=[
|
|
|
33
33
|
"30 35 37 44 00 00 00 00 00 00 00 00"
|
|
34
34
|
]
|
|
35
35
|
]
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
buffer = Buffer.from([])
|
|
39
|
-
|
|
40
|
-
delimitedAt(data){
|
|
36
|
+
|
|
37
|
+
function delimitedAt(data){
|
|
41
38
|
const delimiters = [0x5e,0xaf]
|
|
42
39
|
for (const d of delimiters){
|
|
43
40
|
if (data.includes(d)) return data.indexOf(d)
|
|
@@ -45,9 +42,15 @@ class EctiveDataManager extends EventEmitter{
|
|
|
45
42
|
return -1
|
|
46
43
|
}
|
|
47
44
|
|
|
45
|
+
class EctiveDataManager extends EventEmitter{
|
|
46
|
+
static expectedLength = 120
|
|
47
|
+
buffer = Buffer.from([])
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
48
51
|
add(buff) {
|
|
49
52
|
|
|
50
|
-
const delimiterIndex =
|
|
53
|
+
const delimiterIndex = delimitedAt(buff)
|
|
51
54
|
if (delimiterIndex == 0)
|
|
52
55
|
this.buffer= buff.subarray(1)
|
|
53
56
|
else {
|
|
@@ -153,9 +153,9 @@ class JunctekBMS extends BTSensor{
|
|
|
153
153
|
}
|
|
154
154
|
async initGATTConnection(isReconnecting){
|
|
155
155
|
super.initGATTConnection(isReconnecting)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
const gattServer = await this.getGATTServer()
|
|
157
|
+
const battService = await gattServer.getPrimaryService("0000fff0-0000-1000-8000-00805f9b34fb")
|
|
158
|
+
this.battCharacteristic = await battService.getCharacteristic("0000fff1-0000-1000-8000-00805f9b34fb")
|
|
159
159
|
|
|
160
160
|
}
|
|
161
161
|
|
|
@@ -198,7 +198,7 @@ class KilovaultHLXPlus extends BTSensor{
|
|
|
198
198
|
await super.initGATTConnection(isReconnecting)
|
|
199
199
|
const gattServer= this.getGATTServer()
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
const battService = await gattServer.getPrimaryService("0000ffe0-0000-1000-8000-00805f9b34fb")
|
|
202
202
|
this.battCharacteristic = await battService.getCharacteristic("0000ffe4-0000-1000-8000-00805f9b34fb")
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -82,17 +82,17 @@ class MercurySmartcraft extends BTSensor{
|
|
|
82
82
|
await super.initGATTConnection(isReconnecting)
|
|
83
83
|
|
|
84
84
|
const gattServer = await this.getGATTServer()
|
|
85
|
-
|
|
86
|
-
this.sdpCharacteristic = await
|
|
87
|
-
|
|
85
|
+
const sdpService = await gattServer.getPrimaryService("00000000-0000-1000-8000-ec55f9f5b963")
|
|
86
|
+
this.sdpCharacteristic = await sdpService.getCharacteristic("00000001-0000-1000-8000-ec55f9f5b963")
|
|
87
|
+
const dataService = await gattServer.getPrimaryService("00000100-0000-1000-8000-ec55f9f5b963")
|
|
88
88
|
this.dataCharacteristics = {
|
|
89
|
-
rpm: await
|
|
90
|
-
coolant: await
|
|
91
|
-
alternatorVoltage: await
|
|
92
|
-
runtime: await
|
|
93
|
-
rate: await
|
|
94
|
-
level: await
|
|
95
|
-
pressure: await
|
|
89
|
+
rpm: await dataService.getCharacteristic("00000102-0000-1000-8000-ec55f9f5b963"),
|
|
90
|
+
coolant: await dataService.getCharacteristic("00000103-0000-1000-8000-ec55f9f5b963"),
|
|
91
|
+
alternatorVoltage: await dataService.getCharacteristic("00000104-0000-1000-8000-ec55f9f5b963"),
|
|
92
|
+
runtime: await dataService.getCharacteristic("00000106-0000-1000-8000-ec55f9f5b963"),
|
|
93
|
+
rate: await dataService.getCharacteristic("00000107-0000-1000-8000-ec55f9f5b963"),
|
|
94
|
+
level: await dataService.getCharacteristic("00000108-0000-1000-8000-ec55f9f5b963"),
|
|
95
|
+
pressure: await dataService.getCharacteristic("0000010a-0000-1000-8000-ec55f9f5b963")
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
}
|
|
@@ -90,7 +90,7 @@ class VictronBatteryMonitor extends VictronSensor{
|
|
|
90
90
|
}
|
|
91
91
|
} catch(e){
|
|
92
92
|
this.debug(`Unable to determine device AuxMode. ${e.message}`)
|
|
93
|
-
this.debug(e)
|
|
93
|
+
this._app.debug(e)
|
|
94
94
|
this.auxMode=VC.AuxMode.DISABLED
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -218,7 +218,7 @@ class VictronBatteryMonitor extends VictronSensor{
|
|
|
218
218
|
}
|
|
219
219
|
if (await this.device.isConnected()){
|
|
220
220
|
await this.device.disconnect()
|
|
221
|
-
this.debug(`Disconnected
|
|
221
|
+
this.debug(`Disconnected`)
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -7,7 +7,7 @@ import {useEffect, useState} from 'react'
|
|
|
7
7
|
import {Button, Grid, Snackbar } from '@material-ui/core';
|
|
8
8
|
import { makeStyles } from '@material-ui/core/styles';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { BluetoothConnected, SignalCellular1Bar, SignalCellular2Bar, SignalCellular3Bar, SignalCellular4Bar, SignalCellular0Bar, SignalCellularConnectedNoInternet0Bar } from '@material-ui/icons';
|
|
11
11
|
|
|
12
12
|
const log = (type) => console.log.bind(console, type);
|
|
13
13
|
|
|
@@ -350,6 +350,9 @@ function confirmDelete(mac){
|
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
function signalStrengthIcon(sensor){
|
|
353
|
+
if (sensor.info.connected)
|
|
354
|
+
return <BluetoothConnected/>
|
|
355
|
+
|
|
353
356
|
if (sensor.info.lastContactDelta ==null || sensor.info.lastContactDelta > sensor.config.discoveryTimeout)
|
|
354
357
|
return <SignalCellularConnectedNoInternet0Bar/>
|
|
355
358
|
|
|
File without changes
|