bt-sensors-plugin-sk 1.3.4-beta → 1.3.5-1

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.
@@ -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(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})();
1
+ var bt_sensors_plugin_sk;(()=>{"use strict";var e,r,t,n,a,o,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(834),t.e(143)]).then((()=>()=>t(62995)))},a=(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),o=(e,r)=>{if(t.S){var n="default",a=t.S[n];if(a&&a!==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:()=>a,init:()=>o})}},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,a,o)=>{if(e[t])e[t].push(n);else{var i,u;if(void 0!==a)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+a){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+a),i.src=t),e[t]=[n];var d=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var a=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),a&&a.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 a=r[t];if(a||(a=r[t]={}),!(n.indexOf(a)>=0)){if(n.push(a),e[t])return e[t];_.o(_.S,t)||(_.S[t]={});var o=_.S[t],i="bt-sensors-plugin-sk",u=[];return"default"===t&&((e,r,t,n)=>{var a=o[e]=o[e]||{},u=a[r];(!u||!u.loaded&&(1!=!u.eager?n:i>u.from))&&(a[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 a=e[n],o=(typeof a)[0];if(n>=r.length)return"u"==o;var i=r[n],u=(typeof i)[0];if(o!=u)return"o"==o&&"n"==u||"s"==u||"u"==o;if("o"!=o&&"u"!=o&&a!=i)return a<i;n++}},a=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,o=1;o<e.length;o++)n--,t+="u"==(typeof(u=e[o]))[0]?"-":(n>0?".":"")+(n=2,u);return t}var i=[];for(o=1;o<e.length;o++){var u=e[o];i.push(0===u?"not("+s()+")":1===u?"("+s()+" || "+s()+")":2===u?i.pop()+" "+i.pop():a(u))}return s();function s(){return i.pop().replace(/^\((.+)\)$/,"$1")}},o=(e,r)=>{if(0 in e){r=t(r);var n=e[0],a=n<0;a&&(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&&!a:""==d!=a);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(a?l>e[u]:l<e[u])return!1;l!=e[u]&&(s=!1)}else if("s"!=d&&"n"!=d){if(a||u<=n)return!1;s=!1,u--}else{if(u<=n||f<d!=a)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?o(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 a=t?s(e[r]):e[r];return(r=Object.keys(a).reduce(((e,r)=>!e||n(e,r)?r:e),0))&&a[r]},f=(e,r,t,a)=>{var i=a?s(e[r]):e[r];return(r=Object.keys(i).reduce(((e,r)=>!o(t,r)||e&&!n(e,r)?e:r),0))&&i[r]},d=(e,r,t,n,o)=>{var i=e[t];return"No satisfying version ("+a(n)+")"+(o?" 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,a,o){var i=_.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,_.S[r],t,!1,a,o)):e(r,_.S[r],t,n,a,o)})(((e,r,t,n,a)=>i(r,t)?u(l(r,t,n)):h(e,t,a))),g=p(((e,r,t,n,a,o)=>{if(!i(r,t))return h(e,t,o);var s=f(r,t,a,n);return s?u(s):o?o():void c(d(r,e,t,a,n))})),b={},m={11097:()=>g("default","react",!1,[0,16],(()=>_.e(540).then((()=>()=>_(96540))))),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={143:[11097,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 a=m[e]();a.then?r.push(b[e]=a.then(t).catch(n)):t(a)}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 a=new Promise(((t,a)=>n=e[r]=[t,a]));t.push(n[2]=a);var o=_.p+_.u(r),i=new Error;_.l(o,(t=>{if(_.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var a=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+a+": "+o+")",i.name="ChunkLoadError",i.type=a,i.request=o,n[1](i)}}),"chunk-"+r,r)}};var r=(r,t)=>{var n,a,[o,i,u]=t,s=0;if(o.some((r=>0!==e[r]))){for(n in i)_.o(i,n)&&(_.m[n]=i[n]);u&&u(_)}for(r&&r(t);s<o.length;s++)a=o[s],_.o(e,a)&&e[a]&&e[a][0](),e[a]=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})();
@@ -20,6 +20,7 @@ class AranetSensor extends BTSensor{
20
20
  return null
21
21
  }
22
22
  static Domain = BTSensor.SensorDomains.environmental
23
+ static batteryStrengthTag="battery"
23
24
  initSchema(){
24
25
  super.initSchema()
25
26
  this.addDefaultParam("zone")
@@ -42,7 +42,7 @@ class Aranet2 extends AranetSensor{
42
42
  this.emitData("temp", buff)
43
43
  this.emitData("humidity", buff)
44
44
  this.emitData("pressure", buff)
45
- this.emitData("batteryStrength", buff)
45
+ this.emitData("battery", buff)
46
46
 
47
47
  }
48
48
  static ImageFile= "Aranet2.webp"
@@ -29,6 +29,7 @@ class AbstractBTHomeSensor extends BTSensor {
29
29
  * 273.15 degrees Kelvin correspond to 0 degrees Celsius.
30
30
  */
31
31
  static KELVIN_OFFSET = 273.15;
32
+ static batteryStrengthTag="battery"
32
33
 
33
34
  /**
34
35
  * BTHome Service identifier
@@ -11,14 +11,16 @@ function getDistances(distanceManager, mac, txPower, rssi ){
11
11
  }
12
12
  }
13
13
 
14
-
15
14
  class AbstractBeaconMixin {
16
-
15
+ static logSize = 5
17
16
  constructor(obj){
18
17
  this.elapsedTimeSinceLastContact=this.elapsedTimeSinceLastContact.bind(obj)
19
18
  this.initSchema=this.initSchema.bind(obj)
20
19
  this.initListen=this.initListen.bind(obj)
21
20
  this.propertiesChanged=this.propertiesChanged.bind(obj)
21
+ this.activate=this.activate.bind(obj)
22
+ this.stopListening=this.stopListening.bind(obj)
23
+ obj.GPSLog=[]
22
24
  }
23
25
 
24
26
  initListen() {
@@ -28,6 +30,8 @@ class AbstractBeaconMixin {
28
30
  }
29
31
  }
30
32
 
33
+
34
+
31
35
  initSchema() {
32
36
  this.addDefaultParam("id")
33
37
  .examples=["captain_keyring", "firstMate_keyring"]
@@ -60,6 +64,9 @@ class AbstractBeaconMixin {
60
64
  this.addMetadatum("onBoard","","boolean indicating crew member likely presence on board")
61
65
  .default="manifest.crew.{crewMember}.onBoard"
62
66
 
67
+ this.addMetadatum("GPSLog","","log of crew member's last known GPS coordinates")
68
+ .default="manifest.crew.{crewMember}.GPSLog"
69
+
63
70
  }
64
71
  elapsedTimeSinceLastContact(lc){
65
72
  if (Number.isNaN(lc) || lc > this.lastContactThreshhold){
@@ -72,12 +79,44 @@ class AbstractBeaconMixin {
72
79
  if(Object.hasOwn(props,"RSSI")){
73
80
  const mac = this.getMacAddress()
74
81
  const rssi = props.RSSI.value
82
+
75
83
  this.constructor.DistanceManagerSingleton.addSample(mac, rssi)
76
84
  const distances= getDistances(this.constructor.DistanceManagerSingleton, mac, this.getTxPower(), rssi)
77
85
  if (distances){
78
86
  this.emit("approxDistance", distances)
79
87
  this.emit("onBoard", distances.avgDistance<this?.presenceThreshhold??20)
80
88
  }
89
+ if (this._position){
90
+ this.GPSLog.unshift(
91
+ {
92
+ timestamp: new Date().toISOString(),
93
+ latitude: this._position.latitude,
94
+ longitude: this._position.longitude,
95
+ distances: distances
96
+ })
97
+ if (this.GPSLog.length>AbstractBeaconMixin.logSize){
98
+ this.GPSLog = this.GPSLog.slice(0,AbstractBeaconMixin.logSize)
99
+ }
100
+ this.emit("GPSLog", this.GPSLog)
101
+ }
102
+ }
103
+ }
104
+
105
+ async activate(config,paths){
106
+
107
+ this._positionSub = this._app.streambundle.getSelfStream('navigation.position')
108
+ .onValue(
109
+ (pos) => {
110
+ this._position=pos
111
+ }
112
+ );
113
+
114
+ }
115
+
116
+ async stopListening(){
117
+ if (this._positionSub){
118
+ this._positionSub()
119
+ this._positionSub = null
81
120
  }
82
121
  }
83
122
 
@@ -63,6 +63,17 @@ class FeasyComBeacon extends BTSensor {
63
63
  getTextDescription(){
64
64
  return `${this.getName()} iBeacon/Eddystone device`
65
65
  }
66
+
67
+ async activate(config,paths){
68
+ await super.activate(config,paths)
69
+ await this.beacon.activate(config,paths)
70
+ }
71
+
72
+ async stopListening(){
73
+
74
+ await super.stopListening()
75
+ this.beacon.stopListening()
76
+ }
66
77
  }
67
78
 
68
79
  module.exports = FeasyComBeacon;
@@ -19,6 +19,7 @@ class GoveeSensor extends BTSensor {
19
19
  }
20
20
 
21
21
  static DATA_ID=0xec88
22
+ static batteryStrengthTag="battery"
22
23
  getManufacturer(){
23
24
  return "Govee"
24
25
  }
@@ -2,6 +2,7 @@ const BTSensor = require("../BTSensor");
2
2
 
3
3
  class Inkbird extends BTSensor{
4
4
  static Domain = this.SensorDomains.environmental
5
+ static batteryStrengthTag="battery"
5
6
  static async identify(device){
6
7
 
7
8
  const uuids = await this.getDeviceProp(device,'UUIDs')
@@ -214,6 +214,20 @@ async getAndEmitBatteryInfo(){
214
214
  for (let i = 0; i<this.numberOfCells; i++){
215
215
  this.emit(`cell${i}Balance`,(1<<i & balances)?1:0)
216
216
  }
217
+
218
+ // cells 0-15 - read bits right to left
219
+ let balanceCells0to15 = buffer.readUInt16BE(16);
220
+ for (let i = 0; i < Math.min(16, this.numberOfCells); i++) {
221
+ const bit = (balanceCells0to15 >> i) & 1; // right-to-left
222
+ this.emit(`cell${i}Balance`,bit);
223
+ }
224
+
225
+ // cells 16-31 - read bits right to left
226
+ let balanceCells16to31 = buffer.readUInt16BE(18);
227
+ for (let i = 0; i < Math.min(16, this.numberOfCells - 16); i++) {
228
+ const bit = (balanceCells16to31 >> i) & 1; // right-to-left
229
+ this.emit(`cell${16 + i}Balance`,bit);
230
+ }
217
231
  })
218
232
  }
219
233
 
@@ -47,7 +47,7 @@ class JikongBMS extends BTSensor {
47
47
  ),
48
48
  ]),
49
49
  ]);
50
- const obj = new JikongBMS(device, { offset: 16, dischargeFloor: 0.1 });
50
+ const obj = new JikongBMS(device, { offset: 16, dischargeFloor: 0.1, numberOfCells:4 });
51
51
  obj.currentProperties = { Name: "Fake JKBMS", Address: "<mac>" };
52
52
  obj.debug = (m) => {
53
53
  console.log(m);
@@ -55,7 +55,8 @@ class JikongBMS extends BTSensor {
55
55
  obj.deviceConnect = () => {};
56
56
 
57
57
  await obj.initSchema();
58
- await obj.initGATTInterval();
58
+ await obj.initGATTConnection()
59
+ await obj.getAndEmitBatteryInfo();
59
60
  for (const [tag, path] of Object.entries(
60
61
  obj._schema.properties.paths.properties
61
62
  )) {
@@ -0,0 +1,83 @@
1
+ // support for Mikrotik TG-BT5-OUT Beacon/Sensor (in native Mikrotik mode)
2
+ // TG-BT5-OUT can also be configured to run in Eddystone or iBeacon mode)
3
+ // but this modules support the default Mikrotik mode
4
+ // to get a name, use the configuration APP to enable name advertisment on the sensors
5
+ const BTSensor = require("../BTSensor");
6
+
7
+ class MikrotikTag extends BTSensor{
8
+ static manufacturerID = 0x094F
9
+ static Domain = BTSensor.SensorDomains.environmental
10
+ static batteryStrengthTag="battery"
11
+ static ImageFile = "Mikrotik-TG-BT5-OUT.png"
12
+ static async identify(device){
13
+ if (await this.getManufacturerID(device)==this.manufacturerID)
14
+ return this
15
+ else
16
+ return null
17
+ }
18
+
19
+ initSchema(){
20
+ super.initSchema()
21
+ this.addDefaultParam("zone")
22
+
23
+ const md = this.valueIfVariant(this.getManufacturerData(this.constructor.manufacturerID))
24
+
25
+ if (md) {
26
+ this.mode = md[0]
27
+ if (this['_initModeV'+this.mode])
28
+ this['_initModeV'+this.mode]()
29
+ else
30
+ throw new Error("Unrecognized Mikrotik PDU version "+md[0])
31
+ }
32
+ }
33
+
34
+ // Protocol Docs https://help.mikrotik.com/docs/spaces/UM/pages/105742533/MikroTik+Tag+advertisement+formats
35
+ // "AdvData" field structure (max 31 octets/bytes):
36
+ // Of L Descr Value
37
+ // 00 1 Flags Length (02)
38
+ // 01 1 Flags Type (01)
39
+ // 02 1 Flags Data (06)
40
+ // 03 1 Length (15)
41
+ // 04 1 Type (FF)
42
+ // 05 2 CompanyID (4F09)
43
+ //{"type":"Buffer","data":[1,0,63,229,255,255,0,0,255,255,48,14,213,75,146,5,0,100]}
44
+ // 07 1 Version (01) -- currently only version 1 products ==> OFFSET 0 in ManufacturerData
45
+ // 08 1 UserData (xx) 00 => not encrypted, 01 => encrypted
46
+ // Secrect-Field is used for payload, multibyte values always in little endian
47
+ // 09 2 Salt (xxxx) used as checksum for payload, if the same in two message, data is unchanged
48
+ // 11 2 X-Accel (xxxx) m/s2 (*256)
49
+ // 13 2 Y-Accel (xxxx) m/s2 (*256)
50
+ // 15 2 Z-Accel (xxxx) m/s2 (*256)
51
+ // 17 2 Temperature (xxxx) C * 256
52
+ // 19 4 Uptime (xxxxxxxx) seconds
53
+ // 23 1 Flags (1:FLAG_REED_SWITCH,2:FLAG_ACCEL_TILT,3:FLAG_ACCEL_FREE_FALL,4:FLAG_IMPACT_X,5:FLAG_IMPACT_X,6:FLAG_IMPACT_Z,7:FLAG_ACCEL_DISABLED)
54
+ // 24 1 Battery (xx) Percentage
55
+
56
+ _initModeV1(){
57
+ this.addDefaultPath("temp","environment.temperature")
58
+ .read=(buffer)=>{ return parseFloat((273.15+buffer.readInt16LE(10)/256.0).toFixed(3))}
59
+
60
+ this.addMetadatum("accX","m/s2","acceleration on X-axis",
61
+ (buffer)=>{ return parseFloat((buffer.readInt16LE(4)/256.0).toFixed(3)) }
62
+ ).examples=["sensors.{macAndName}.accX"]
63
+
64
+ this.addMetadatum("accY","m/s2","acceleration on Y-axis",
65
+ (buffer)=>{ return parseFloat((buffer.readInt16LE(6)/256.0).toFixed(3)) }
66
+ ).examples=["sensors.{macAndName}.accY"]
67
+
68
+ this.addMetadatum("accZ","m/s2","acceleration on Z-axis",
69
+ (buffer)=>{ return parseFloat((buffer.readInt16LE(8)/256.0).toFixed(3)) }
70
+ ).examples=["sensors.{macAndName}.accZ"]
71
+
72
+ this.addDefaultPath("battery","sensors.batteryStrength")
73
+ .read=(buffer)=>{ return parseFloat((buffer[17]/100.0).toFixed(3)) }
74
+ }
75
+
76
+ propertiesChanged(props){
77
+ super.propertiesChanged(props)
78
+ if (props.ManufacturerData)
79
+ this.emitValuesFrom( this.getManufacturerData(this.constructor.manufacturerID) )
80
+ }
81
+
82
+ }
83
+ module.exports=MikrotikTag
@@ -10,6 +10,7 @@ class MopekaDevice{
10
10
  }
11
11
 
12
12
  const MopekaDevices = new Map()
13
+
13
14
  MopekaDevices.set()
14
15
  .set (0x0, new MopekaDevice("XXXX","Unknown Mopeka device"))
15
16
  .set (0x3, new MopekaDevice("M1017", "Pro Check"))
@@ -41,6 +42,7 @@ MopekaDevices.set()
41
42
  const BTSensor = require("../BTSensor");
42
43
  class MopekaTankSensor extends BTSensor{
43
44
  static Domain = BTSensor.SensorDomains.tanks
45
+ static batteryStrengthTag="battStrength"
44
46
 
45
47
  static serviceID = "0000fee5-0000-1000-8000-00805f9b34fb"
46
48
  static serviceID16 = 0xFEE5
@@ -12,6 +12,7 @@ class SwitchBotMeterPlus extends BTSensor{
12
12
  static ID = 0x0969
13
13
  static serviceDataKey = "0000fd3d-0000-1000-8000-00805f9b34fb"
14
14
  static modelID = 0x69
15
+ static batteryStrengthTag="battery"
15
16
 
16
17
  static async identify(device){
17
18
  const md = await this.getDeviceProp(device,'ManufacturerData')
@@ -3,7 +3,7 @@ const BTSensor = require("../BTSensor");
3
3
  class SwitchBotTH extends BTSensor {
4
4
  static Domain = BTSensor.SensorDomains.environmental
5
5
  static ImageFile = "SwitchBotTH.webp"
6
-
6
+ static batteryStrengthTag="battery"
7
7
  static async test(){
8
8
 
9
9
  const p = {[this.ID.toString()]: [0xd8, 0x35, 0x34, 0x38, 0x4f, 0x70, 0x07, 0x02, 0x04, 0x96, 0x2c, 0x00]}
@@ -73,6 +73,7 @@ const DEVICE_TYPES = new Map([
73
73
  class XiaomiMiBeacon extends BTSensor{
74
74
  static Domain = BTSensor.SensorDomains.environmental
75
75
  static ImageFile = "LYWSD03MMC-Device.jpg"
76
+
76
77
  constructor(device, config, gattConfig){
77
78
  super(device, config, gattConfig)
78
79
  this.encryptionKey = config?.encryptionKey
@@ -8,7 +8,7 @@ import {Button, Grid, Snackbar } from '@material-ui/core';
8
8
  import { makeStyles } from '@material-ui/core/styles';
9
9
 
10
10
  import { BluetoothConnected, SignalCellular1Bar, SignalCellular2Bar, SignalCellular3Bar, SignalCellular4Bar, SignalCellular0Bar, SignalCellularConnectedNoInternet0Bar } from '@material-ui/icons';
11
-
11
+ import BatteryGauge from 'react-battery-gauge';
12
12
  const log = (type) => console.log.bind(console, type);
13
13
 
14
14
  import ListGroup from 'react-bootstrap/ListGroup';
@@ -371,10 +371,46 @@ function signalStrengthIcon(sensor){
371
371
  return <SignalCellular0Bar/>
372
372
 
373
373
  }
374
+ function batteryIcon(sensor){
375
+ const batteryStrength = sensor.info.batteryStrength
376
+ if (batteryStrength===undefined)
377
+ return ""
378
+ else
379
+ return <BatteryGauge size={22} orientation='vertical' customization={{
380
+ batteryBody: {
381
+ fill: 'silver',
382
+ strokeColor: 'silver',
383
+ strokeWidth: 2,
384
+ },
385
+ batteryCap: {
386
+ fill: 'silver',
387
+ strokeColor: 'silver',
388
+ cornerRadius: 3,
389
+ strokeWidth: 0,
390
+ capToBodyRatio: 0.4,
391
+ },
392
+
393
+ readingText: {
394
+ lightContrastColor: 'purple',
395
+ darkContrastColor: 'yellow',
396
+ lowBatteryColor: 'red',
397
+ fontFamily: 'Arial',
398
+ fontSize: 16,
399
+ },
400
+ }}
401
+ value={batteryStrength*100}/>
402
+ }
374
403
  function hasConfig(sensor){
375
404
  return Object.keys(sensor.configCopy).length>0;
376
405
  }
377
406
 
407
+ function batteryStrength(sensor){
408
+ const bs = sensor.info?.batteryStrength
409
+ if (bs)
410
+ return `BATT: ${bs*100}%`
411
+ else
412
+ return ""
413
+ }
378
414
  function createListGroupItem(sensor){
379
415
 
380
416
  const config = hasConfig(sensor)
@@ -386,7 +422,8 @@ function createListGroupItem(sensor){
386
422
  }
387
423
  }>
388
424
  <div class="d-flex justify-content-between align-items-center" style={config?{fontWeight:"normal"}:{fontStyle:"italic"}}>
389
- {`${sensor._changesMade?"*":""}${sensor.info.name} MAC: ${sensor.info.mac} RSSI: ${ifNullNaN(sensor.info.RSSI)}` }
425
+ {`${sensor._changesMade?"*":""}${sensor.info.name} MAC: ${sensor.info.mac} RSSI: ${ifNullNaN(sensor.info.RSSI)} ${batteryStrength(sensor)}` }
426
+
390
427
  <div class="d-flex justify-content-between ">
391
428
  {
392
429
  `${sensor.info.state} ${sensor.info.error?" (ERROR)": "" }`
@@ -395,7 +432,11 @@ function createListGroupItem(sensor){
395
432
  {
396
433
  signalStrengthIcon(sensor)
397
434
  }
435
+ {
436
+ batteryIcon(sensor)
437
+ }
398
438
  </div>
439
+
399
440
  </div>
400
441
  </div>
401
442
  </ListGroupItem>
@@ -412,7 +453,7 @@ function devicesInDomain(domain){
412
453
  }
413
454
 
414
455
  function getTabs(){
415
- const sensorDomains = [... (new Set(sensorMap.entries().map((entry)=>{ return entry[1].info.domain})))].sort()
456
+ const sensorDomains = [... (new Set([...sensorMap.entries()].map((entry)=>{ return entry[1].info.domain})))].sort()
416
457
  const cd = Array.from(sensorMap.entries()).filter((entry)=>hasConfig(entry[1]))
417
458
  let sensorList={}
418
459
  sensorList["_configured"]=
package/public/847.js DELETED
@@ -1 +0,0 @@
1
- (self.webpackChunkbt_sensors_plugin_sk=self.webpackChunkbt_sensors_plugin_sk||[]).push([[847],{9337:()=>{},62995:(e,t,n)=>{"use strict";n.r(t),n.d(t,{BTConfig:()=>C,default:()=>D});var a=n(73490),s=n(74810),r=n(40334),o=n(86528),c=n.n(o),i=n(11363),l=n(97493),u=n(27606),m=n(82096),d=n(55877),g=n(3768),f=n(71431),h=n(39676),p=n(47041),E=n(86038),w=n(95027),y=n(43540),S=n(38250),b=n(31008),v=n(20455),A=n(23399);const k=e=>console.log.bind(console,e);function C(e){const t=(0,m.A)((e=>({root:{"& > *":{margin:e.spacing(1)}}}))),[n,C]=(0,o.useState)({}),[D,$]=(0,o.useState)({}),[_,x]=(0,o.useState)({}),[N,O]=(0,o.useState)({"ui:options":{label:!1},paths:{enableMarkdownInDescription:!0},title:{"ui:widget":"hidden"}}),[T,j]=(0,o.useState)(),[M,U]=(0,o.useState)(!1),[J,L]=(0,o.useState)(!0),[R,I]=(0,o.useState)(new Map),[P,K]=(0,o.useState)({progress:0,maxTimeout:100,deviceCount:0,totalDevices:0}),[B,G]=(0,o.useState)("unknown"),[W,F]=(0,o.useState)(),[H,z]=(0,o.useState)(!1),[Y,q]=(0,o.useState)(""),Q=t();function V(e,t){const n=new Headers;return n.append("Content-Type","application/json"),fetch(`/plugins/bt-sensors-plugin-sk/${e}`,{credentials:"include",method:"POST",body:JSON.stringify(t),headers:n})}async function X(e,t={}){let n;try{const a=Object.keys(t).length?"?"+new URLSearchParams(t).toString():"";n=await fetch(`/plugins/bt-sensors-plugin-sk/${e}${a}`,{credentials:"include",method:"GET"})}catch(e){n={status:500,statusText:e.toString()}}return n}function Z(e){return Object.keys(e.configCopy).length>0}function ee(e){const t=Z(e);return c().createElement(v.A,{action:!0,onClick:()=>{e.config.mac_address=e.info.mac,x(e.schema),j(e.config)}},c().createElement("div",{class:"d-flex justify-content-between align-items-center",style:t?{fontWeight:"normal"}:{fontStyle:"italic"}},`${e._changesMade?"*":""}${e.info.name} MAC: ${e.info.mac} RSSI: ${n=e.info.RSSI,null==n?NaN:n}`,c().createElement("div",{class:"d-flex justify-content-between "},`${e.info.state} ${e.info.error?" (ERROR)":""}`,c().createElement("div",{class:"d-flex justify-content-between "},function(e){return e.info.connected?c().createElement(d.A,null):null==e.info.lastContactDelta||e.info.lastContactDelta>e.config.discoveryTimeout?c().createElement(g.A,null):e.info.signalStrength>80?c().createElement(f.A,null):e.info.signalStrength>60?c().createElement(h.A,null):e.info.signalStrength>40?c().createElement(p.A,null):e.info.signalStrength>20?c().createElement(E.A,null):c().createElement(w.A,null)}(e)))));var n}function te(e){window.open(e,"_blank","noreferrer")}return(0,o.useEffect)((()=>{let e=null;return X("getPluginState").then((async t=>{if(404==t.status)throw G("unknown"),new Error("unable to get plugin state");const n=await t.json();e=new EventSource("/plugins/bt-sensors-plugin-sk/sse",{withCredentials:!0}),e.addEventListener("newsensor",(e=>{!function(e){let t=JSON.parse(e.data);console.log(`New sensor: ${t.info.mac}`),I((e=>(e.set(t.info.mac,t),new Map(e))))}(e)})),e.addEventListener("sensorchanged",(e=>{!function(e){console.log("sensorchanged");const t=JSON.parse(e.data);console.log(t),I((e=>{const n=e.get(t.mac);return n&&Object.assign(n.info,t),new Map(e)}))}(e)})),e.addEventListener("progress",(e=>{const t=JSON.parse(e.data);K(t)})),e.addEventListener("pluginstate",(e=>{const t=JSON.parse(e.data);G(t.state)})),G(n.state),(async()=>{const e=await async function(){const e=await X("getSensors");if(200!=e.status)throw new Error(`Unable get sensor data: ${e.statusText} (${e.status}) `);return await e.json()}();I(new Map(e.map((e=>[e.info.mac,e]))))})()})).catch((e=>{F(e.message)})),()=>{console.log("Closing connection to SSE"),e.close()}}),[]),(0,o.useEffect)((()=>{if(!M)return;if(!T||!R)return;const e=R.get(T.mac_address);e&&_&&T&&Object.hasOwn(T,"params")&&"UNKNOWN"==e.info.class&&T.params.sensorClass&&"UNKNOWN"!=T.params.sensorClass&&(L(!1),q(`Please wait. Fetching schema for ${T.params.sensorClass}...`),async function(e,t){const n=await X("getSensorInfo",{mac_address:e,class:t});if(200!=n.status)throw new Error(`Unable get sensor info: ${n.statusText} (${n.status}) `);return await n.json()}(T.mac_address,T.params.sensorClass).then((e=>{x(e.schema)})).catch((e=>{alert(e.message)})).finally((()=>{q(""),L(!0),U(!1)})))}),[M]),(0,o.useEffect)((()=>{z(""!=Y)}),[Y]),(0,o.useEffect)((()=>{"started"==B?(async function(){const e=await X("getBaseData");if(200!=e.status)throw new Error(`Unable to get base data: ${e.statusText} (${e.status}) `);const t=await e.json();return t.schema.htmlDescription=c().createElement("div",null,(0,r.Ay)(t.schema.htmlDescription),c().createElement("p",null)),t}().then((e=>{C(e.schema),$(e.data)})).catch((e=>{F(e.message)})),async function(){const e=await X("getProgress");if(200!=e.status)throw new Error(`Unable to get progress: ${e.statusText} (${e.status}) `);return await e.json()}().then((e=>{K(e)})).catch((e=>{F(e.message)}))):(C({}),$({}))}),[B]),"stopped"==B||"unknown"==B?c().createElement("h3",null,"Enable plugin to see configuration"):c().createElement("div",null,c().createElement(i.A,{anchorOrigin:{horizontal:"center",vertical:"bottom"},onClose:()=>z(!1),open:H,message:Y,key:"snackbar"}),c().createElement("div",{className:Q.root},c().createElement(l.A,{variant:"contained",onClick:()=>{te("https://github.com/naugehyde/bt-sensors-plugin-sk/tree/1.2.0-beta#configuration")}},"Documentation"),c().createElement(l.A,{variant:"contained",onClick:()=>{te("https://github.com/naugehyde/bt-sensors-plugin-sk/issues/new/choose")}},"Report Issue"),c().createElement(l.A,{variant:"contained",onClick:()=>{te("https://discord.com/channels/1170433917761892493/1295425963466952725")}},"Discord Thread"),c().createElement("p",null),c().createElement("p",null)),c().createElement("hr",{style:{width:"100%",height:"1px",color:"gray","background-color":"gray","text-align":"left","margin-left":0}}),W?c().createElement("h2",{style:{color:"red"}},W):"",c().createElement(a.Ay,{schema:n,validator:s.Ay,uiSchema:{"ui:field":"LayoutGridField","ui:layoutGrid":{"ui:row":[{"ui:row":{className:"row",children:[{"ui:columns":{className:"col-xs-4",children:["adapter","transport","duplicateData","discoveryTimeout","discoveryInterval"]}}]}}]}},onChange:e=>$(e.formData),onSubmit:({formData:e},t)=>{var n;n=e,I(new Map),V("updateBaseData",n).then((e=>{200!=e.status&&F(`Unable to update base data: ${e.statusText} (${e.status})`)})),x({})},onError:k("errors"),formData:D}),c().createElement("hr",{style:{width:"100%",height:"1px",color:"gray","background-color":"gray","text-align":"left","margin-left":0}}),c().createElement("p",null),c().createElement("p",null),P.deviceCount<P.totalDevices?c().createElement(A.A,{max:P.maxTimeout,now:P.progress}):"",c().createElement("p",null),c().createElement(S.A,{defaultActiveKey:"_configured",id:"domain-tabs",className:"mb-3"},function(){const e=[...new Set(R.entries().map((e=>e[1].info.domain)))].sort(),t=Array.from(R.entries()).filter((e=>Z(e[1])));let n={};return n._configured=0==t.length?"Select a device from its domain tab (Electrical etc.) and configure it.":t.map((e=>ee(R.get(e[0])))),e.forEach((e=>{var t;n[e]=(t=e,Array.from(R.entries()).filter((e=>e[1].info.domain===t))).map((e=>ee(R.get(e[0]))))})),Object.keys(n).map((e=>function(e,t){let n=e.slice("_"===e.charAt(0)?1:0);return c().createElement(b.A,{eventKey:e,title:`${n.charAt(0).toUpperCase()}${n.slice(1)}${"string"==typeof t?"":" ("+t.length+")"}`},c().createElement(y.A,{style:{maxHeight:"300px",overflowY:"auto"}},t))}(e,n[e])))}()),c().createElement("div",{style:{paddingLeft:10,paddingTop:10,display:0==Object.keys(_).length?"none":""}},c().createElement(u.A,{container:!0,direction:"column",style:{spacing:5}},c().createElement(u.A,{item:!0},c().createElement("h2",null,_?.title),c().createElement("p",null)),c().createElement(u.A,{item:!0},(0,r.Ay)(_?.htmlDescription))),c().createElement("fieldset",{disabled:!J},c().createElement(a.Ay,{schema:_,validator:s.Ay,uiSchema:N,onChange:(e,t)=>{const n=R.get(e.formData.mac_address);n&&(n._changesMade=!0,n.config=e.formData,j(e.formData)),"root_params_sensorClass"==t&&U(!0)},onSubmit:({formData:e},t)=>{var n;V("updateSensorData",n=e).then((e=>{if(200!=e.status)throw new Error(e.statusText);I((e=>(e.delete(n.mac_address),new Map(e)))),x({})})),alert("Changes saved")},onError:k("errors"),formData:T},c().createElement("div",{className:Q.root},c().createElement(l.A,{type:"submit",color:"primary",variant:"contained"},"Save"),c().createElement(l.A,{variant:"contained",onClick:()=>{var e;e=T.mac_address,R.get(e)._changesMade=!1,R.get(e).config=JSON.parse(JSON.stringify(R.get(e).configCopy)),j(R.get(e).config)}},"Undo"),c().createElement(l.A,{variant:"contained",color:"secondary",onClick:e=>function(e){const t=R.get(e);(!Z(t)||window.confirm(`Delete configuration for ${t.info.name}?`))&&function(e){try{V("removeSensorData",{mac_address:e}).then((e=>{if(200!=e.status)throw new Error(e.statusText)})),I((t=>(t.delete(e),new Map(t)))),x({})}catch{}}(e)}(T.mac_address)},"Delete"))))))}const D=C}}]);
@@ -1,36 +0,0 @@
1
- {
2
- "delay":100,
3
- "data":
4
- {
5
- "0x96": [
6
- "55 aa eb 90 01 de 58 02 00 00 f0 0a 00 00 54 0b 00 00 10 0e 00 00 de 0d 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f6 09 00 00 f0 49 02 00 1e 00 00 00 3c 00 00 00 40 0d 03 00 1e 00 00 00 3c 00 00 00 3c 00 00 00 d0 07 00 00 f4 01 00 00 c2 01 00 00 f4 01 00 00 c2 01 00 00 00 00 00 00 1e 00 00 00 84 03 00 00 20 03 00 00 04 00 00 00 01 00 00 00 01 00 00 00 01 00",
7
- "00 00 e0 93 04 00 dc 05 00 00 48 0d 00 00 00 00 00 00 00 00 00 00",
8
- "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00",
9
- "b0 71 0b 00 08 00 00 00 00 7c f8 ff ff 1f 0d 00 00 00 00 00 00 2a",
10
- "55 aa eb 90 02 de 02 0d 02 0d 02 0d 02 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00 00 00 02 0d 00 00 00 00 2e 00 31 00 34 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
11
- "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 cb 00 00 00 00 00",
12
- "06 34 00 00 e9 1d 00 00 c1 fd ff ff ac 00 ac 00 00 00 00 00 00 00 00 2a 5b f4 01 00 e0 93 04 00 40 00 00 00 bd 30 29 01 64 00 00 00 19 95 c1 03 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 00 01 00 00 00 bf 03 01 00 03 00 12 5b 3f 40 00 00 00 00 33 05 39 1b 00 01 00 01 00 05 00 00 c0 2c df 00 00 00 00 00 cb 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
13
- "00 00 00 00 00 00 00 00 00 fe ff 7f dc 0f 01 00 00 00 00 00 00 f1",
14
- "55 aa eb 90 02 de 02 0d 02 0d 02 0d 02 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00 00 00 02 0d 00 00 00 00 2e 00 31 00 34 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
15
- "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 cb 00 00 00 00 00",
16
- "06 34 00 00 e9 1d 00 00 c1 fd ff ff ac 00 ac 00 00 00 00 00 00 00 00 2a 5b f4 01 00 e0 93 04 00 40 00 00 00 bd 30 29 01 64 00 00 00 19 95 c1 03 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 00 01 00 00 00 bf 03 01 00 03 00 12 5b 3f 40 00 00 00 00 33 05 39 1b 00 01 00 01 00 05 00 00 c0 2c df 00 00 00 00 00 cb 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
17
- "00 00 00 00 00 00 00 00 00 fe ff 7f dc 0f 01 00 00 00 00 00 00 f1",
18
- "55 aa eb 90 01 de 58 02 00 00 f0 0a 00 00 54 0b 00 00 10 0e 00 00 de 0d 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f6 09 00 00 f0 49 02 00 1e 00 00 00 3c 00 00 00 40 0d 03 00 1e 00 00 00 3c 00 00 00 3c 00 00 00 d0 07 00 00 f4 01 00 00 c2 01 00 00 f4 01 00 00 c2 01 00 00 00 00 00 00 1e 00 00 00 84 03 00 00 20 03 00 00 04 00 00 00 01 00 00 00 01 00 00 00 01 00",
19
- "00 00 e0 93 04 00 dc 05 00 00 48 0d 00 00 00 00 00 00 00 00 00 00",
20
- "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00",
21
- "b0 71 0b 00 08 00 00 00 00 7c f8 ff ff 1f 0d 00 00 00 00 00 00 2a",
22
- "aa bb cc dd ee ff",
23
- "aa bb cc",
24
- "55 aa eb 90 02 de 02 0d 02 0d 02 0d 02 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00 00 00 02 0d 00 00 00 00 2e 00 31 00 34 00 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
25
- "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 cb 00 00 00 00 00",
26
- "06 34 00 00 e9 1d 00 00 c1 fd ff ff ac 00 ac 00 00 00 00 00 00 00 00 2a 5b f4 01 00 e0 93 04 00 40 00 00 00 bd 30 29 01 64 00 00 00 19 95 c1 03 01 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 00 01 00 00 00 bf 03 01 00 03 00 12 5b 3f 40 00 00 00 00 33 05 39 1b 00 01 00 01 00 05 00 00 c0 2c df 00 00 00 00 00 cb 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
27
- "00 00 00 00 00 00 00 00 00 fe ff 7f dc 0f 01 00 00 00 00 00 00 f1"
28
- ],
29
- "0x97":[
30
- "55 aa eb 90 03 c4 4a 4b 5f 42 32 41 38 53 32 30 50 00 00 00 00 00 31 31 2e 58 57 00 00 00 31 31 2e 32 36 31 00 00 68 96 c1 03 18 00 00 00 48 42 31 5f 42 34 00 00 00 00 00 00 00 00 00 00 31 32 33 34 00 00 00 00 00 00 00 00 00 00 00 00 32 33 30 38 31 34 00 00 33 30 32 32 38 34 34 32 36 37 00 30 30 30 30 00 49 6e 70 75 74 20 55 73 65 72 64 61 74 61 00 00 31 32 33 33 32 31 00 00 00 00",
31
- "00 00 00 00 00 00 49 6e 70 75 74 20 55 73 65 72 64 61 74 61 00 00",
32
- "7c f8 ff ff 1f 0d 00 00 00 00 00 00 90 0f 00 00 00 00 c0 d8 03 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00",
33
- "00 00 00 00 00 00 00 00 00 fe 2f 00 00 00 00 00 00 00 00 00 00 bf"
34
- ]
35
- }
36
- }