From f24710e443bafe66bf13eb667b60d59da62732eb Mon Sep 17 00:00:00 2001 From: jemu75 Date: Wed, 12 May 2021 23:01:39 +0200 Subject: [PATCH] v3.20.1 --- package.json | 2 +- src/plugins/fhem.js | 6 ++++-- www/fhemapp/index.html | 2 +- www/fhemapp/js/{app.51721ad2.js => app.a5ce73d0.js} | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) rename www/fhemapp/js/{app.51721ad2.js => app.a5ce73d0.js} (84%) diff --git a/package.json b/package.json index 3c4f5a14..e29c1f1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhemapp", - "version": "3.20.0", + "version": "3.20.1", "private": true, "author": "jemu75", "scripts": { diff --git a/src/plugins/fhem.js b/src/plugins/fhem.js index 2d86e89d..a8b5b3fb 100644 --- a/src/plugins/fhem.js +++ b/src/plugins/fhem.js @@ -731,6 +731,7 @@ class Fhem extends EventEmitter { if(data.devicePart === 'Attributes' && this.getEl(source, 'Attributes', data.param)) { source.Attributes[data.param] = data.value; } + this.handleTemplate(source); this.app.data.deviceList.splice(idx, 1, source); this.app.data.deviceList.sort((a,b) => (a.Options.sortby > b.Options.sortby) ? 1 : ((b.Options.sortby > a.Options.sortby) ? -1 : 0)); @@ -748,7 +749,8 @@ class Fhem extends EventEmitter { if(data.devicePart === 'Attributes' && this.getEl(source.Connected[alias], 'Attributes', data.param)) { source.Connected[alias].Attributes[data.param] = data.value; } - this.handleTemplate(source.Connected[alias]); + + this.handleTemplate(source); this.app.data.deviceList.splice(idx, 1, source); this.app.data.deviceList.sort((a,b) => (a.Options.sortby > b.Options.sortby) ? 1 : ((b.Options.sortby > a.Options.sortby) ? -1 : 0)); } @@ -795,7 +797,7 @@ class Fhem extends EventEmitter { let meta = { info: 'Connection (' + this.app.connection.type + ') ' + (evt ? 'failed.' : 'was closed.'), - errCode: evt.errCode || '' + errCode: evt || '' }; this.log({ lvl: 2, msg: 'Connection with FHEM was closed. Try to Reconnect in ' + (msecs / 1000) + ' seconds...', meta: meta }) diff --git a/www/fhemapp/index.html b/www/fhemapp/index.html index 898a8516..c4b7d177 100644 --- a/www/fhemapp/index.html +++ b/www/fhemapp/index.html @@ -1 +1 @@ -fhemapp
\ No newline at end of file +fhemapp
\ No newline at end of file diff --git a/www/fhemapp/js/app.51721ad2.js b/www/fhemapp/js/app.a5ce73d0.js similarity index 84% rename from www/fhemapp/js/app.51721ad2.js rename to www/fhemapp/js/app.a5ce73d0.js index 8c4ac55a..efc12dbd 100644 --- a/www/fhemapp/js/app.51721ad2.js +++ b/www/fhemapp/js/app.a5ce73d0.js @@ -1 +1 @@ -(function(e){function t(t){for(var a,s,o=t[0],c=t[1],p=t[2],l=0,u=[];l0?(this.type=this.types[this.msgList[0].lvl],this.message=this.msgList[0].msg,this.meta=this.msgList[0].meta,this.alert=!0):(this.alert=!1,this.type="info",this.message="",this.meta="")}},mounted:function(){var e=this;this.$fhem.on("message",(function(t){var n={lvl:5,msg:"no valid message received",meta:""};Object.assign(n,t),e.msgList.unshift(n)}))},methods:{clearMessage:function(){this.msgList.length>0&&this.msgList.splice(0,1)}}}),p=c,l=n("2877"),u=n("6544"),h=n.n(u),d=n("0798"),m=n("8336"),f=n("62ad"),v=n("132d"),g=n("0fd9"),b=Object(l["a"])(p,i,o,!1,null,null,null),k=b.exports;h()(b,{VAlert:d["a"],VBtn:m["a"],VCol:f["a"],VIcon:v["a"],VRow:g["a"]});var y={components:{Broadcaster:k},data:function(){return{appBar:{color:"",drawer:null,clock:null,header:null},app:{options:{loading:!1,reloadBtn:!1},session:{connect:!1},data:{roomList:[],groupList:[]}},version:"v"+n("9224").version,status:{color:"secondary",icon:"mdi-circle",text:"unbekannt",time:""}}},computed:{showRooms:function(){return this.app.data.roomList.length>0},showGroups:function(){return this.app.data.groupList.length>0}},watch:{"app.session.connect":function(e){this.status.color=e?"success":"error",this.status.text=e?"online":"offline",this.status.time=this.$fhem.getDateTime()}},mounted:function(){this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data,this.appBar=this.$fhem.app.appBar},methods:{reload:function(){location.reload(!0)},goTo:function(e){var t=e||"/";this.$router.currentRoute.path!=t&&this.$router.push(t)}}},O=y,x=(n("100d"),n("7496")),w=n("40dc"),j=n("5bc1"),C=n("cc20"),R=n("a523"),_=n("ce7e"),L=n("adda"),S=n("8860"),T=n("56b0"),E=n("da13"),I=n("5d23"),P=n("34c3"),V=n("f6c4"),B=n("f774"),D=n("a797"),A=n("490a"),N=n("2fa4"),F=n("3a2f"),M=Object(l["a"])(O,s,r,!1,null,"765e5cc9",null),H=M.exports;h()(M,{VApp:x["a"],VAppBar:w["a"],VAppBarNavIcon:j["a"],VBtn:m["a"],VChip:C["a"],VContainer:R["a"],VDivider:_["a"],VIcon:v["a"],VImg:L["a"],VList:S["a"],VListGroup:T["a"],VListItem:E["a"],VListItemContent:I["a"],VListItemIcon:P["a"],VListItemSubtitle:I["b"],VListItemTitle:I["c"],VMain:V["a"],VNavigationDrawer:B["a"],VOverlay:D["a"],VProgressCircular:A["a"],VSpacer:N["a"],VTooltip:F["a"]});n("d3b7"),n("3ca3"),n("ddb0");var $=n("8c4f");a["a"].use($["a"]);var U=[{path:"/",name:"Home",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/system",name:"System",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/dashboard",name:"Dashboard",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/devices/:filter",name:"Devices",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/edit-devices",name:"EditDevice",component:function(){return Promise.all([n.e("chunk-28c4def2"),n.e("chunk-12e7f05c"),n.e("chunk-97aef864"),n.e("chunk-2d22d812")]).then(n.bind(null,"f87a"))}},{path:"/syslog",name:"Syslog",component:function(){return Promise.all([n.e("chunk-28c4def2"),n.e("chunk-12e7f05c"),n.e("chunk-97aef864"),n.e("chunk-40496c8f")]).then(n.bind(null,"beee"))}}],J=new $["a"]({mode:"hash",base:"",routes:U}),q=J,z=n("f309"),G=n("0fe0"),X=n.n(G),K=n("fcf4");a["a"].use(z["a"]);var W={lang:{locales:{de:X.a},current:"de"},theme:{dark:!0,themes:{dark:{primary:K["a"].grey.darken4,secondary:K["a"].grey.darken3,success:K["a"].green.accent2,accent:K["a"].green.accent2},light:{primary:K["a"].grey,secondary:K["a"].grey.lighten3,success:K["a"].green.accent3,accent:K["a"].green.accent3}}}},Z=new z["a"](W),Q=n("1321"),Y=n.n(Q),ee=(n("159b"),n("ac1f"),n("466d"),n("a925"));function te(){var e=n("49f8"),t={};return e.keys().forEach((function(n){var a=n.match(/([A-Za-z0-9-_]+)\./i);if(a&&a.length>1){var s=a[1];t[s]=e(n)}})),t}a["a"].use(ee["a"]);var ne=new ee["a"]({locale:"de",fallbackLocale:"en",messages:te()}),ae=n("b85c"),se=n("2909"),re=n("1da1"),ie=n("53ca"),oe=n("d4ec"),ce=n("bee2"),pe=n("262e"),le=n("2caf"),ue=(n("96cf"),n("fb6a"),n("1276"),n("5319"),n("13d5"),n("b64b"),n("b0c0"),n("d81d"),n("a15b"),n("b680"),n("25f0"),n("99af"),n("4d63"),n("07ac"),n("faa1")),he=n.n(ue),de=function(e){Object(pe["a"])(n,e);var t=Object(le["a"])(n);function n(){var e;return Object(oe["a"])(this,n),e=t.call(this),e.app={connection:{location:window.location.protocol+"//"+window.location.hostname,port:window.location.port,path:"fhem",type:"websocket"},conn:null,connOffset:0,session:{connect:!1,ready:!1,csrf:null,restart:!1,restartCnt:0,logList:[]},options:{lang:"de",debugMode:!1,debugLevel:5,loading:!1,loadCount:0,clockInterval:5e3,clock:null,date:null,maxChartPoints:100,updateProcess:!1,logRecord:!0,logBuffer:500,ignoreFhemRoom:!1,ignoreFhemGroup:!1,ignoreFhemSortby:!1,mobileHeader:!1},theme:{dark:!0,themes:{}},appBar:{color:"primary",drawer:!1,clock:null,header:null},templates:[],componentMap:[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"weather",component:"templ_weather"},{name:"sysmon",component:"templ_sysmon"},{name:"hmlan",component:"templ_hmlan"},{name:"sonos",component:"templ_sonos"},{name:"scenes",component:"templ_scenes"},{name:"cam",component:"templ_cam"}],data:{roomList:[],groupList:[],deviceList:[],routeList:[],header:""},hasConnected:[]},e}return Object(ce["a"])(n,[{key:"loading",set:function(e){e&&this.app.options.loadCount++,!e&&this.app.options.loadCount>0&&this.app.options.loadCount--,this.app.options.loadCount>0&&!this.app.options.loading&&(this.app.options.loading=!0),0===this.app.options.loadCount&&(this.app.options.loading=!1)}},{key:"log",value:function(e){var t=["","mdi-alert-outline","mdi-connection","mdi-send-circle-outline","mdi-sync","mdi-hexagon-multiple-outline"],n=["","error","info","success","success","warning"],a=(new Date).toLocaleTimeString(this.app.options.lang),s=(new Date).getMilliseconds(),r={time:a+":"+("000"+s).slice(-3),msg:e.msg||"",lvl:e.lvl||5,meta:e.meta||null,icon:t[e.lvl||5],color:n[e.lvl||5]};this.app.options.logRecord&&r.lvl<=this.app.options.debugLevel&&(this.app.session.logList.unshift(r),this.app.session.logList.length>this.app.options.logBuffer&&(this.app.session.logList.length=this.app.options.logBuffer)),1==r.lvl&&(this.app.options.loadCount=0,this.app.options.loading=!1,this.emit("message",r))}},{key:"getDate",value:function(e){var t=e?parseInt(e):0;return function(e){return new Date(e.setDate(e.getDate()-t)).toISOString()}(new Date).split("T")[0]}},{key:"getDateTime",value:function(e){var t=e||(new Date).toISOString();return new Date(t.replace(" ","T")).toLocaleString(this.app.options.lang,{dateStyle:"short",timeStyle:"medium"}).replace(",","")}},{key:"createURL",value:function(e){var t=this.app.connection,n=t.location?t.location:"",a=t.port?":"+t.port.replace(":",""):"",s=t.path?"/"+t.path.replace("/",""):"",r="";return"object"==Object(ie["a"])(e)&&e.length>0&&e.forEach((function(e){e.param&&e.value&&(r+=r?"&":"?",r+=e.param+"="+encodeURIComponent(e.value))})),n+a+s+r}},{key:"getEl",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a0?s.push.apply(s,Object(se["a"])(t)):s.push(t)),"string"===typeof t&&s.push({param:"cmd",value:t}),r=this.createURL(s),this.log({lvl:3,msg:"Request: "+r}),e.next=9,fetch(r).then((function(e){var t=null;return"csrf"===n&&(t=e.headers.get("x-fhem-csrftoken")),"json"===n&&(t=e.json()),t||(t=e.text()),"object"===Object(ie["a"])(a)?Object.assign(a,{data:t}):t})).catch((function(e){return i.log({lvl:1,msg:"Request failed "+r,meta:e.message})}));case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)})));function t(t,n,a){return e.apply(this,arguments)}return t}()},{key:"getJsonFile",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s,r=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=new Headers,n.append("pragma","no-cache"),n.append("cache-control","no-cache"),a={method:"GET",headers:n},e.next=6,fetch(t,a).then((function(e){return e.json()})).catch((function(e){return r.log({lvl:1,msg:"Read Json-Data from "+t+" failed.",meta:e})}));case 6:return s=e.sent,s&&this.log({lvl:5,msg:"Json-Data parsed from "+t,meta:s}),e.next=10,s;case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"readConfig",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getJsonFile(t);case 2:if(n=e.sent,n){for(a=0,s=Object.keys(n);a0)){e.next=41;break}n=[],a=[],this.app.data.routeList.splice(0),s=Object(ae["a"])(t.Results),e.prev=8,s.s();case 10:if((r=s.n()).done){e.next=27;break}return i=r.value,e.next=14,this.createOptions(i);case 14:if(o=e.sent,!o.template){e.next=25;break}return e.next=18,this.getTemplate(o);case 18:c=e.sent,c&&this.app.templates.push(c),o.room&&this.createNaviItems(o,n,"room"),o.group&&this.createNaviItems(o,a,"group"),o.home&&this.createRoutes(o,"/"),o.dashboard&&this.createRoutes(o,"/dashboard"),o.system&&this.createRoutes(o,"/system");case 25:e.next=10;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e["catch"](8),s.e(e.t0);case 32:return e.prev=32,s.f(),e.finish(32);case 35:n.sort((function(e,t){return e.title>t.title?1:t.title>e.title?-1:0})),a.sort((function(e,t){return e.title>t.title?1:t.title>e.title?-1:0})),this.app.data.roomList=Object.assign([],n),this.app.data.groupList=Object.assign([],a),this.app.session.ready=!0,this.loading=!1;case 41:case"end":return e.stop()}}),e,this,[[8,29,32,35]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"createConnected",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s,r,i,o,c,p;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n={},a=this.app.hasConnected.indexOf(t.Name),-1!=a){e.next=30;break}if(this.app.hasConnected.push(t.Name),!("connected"in t.Options)){e.next=28;break}s=Object.keys(t.Options.connected),r=0,i=s;case 7:if(!(rt.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0})),this.app.data.deviceList=Object.assign([],r),this.loading=!1),i++;case 39:e.next=15;break;case 41:e.next=46;break;case 43:e.prev=43,e.t0=e["catch"](13),o.e(e.t0);case 46:return e.prev=46,o.f(),e.finish(46);case 49:case"end":return e.stop()}}),e,this,[[13,43,46,49]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"checkUpdate",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(){var t,n,a,s,r,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.request([{param:"cmd",value:"update check"},{param:"XHR",value:"1"}]);case 2:if(t=e.sent,n=0,t){a=t.split("\n").splice(2),s=Object(ae["a"])(a);try{for(s.s();!(r=s.n()).done;)i=r.value,i.match("UPD")&&!i.match("excluded")&&n++}catch(o){s.e(o)}finally{s.f()}}return e.abrupt("return",n>0);case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"handleLogData",value:function(e){var t=e.split("\n");t.length>3&&t.splice(-3,3);var n,a=[],s=t.length>this.app.options.maxChartPoints?parseInt(t.length/this.app.options.maxChartPoints):1,r=s,i=0,o=1,c=Object(ae["a"])(t);try{for(c.s();!(n=c.n()).done;){var p=n.value,l=p.split(" "),u=Date.parse(l[0].replace("_","T")),h=parseFloat(l[1]);i+=h,(o>=r||o===t.length)&&(o===t.length&&(s-=r-o),a.push({timestamp:u,value:i/s}),r+=s,i=0),o++}}catch(d){c.e(d)}finally{c.f()}return this.log({lvl:5,msg:"handle Chartdata (Lines: "+t.length+")"}),a}},{key:"readLogData",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s,r,i,o,c,p,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=[],this.loading=!0,!(t.defs&&t.defs.length>0)){e.next=40;break}a=0,s=Object(ae["a"])(t.defs),e.prev=5,s.s();case 7:if((r=s.n()).done){e.next=32;break}return i=r.value,o=/\(.*\)/.exec(i),c=o?i.replace(o[0],"_").split(":"):i.split(":"),p="get ",p+=c[0]?c[0]:t.deviceName,p+=t.from?" - - "+t.from:"",p+=t.to?" "+t.to:"",p+=o?" "+o[0].replace(/\(|\)/g,""):" 4:"+c[1],e.next=18,this.request([{param:"cmd",value:p},{param:"XHR",value:"1"}],"text",{id:a});case 18:if(l=e.sent,!l){e.next=29;break}return e.t0=n,e.t1=l.id,e.t2=this,e.next=25,l.data;case 25:e.t3=e.sent,e.t4=e.t2.handleLogData.call(e.t2,e.t3),e.t5={id:e.t1,data:e.t4},e.t0.push.call(e.t0,e.t5);case 29:a++;case 30:e.next=7;break;case 32:e.next=37;break;case 34:e.prev=34,e.t6=e["catch"](5),s.e(e.t6);case 37:return e.prev=37,s.f(),e.finish(37);case 40:return this.loading=!1,e.abrupt("return",Object.assign(t,{data:n}));case 42:case"end":return e.stop()}}),e,this,[[5,34,37,40]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"replaceVals",value:function(e,t){for(var n=/-?[0-9]/.exec(t),a=[],s=2;s0){var a,s=Object(ae["a"])(t);try{for(s.s();!(a=s.n()).done;){var r=a.value,i=r.split(":");if(i.length>2){var o=/\./.test(i[0])?i[0].split("."):["Readings",i[0],"Value"],c=this.getEl.apply(this,[e].concat(Object(se["a"])(o)))||this.getEl(e,"Readings",i[0],"Value");if(c){var p=!1,l=parseFloat(i[1]);if(isNaN(l))RegExp(i[1]?i[1]:".").test(c)&&(p=!0);else{var u=/-?[0-9]/.exec(c);-1!=u.index&&parseFloat(c.slice(u.index))>=l&&(p=!0)}if(p){n=this.replaceVals(i,c);break}}}}}catch(h){s.e(h)}finally{s.f()}}return n}},{key:"handleTemplate",value:function(e){var t=this.getEl(e,"Options","setup","show"),n=this.getEl(e,"Options","setup","status","bar"),a=this.getEl(e,"Options","setup","status","error"),s=this.getEl(e,"Options","setup","info");if(t){var r=this.handleVals(e,t);e.Options.show="false"!==r[0],r[1]&&(e.Options.setup.size=r[1]),r[2]&&(e.Options.sortby=r[2])}if(n){var i=this.getEl(e,"Options","setup","status","min")||0,o=this.getEl(e,"Options","setup","status","max")||100,c=this.handleVals(e,n),p=100/(o-i),l=(c[0]||"0"-i)*p;e.Options.status.level=c[2]?100-l:l,e.Options.status.color=c[1]||"success"}if(a){var u=this.handleVals(e,a);u.length>0?(e.Options.status.level=u[0]||"100",e.Options.status.color=u[1]||"error",e.Options.status.error=u[2]||"Fehler",e.Options.status.isActive=!1):e.Options.status.isActive=!0}if(s){var h=this.handleVals(e,s.left1),d=this.handleVals(e,s.left2),m=this.handleVals(e,s.mid1),f=this.handleVals(e,s.mid2),v=this.handleVals(e,s.right1),g=this.handleVals(e,s.right2);e.Options.info.left1IconColor=h[2]||"",e.Options.info.left1Icon=h[1]||"",e.Options.info.left1Text=h[0]||"",e.Options.info.left2IconColor=d[2]||"",e.Options.info.left2Icon=d[1]||"",e.Options.info.left2Text=d[0]||"",e.Options.info.mid1IconColor=m[2]||"",e.Options.info.mid1Icon=m[1]||"",e.Options.info.mid1Text=m[0]||"",e.Options.info.mid2IconColor=f[2]||"",e.Options.info.mid2Icon=f[1]||"",e.Options.info.mid2Text=f[0]||"",e.Options.info.right1IconColor=v[2]||"",e.Options.info.right1Icon=v[1]||"",e.Options.info.right1Text=v[0]||"",e.Options.info.right2IconColor=v[2]||"",e.Options.info.right2Icon=g[1]||"",e.Options.info.right2Text=g[0]||""}}},{key:"handleData",value:function(e){var t=JSON.parse(e),n=null;if(!t[2].match("0){var i=this.handleData(r);if(i){var o,c=0,p=Object(ae["a"])(this.app.data.deviceList);try{for(p.s();!(o=p.n()).done;){var l=o.value,u=this.app.data.deviceList[c],h=Object.assign({},u);if(l.Name===i.Name&&("Readings"===i.devicePart&&this.getEl(h,"Readings",i.param,i.paramPart)&&(h.Readings[i.param][i.paramPart]=i.value),"Attributes"===i.devicePart&&this.getEl(h,"Attributes",i.param)&&(h.Attributes[i.param]=i.value),this.handleTemplate(h),this.app.data.deviceList.splice(c,1,h),this.app.data.deviceList.sort((function(e,t){return e.Options.sortby>t.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0}))),"Connected"in l)for(var d=0,m=0,f=Object.values(l.Connected);mt.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0}))}d++}c++}}catch(b){p.e(b)}finally{p.f()}}}}}catch(b){s.e(b)}finally{s.f()}}},{key:"connOpen",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.app.session.connect=!0,this.app.session.restartCnt=0,this.log({lvl:2,msg:"Connection with FHEM is opened.",meta:this.app.connection}),e.next=5,this.request({},"csrf");case 5:this.app.session.csrf=e.sent,this.log({lvl:2,msg:"Crsf-Token received.",meta:{token:this.app.session.csrf}}),this.loadStructure();case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"connClose",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.ready=!1,this.app.conn=null,this.app.session.restart||(n=0==this.app.session.restartCnt?1:3e3,this.app.session.restart=!0,setTimeout((function(){s.app.session.restart=!1,s.app.session.restartCnt++,s.connStart()}),n),a={info:"Connection ("+this.app.connection.type+") "+(t?"failed.":"was closed."),errCode:t.errCode||""},this.log({lvl:2,msg:"Connection with FHEM was closed. Try to Reconnect in "+n/1e3+" seconds...",meta:a}),this.loading=!1);case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"connStart",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(){var t,n,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],n=this.createURL(t),"websocket"===this.app.connection.type?(this.app.conn=new WebSocket(n.replace(/^http/i,"ws")),this.app.conn.onopen=function(){return a.connOpen()},this.app.conn.onmessage=function(e){return a.doUpdate(e)},this.app.conn.onclose=function(){return a.connClose()},this.app.conn.onerror=function(e){return a.connClose(e)}):(this.app.conn=new XMLHttpRequest,this.app.conn.open("GET",n,!0),this.app.conn.onreadystatechange=function(){200===a.app.conn.status&&2===a.app.conn.readyState&&a.connOpen(),200===a.app.conn.status&&3===a.app.conn.readyState&&a.doUpdate()},this.app.conn.onerror=function(e){return a.connClose(e)},this.app.conn.send());case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"setClock",value:function(){var e=new Date;this.app.appBar.clock=e.toLocaleString(this.app.options.lang,{hour:"2-digit",minute:"2-digit"}),this.app.options.mobileHeader||(this.app.appBar.header=e.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}},{key:"init",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t,n){var a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.log({lvl:2,msg:"Starting FHEMApp..."}),this.loading=!0,e.next=4,this.readConfig("./cfg/config.json");case 4:this.connStart(),t&&this.app.theme&&(-1!=this.app.theme.dark&&Object.assign(t.framework.theme,{dark:this.app.theme.dark}),this.app.theme.themes.light&&Object.assign(t.framework.theme.themes.light,this.app.theme.themes.light),this.app.theme.themes.dark&&Object.assign(t.framework.theme.themes.dark,this.app.theme.themes.dark)),n&&this.app.options.lang&&(n.locale=this.app.options.lang),this.setClock(),setInterval((function(){return a.setClock()}),this.app.options.clockInterval);case 9:case"end":return e.stop()}}),e,this)})));function t(t,n){return e.apply(this,arguments)}return t}()}]),n}(he.a),me={install:function(e,t,n){e.prototype.$fhem=new de,e.prototype.$fhem.init(t,n)}};a["a"].use(me,Z,ne),a["a"].use(Y.a),a["a"].component("apexchart",Y.a),a["a"].config.productionTip=!1,new a["a"]({vuetify:Z,router:q,i18n:ne,render:function(e){return e(H)}}).$mount("#app")},"6ce2":function(e){e.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Gruppen","room":"Bereiche","dashboard":"Dashboard","system":"System"},"dates":{"from":"von","to":"bis"}},"templates":{"sysmon":{"updateBtn":["prüfe Updates...","system aktuell","update","update läuft.."],"restartBtn":"neustart","updateDialog":{"header":"FHEM Update","text":"Update wurde erfolgreich beendet. FHEM sollte neu gestartet werden.","restartBtn":"jetzt neustarten"}}}}')},9224:function(e){e.exports=JSON.parse('{"name":"fhemapp","version":"3.20.0","private":true,"author":"jemu75","scripts":{"serve":"vue-cli-service serve","build":"vue-cli-service build","lint":"vue-cli-service lint","i18n:report":"vue-cli-service i18n:report --src \\"./src/**/*.?(js|vue)\\" --locales \\"./src/locales/**/*.json\\""},"dependencies":{"apexcharts":"^3.26.1","core-js":"^3.12.0","typeface-roboto":"^1.1.13","vue":"^2.6.11","vue-apexcharts":"^1.6.1","vue-i18n":"^8.24.4","vue-json-pretty":"^1.8.0","vue-router":"^3.5.1","vuetify":"^2.4.11"},"devDependencies":{"@mdi/font":"^5.9.55","@vue/cli-plugin-babel":"^4.5.13","@vue/cli-plugin-eslint":"^4.5.13","@vue/cli-plugin-router":"^4.5.13","@vue/cli-service":"^4.5.13","babel-eslint":"^10.1.0","eslint":"^6.7.2","eslint-plugin-vue":"^6.2.2","sass":"^1.32.12","sass-loader":"^8.0.0","vue-cli-plugin-i18n":"~2.1.0","vue-cli-plugin-vuetify":"~2.0.9","vue-template-compiler":"^2.6.11","vuetify-loader":"^1.7.2"},"bugs":{"url":"https://github.com/jemu75/fhemApp/issues"},"homepage":"https://github.com/jemu75/fhemApp#readme","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jemu75/fhemApp.git"}}')},c274:function(e,t,n){e.exports=n.p+"img/FHEM_Logo.2d0f7a38.png"},edd4:function(e){e.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Groups","room":"Area","dashboard":"Dashboard","system":"System"},"dates":{"from":"From","to":"To"}},"templates":{"sysmon":{"updateBtn":["check updates...","up to date","update","update running..."],"restartBtn":"restart","updateDialog":{"header":"FHEM Update","text":"Update was successful finished. FHEM should be restarted now.","restartBtn":"restart now"}}}}')}}); \ No newline at end of file +(function(e){function t(t){for(var a,s,o=t[0],c=t[1],p=t[2],l=0,u=[];l0?(this.type=this.types[this.msgList[0].lvl],this.message=this.msgList[0].msg,this.meta=this.msgList[0].meta,this.alert=!0):(this.alert=!1,this.type="info",this.message="",this.meta="")}},mounted:function(){var e=this;this.$fhem.on("message",(function(t){var n={lvl:5,msg:"no valid message received",meta:""};Object.assign(n,t),e.msgList.unshift(n)}))},methods:{clearMessage:function(){this.msgList.length>0&&this.msgList.splice(0,1)}}}),p=c,l=n("2877"),u=n("6544"),h=n.n(u),d=n("0798"),m=n("8336"),f=n("62ad"),v=n("132d"),g=n("0fd9"),b=Object(l["a"])(p,i,o,!1,null,null,null),k=b.exports;h()(b,{VAlert:d["a"],VBtn:m["a"],VCol:f["a"],VIcon:v["a"],VRow:g["a"]});var y={components:{Broadcaster:k},data:function(){return{appBar:{color:"",drawer:null,clock:null,header:null},app:{options:{loading:!1,reloadBtn:!1},session:{connect:!1},data:{roomList:[],groupList:[]}},version:"v"+n("9224").version,status:{color:"secondary",icon:"mdi-circle",text:"unbekannt",time:""}}},computed:{showRooms:function(){return this.app.data.roomList.length>0},showGroups:function(){return this.app.data.groupList.length>0}},watch:{"app.session.connect":function(e){this.status.color=e?"success":"error",this.status.text=e?"online":"offline",this.status.time=this.$fhem.getDateTime()}},mounted:function(){this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data,this.appBar=this.$fhem.app.appBar},methods:{reload:function(){location.reload(!0)},goTo:function(e){var t=e||"/";this.$router.currentRoute.path!=t&&this.$router.push(t)}}},O=y,x=(n("100d"),n("7496")),w=n("40dc"),j=n("5bc1"),C=n("cc20"),R=n("a523"),_=n("ce7e"),L=n("adda"),S=n("8860"),T=n("56b0"),E=n("da13"),I=n("5d23"),P=n("34c3"),V=n("f6c4"),B=n("f774"),D=n("a797"),A=n("490a"),N=n("2fa4"),F=n("3a2f"),M=Object(l["a"])(O,s,r,!1,null,"765e5cc9",null),H=M.exports;h()(M,{VApp:x["a"],VAppBar:w["a"],VAppBarNavIcon:j["a"],VBtn:m["a"],VChip:C["a"],VContainer:R["a"],VDivider:_["a"],VIcon:v["a"],VImg:L["a"],VList:S["a"],VListGroup:T["a"],VListItem:E["a"],VListItemContent:I["a"],VListItemIcon:P["a"],VListItemSubtitle:I["b"],VListItemTitle:I["c"],VMain:V["a"],VNavigationDrawer:B["a"],VOverlay:D["a"],VProgressCircular:A["a"],VSpacer:N["a"],VTooltip:F["a"]});n("d3b7"),n("3ca3"),n("ddb0");var $=n("8c4f");a["a"].use($["a"]);var U=[{path:"/",name:"Home",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/system",name:"System",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/dashboard",name:"Dashboard",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/devices/:filter",name:"Devices",component:function(){return n.e("chunk-2d212bf1").then(n.bind(null,"aa72"))}},{path:"/edit-devices",name:"EditDevice",component:function(){return Promise.all([n.e("chunk-28c4def2"),n.e("chunk-12e7f05c"),n.e("chunk-97aef864"),n.e("chunk-2d22d812")]).then(n.bind(null,"f87a"))}},{path:"/syslog",name:"Syslog",component:function(){return Promise.all([n.e("chunk-28c4def2"),n.e("chunk-12e7f05c"),n.e("chunk-97aef864"),n.e("chunk-40496c8f")]).then(n.bind(null,"beee"))}}],J=new $["a"]({mode:"hash",base:"",routes:U}),q=J,z=n("f309"),G=n("0fe0"),X=n.n(G),K=n("fcf4");a["a"].use(z["a"]);var W={lang:{locales:{de:X.a},current:"de"},theme:{dark:!0,themes:{dark:{primary:K["a"].grey.darken4,secondary:K["a"].grey.darken3,success:K["a"].green.accent2,accent:K["a"].green.accent2},light:{primary:K["a"].grey,secondary:K["a"].grey.lighten3,success:K["a"].green.accent3,accent:K["a"].green.accent3}}}},Z=new z["a"](W),Q=n("1321"),Y=n.n(Q),ee=(n("159b"),n("ac1f"),n("466d"),n("a925"));function te(){var e=n("49f8"),t={};return e.keys().forEach((function(n){var a=n.match(/([A-Za-z0-9-_]+)\./i);if(a&&a.length>1){var s=a[1];t[s]=e(n)}})),t}a["a"].use(ee["a"]);var ne=new ee["a"]({locale:"de",fallbackLocale:"en",messages:te()}),ae=n("b85c"),se=n("2909"),re=n("1da1"),ie=n("53ca"),oe=n("d4ec"),ce=n("bee2"),pe=n("262e"),le=n("2caf"),ue=(n("96cf"),n("fb6a"),n("1276"),n("5319"),n("13d5"),n("b64b"),n("b0c0"),n("d81d"),n("a15b"),n("b680"),n("25f0"),n("99af"),n("4d63"),n("07ac"),n("faa1")),he=n.n(ue),de=function(e){Object(pe["a"])(n,e);var t=Object(le["a"])(n);function n(){var e;return Object(oe["a"])(this,n),e=t.call(this),e.app={connection:{location:window.location.protocol+"//"+window.location.hostname,port:window.location.port,path:"fhem",type:"websocket"},conn:null,connOffset:0,session:{connect:!1,ready:!1,csrf:null,restart:!1,restartCnt:0,logList:[]},options:{lang:"de",debugMode:!1,debugLevel:5,loading:!1,loadCount:0,clockInterval:5e3,clock:null,date:null,maxChartPoints:100,updateProcess:!1,logRecord:!0,logBuffer:500,ignoreFhemRoom:!1,ignoreFhemGroup:!1,ignoreFhemSortby:!1,mobileHeader:!1},theme:{dark:!0,themes:{}},appBar:{color:"primary",drawer:!1,clock:null,header:null},templates:[],componentMap:[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"weather",component:"templ_weather"},{name:"sysmon",component:"templ_sysmon"},{name:"hmlan",component:"templ_hmlan"},{name:"sonos",component:"templ_sonos"},{name:"scenes",component:"templ_scenes"},{name:"cam",component:"templ_cam"}],data:{roomList:[],groupList:[],deviceList:[],routeList:[],header:""},hasConnected:[]},e}return Object(ce["a"])(n,[{key:"loading",set:function(e){e&&this.app.options.loadCount++,!e&&this.app.options.loadCount>0&&this.app.options.loadCount--,this.app.options.loadCount>0&&!this.app.options.loading&&(this.app.options.loading=!0),0===this.app.options.loadCount&&(this.app.options.loading=!1)}},{key:"log",value:function(e){var t=["","mdi-alert-outline","mdi-connection","mdi-send-circle-outline","mdi-sync","mdi-hexagon-multiple-outline"],n=["","error","info","success","success","warning"],a=(new Date).toLocaleTimeString(this.app.options.lang),s=(new Date).getMilliseconds(),r={time:a+":"+("000"+s).slice(-3),msg:e.msg||"",lvl:e.lvl||5,meta:e.meta||null,icon:t[e.lvl||5],color:n[e.lvl||5]};this.app.options.logRecord&&r.lvl<=this.app.options.debugLevel&&(this.app.session.logList.unshift(r),this.app.session.logList.length>this.app.options.logBuffer&&(this.app.session.logList.length=this.app.options.logBuffer)),1==r.lvl&&(this.app.options.loadCount=0,this.app.options.loading=!1,this.emit("message",r))}},{key:"getDate",value:function(e){var t=e?parseInt(e):0;return function(e){return new Date(e.setDate(e.getDate()-t)).toISOString()}(new Date).split("T")[0]}},{key:"getDateTime",value:function(e){var t=e||(new Date).toISOString();return new Date(t.replace(" ","T")).toLocaleString(this.app.options.lang,{dateStyle:"short",timeStyle:"medium"}).replace(",","")}},{key:"createURL",value:function(e){var t=this.app.connection,n=t.location?t.location:"",a=t.port?":"+t.port.replace(":",""):"",s=t.path?"/"+t.path.replace("/",""):"",r="";return"object"==Object(ie["a"])(e)&&e.length>0&&e.forEach((function(e){e.param&&e.value&&(r+=r?"&":"?",r+=e.param+"="+encodeURIComponent(e.value))})),n+a+s+r}},{key:"getEl",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a0?s.push.apply(s,Object(se["a"])(t)):s.push(t)),"string"===typeof t&&s.push({param:"cmd",value:t}),r=this.createURL(s),this.log({lvl:3,msg:"Request: "+r}),e.next=9,fetch(r).then((function(e){var t=null;return"csrf"===n&&(t=e.headers.get("x-fhem-csrftoken")),"json"===n&&(t=e.json()),t||(t=e.text()),"object"===Object(ie["a"])(a)?Object.assign(a,{data:t}):t})).catch((function(e){return i.log({lvl:1,msg:"Request failed "+r,meta:e.message})}));case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)})));function t(t,n,a){return e.apply(this,arguments)}return t}()},{key:"getJsonFile",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s,r=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=new Headers,n.append("pragma","no-cache"),n.append("cache-control","no-cache"),a={method:"GET",headers:n},e.next=6,fetch(t,a).then((function(e){return e.json()})).catch((function(e){return r.log({lvl:1,msg:"Read Json-Data from "+t+" failed.",meta:e})}));case 6:return s=e.sent,s&&this.log({lvl:5,msg:"Json-Data parsed from "+t,meta:s}),e.next=10,s;case 10:return e.abrupt("return",e.sent);case 11:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"readConfig",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getJsonFile(t);case 2:if(n=e.sent,n){for(a=0,s=Object.keys(n);a0)){e.next=41;break}n=[],a=[],this.app.data.routeList.splice(0),s=Object(ae["a"])(t.Results),e.prev=8,s.s();case 10:if((r=s.n()).done){e.next=27;break}return i=r.value,e.next=14,this.createOptions(i);case 14:if(o=e.sent,!o.template){e.next=25;break}return e.next=18,this.getTemplate(o);case 18:c=e.sent,c&&this.app.templates.push(c),o.room&&this.createNaviItems(o,n,"room"),o.group&&this.createNaviItems(o,a,"group"),o.home&&this.createRoutes(o,"/"),o.dashboard&&this.createRoutes(o,"/dashboard"),o.system&&this.createRoutes(o,"/system");case 25:e.next=10;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e["catch"](8),s.e(e.t0);case 32:return e.prev=32,s.f(),e.finish(32);case 35:n.sort((function(e,t){return e.title>t.title?1:t.title>e.title?-1:0})),a.sort((function(e,t){return e.title>t.title?1:t.title>e.title?-1:0})),this.app.data.roomList=Object.assign([],n),this.app.data.groupList=Object.assign([],a),this.app.session.ready=!0,this.loading=!1;case 41:case"end":return e.stop()}}),e,this,[[8,29,32,35]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"createConnected",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s,r,i,o,c,p;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n={},a=this.app.hasConnected.indexOf(t.Name),-1!=a){e.next=30;break}if(this.app.hasConnected.push(t.Name),!("connected"in t.Options)){e.next=28;break}s=Object.keys(t.Options.connected),r=0,i=s;case 7:if(!(rt.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0})),this.app.data.deviceList=Object.assign([],r),this.loading=!1),i++;case 39:e.next=15;break;case 41:e.next=46;break;case 43:e.prev=43,e.t0=e["catch"](13),o.e(e.t0);case 46:return e.prev=46,o.f(),e.finish(46);case 49:case"end":return e.stop()}}),e,this,[[13,43,46,49]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"checkUpdate",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(){var t,n,a,s,r,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.request([{param:"cmd",value:"update check"},{param:"XHR",value:"1"}]);case 2:if(t=e.sent,n=0,t){a=t.split("\n").splice(2),s=Object(ae["a"])(a);try{for(s.s();!(r=s.n()).done;)i=r.value,i.match("UPD")&&!i.match("excluded")&&n++}catch(o){s.e(o)}finally{s.f()}}return e.abrupt("return",n>0);case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"handleLogData",value:function(e){var t=e.split("\n");t.length>3&&t.splice(-3,3);var n,a=[],s=t.length>this.app.options.maxChartPoints?parseInt(t.length/this.app.options.maxChartPoints):1,r=s,i=0,o=1,c=Object(ae["a"])(t);try{for(c.s();!(n=c.n()).done;){var p=n.value,l=p.split(" "),u=Date.parse(l[0].replace("_","T")),h=parseFloat(l[1]);i+=h,(o>=r||o===t.length)&&(o===t.length&&(s-=r-o),a.push({timestamp:u,value:i/s}),r+=s,i=0),o++}}catch(d){c.e(d)}finally{c.f()}return this.log({lvl:5,msg:"handle Chartdata (Lines: "+t.length+")"}),a}},{key:"readLogData",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s,r,i,o,c,p,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n=[],this.loading=!0,!(t.defs&&t.defs.length>0)){e.next=40;break}a=0,s=Object(ae["a"])(t.defs),e.prev=5,s.s();case 7:if((r=s.n()).done){e.next=32;break}return i=r.value,o=/\(.*\)/.exec(i),c=o?i.replace(o[0],"_").split(":"):i.split(":"),p="get ",p+=c[0]?c[0]:t.deviceName,p+=t.from?" - - "+t.from:"",p+=t.to?" "+t.to:"",p+=o?" "+o[0].replace(/\(|\)/g,""):" 4:"+c[1],e.next=18,this.request([{param:"cmd",value:p},{param:"XHR",value:"1"}],"text",{id:a});case 18:if(l=e.sent,!l){e.next=29;break}return e.t0=n,e.t1=l.id,e.t2=this,e.next=25,l.data;case 25:e.t3=e.sent,e.t4=e.t2.handleLogData.call(e.t2,e.t3),e.t5={id:e.t1,data:e.t4},e.t0.push.call(e.t0,e.t5);case 29:a++;case 30:e.next=7;break;case 32:e.next=37;break;case 34:e.prev=34,e.t6=e["catch"](5),s.e(e.t6);case 37:return e.prev=37,s.f(),e.finish(37);case 40:return this.loading=!1,e.abrupt("return",Object.assign(t,{data:n}));case 42:case"end":return e.stop()}}),e,this,[[5,34,37,40]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"replaceVals",value:function(e,t){for(var n=/-?[0-9]/.exec(t),a=[],s=2;s0){var a,s=Object(ae["a"])(t);try{for(s.s();!(a=s.n()).done;){var r=a.value,i=r.split(":");if(i.length>2){var o=/\./.test(i[0])?i[0].split("."):["Readings",i[0],"Value"],c=this.getEl.apply(this,[e].concat(Object(se["a"])(o)))||this.getEl(e,"Readings",i[0],"Value");if(c){var p=!1,l=parseFloat(i[1]);if(isNaN(l))RegExp(i[1]?i[1]:".").test(c)&&(p=!0);else{var u=/-?[0-9]/.exec(c);-1!=u.index&&parseFloat(c.slice(u.index))>=l&&(p=!0)}if(p){n=this.replaceVals(i,c);break}}}}}catch(h){s.e(h)}finally{s.f()}}return n}},{key:"handleTemplate",value:function(e){var t=this.getEl(e,"Options","setup","show"),n=this.getEl(e,"Options","setup","status","bar"),a=this.getEl(e,"Options","setup","status","error"),s=this.getEl(e,"Options","setup","info");if(t){var r=this.handleVals(e,t);e.Options.show="false"!==r[0],r[1]&&(e.Options.setup.size=r[1]),r[2]&&(e.Options.sortby=r[2])}if(n){var i=this.getEl(e,"Options","setup","status","min")||0,o=this.getEl(e,"Options","setup","status","max")||100,c=this.handleVals(e,n),p=100/(o-i),l=(c[0]||"0"-i)*p;e.Options.status.level=c[2]?100-l:l,e.Options.status.color=c[1]||"success"}if(a){var u=this.handleVals(e,a);u.length>0?(e.Options.status.level=u[0]||"100",e.Options.status.color=u[1]||"error",e.Options.status.error=u[2]||"Fehler",e.Options.status.isActive=!1):e.Options.status.isActive=!0}if(s){var h=this.handleVals(e,s.left1),d=this.handleVals(e,s.left2),m=this.handleVals(e,s.mid1),f=this.handleVals(e,s.mid2),v=this.handleVals(e,s.right1),g=this.handleVals(e,s.right2);e.Options.info.left1IconColor=h[2]||"",e.Options.info.left1Icon=h[1]||"",e.Options.info.left1Text=h[0]||"",e.Options.info.left2IconColor=d[2]||"",e.Options.info.left2Icon=d[1]||"",e.Options.info.left2Text=d[0]||"",e.Options.info.mid1IconColor=m[2]||"",e.Options.info.mid1Icon=m[1]||"",e.Options.info.mid1Text=m[0]||"",e.Options.info.mid2IconColor=f[2]||"",e.Options.info.mid2Icon=f[1]||"",e.Options.info.mid2Text=f[0]||"",e.Options.info.right1IconColor=v[2]||"",e.Options.info.right1Icon=v[1]||"",e.Options.info.right1Text=v[0]||"",e.Options.info.right2IconColor=v[2]||"",e.Options.info.right2Icon=g[1]||"",e.Options.info.right2Text=g[0]||""}}},{key:"handleData",value:function(e){var t=JSON.parse(e),n=null;if(!t[2].match("0){var i=this.handleData(r);if(i){var o,c=0,p=Object(ae["a"])(this.app.data.deviceList);try{for(p.s();!(o=p.n()).done;){var l=o.value,u=this.app.data.deviceList[c],h=Object.assign({},u);if(l.Name===i.Name&&("Readings"===i.devicePart&&this.getEl(h,"Readings",i.param,i.paramPart)&&(h.Readings[i.param][i.paramPart]=i.value),"Attributes"===i.devicePart&&this.getEl(h,"Attributes",i.param)&&(h.Attributes[i.param]=i.value),this.handleTemplate(h),this.app.data.deviceList.splice(c,1,h),this.app.data.deviceList.sort((function(e,t){return e.Options.sortby>t.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0}))),"Connected"in l)for(var d=0,m=0,f=Object.values(l.Connected);mt.Options.sortby?1:t.Options.sortby>e.Options.sortby?-1:0}))}d++}c++}}catch(b){p.e(b)}finally{p.f()}}}}}catch(b){s.e(b)}finally{s.f()}}},{key:"connOpen",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.app.session.connect=!0,this.app.session.restartCnt=0,this.log({lvl:2,msg:"Connection with FHEM is opened.",meta:this.app.connection}),e.next=5,this.request({},"csrf");case 5:this.app.session.csrf=e.sent,this.log({lvl:2,msg:"Crsf-Token received.",meta:{token:this.app.session.csrf}}),this.loadStructure();case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"connClose",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t){var n,a,s=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.ready=!1,this.app.conn=null,this.app.session.restart||(n=0==this.app.session.restartCnt?1:3e3,this.app.session.restart=!0,setTimeout((function(){s.app.session.restart=!1,s.app.session.restartCnt++,s.connStart()}),n),a={info:"Connection ("+this.app.connection.type+") "+(t?"failed.":"was closed."),errCode:t||""},this.log({lvl:2,msg:"Connection with FHEM was closed. Try to Reconnect in "+n/1e3+" seconds...",meta:a}),this.loading=!1);case 5:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"connStart",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(){var t,n,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],n=this.createURL(t),"websocket"===this.app.connection.type?(this.app.conn=new WebSocket(n.replace(/^http/i,"ws")),this.app.conn.onopen=function(){return a.connOpen()},this.app.conn.onmessage=function(e){return a.doUpdate(e)},this.app.conn.onclose=function(){return a.connClose()},this.app.conn.onerror=function(e){return a.connClose(e)}):(this.app.conn=new XMLHttpRequest,this.app.conn.open("GET",n,!0),this.app.conn.onreadystatechange=function(){200===a.app.conn.status&&2===a.app.conn.readyState&&a.connOpen(),200===a.app.conn.status&&3===a.app.conn.readyState&&a.doUpdate()},this.app.conn.onerror=function(e){return a.connClose(e)},this.app.conn.send());case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"setClock",value:function(){var e=new Date;this.app.appBar.clock=e.toLocaleString(this.app.options.lang,{hour:"2-digit",minute:"2-digit"}),this.app.options.mobileHeader||(this.app.appBar.header=e.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}},{key:"init",value:function(){var e=Object(re["a"])(regeneratorRuntime.mark((function e(t,n){var a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.log({lvl:2,msg:"Starting FHEMApp..."}),this.loading=!0,e.next=4,this.readConfig("./cfg/config.json");case 4:this.connStart(),t&&this.app.theme&&(-1!=this.app.theme.dark&&Object.assign(t.framework.theme,{dark:this.app.theme.dark}),this.app.theme.themes.light&&Object.assign(t.framework.theme.themes.light,this.app.theme.themes.light),this.app.theme.themes.dark&&Object.assign(t.framework.theme.themes.dark,this.app.theme.themes.dark)),n&&this.app.options.lang&&(n.locale=this.app.options.lang),this.setClock(),setInterval((function(){return a.setClock()}),this.app.options.clockInterval);case 9:case"end":return e.stop()}}),e,this)})));function t(t,n){return e.apply(this,arguments)}return t}()}]),n}(he.a),me={install:function(e,t,n){e.prototype.$fhem=new de,e.prototype.$fhem.init(t,n)}};a["a"].use(me,Z,ne),a["a"].use(Y.a),a["a"].component("apexchart",Y.a),a["a"].config.productionTip=!1,new a["a"]({vuetify:Z,router:q,i18n:ne,render:function(e){return e(H)}}).$mount("#app")},"6ce2":function(e){e.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Gruppen","room":"Bereiche","dashboard":"Dashboard","system":"System"},"dates":{"from":"von","to":"bis"}},"templates":{"sysmon":{"updateBtn":["prüfe Updates...","system aktuell","update","update läuft.."],"restartBtn":"neustart","updateDialog":{"header":"FHEM Update","text":"Update wurde erfolgreich beendet. FHEM sollte neu gestartet werden.","restartBtn":"jetzt neustarten"}}}}')},9224:function(e){e.exports=JSON.parse('{"name":"fhemapp","version":"3.20.1","private":true,"author":"jemu75","scripts":{"serve":"vue-cli-service serve","build":"vue-cli-service build","lint":"vue-cli-service lint","i18n:report":"vue-cli-service i18n:report --src \\"./src/**/*.?(js|vue)\\" --locales \\"./src/locales/**/*.json\\""},"dependencies":{"apexcharts":"^3.26.1","core-js":"^3.12.0","typeface-roboto":"^1.1.13","vue":"^2.6.11","vue-apexcharts":"^1.6.1","vue-i18n":"^8.24.4","vue-json-pretty":"^1.8.0","vue-router":"^3.5.1","vuetify":"^2.4.11"},"devDependencies":{"@mdi/font":"^5.9.55","@vue/cli-plugin-babel":"^4.5.13","@vue/cli-plugin-eslint":"^4.5.13","@vue/cli-plugin-router":"^4.5.13","@vue/cli-service":"^4.5.13","babel-eslint":"^10.1.0","eslint":"^6.7.2","eslint-plugin-vue":"^6.2.2","sass":"^1.32.12","sass-loader":"^8.0.0","vue-cli-plugin-i18n":"~2.1.0","vue-cli-plugin-vuetify":"~2.0.9","vue-template-compiler":"^2.6.11","vuetify-loader":"^1.7.2"},"bugs":{"url":"https://github.com/jemu75/fhemApp/issues"},"homepage":"https://github.com/jemu75/fhemApp#readme","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jemu75/fhemApp.git"}}')},c274:function(e,t,n){e.exports=n.p+"img/FHEM_Logo.2d0f7a38.png"},edd4:function(e){e.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Groups","room":"Area","dashboard":"Dashboard","system":"System"},"dates":{"from":"From","to":"To"}},"templates":{"sysmon":{"updateBtn":["check updates...","up to date","update","update running..."],"restartBtn":"restart","updateDialog":{"header":"FHEM Update","text":"Update was successful finished. FHEM should be restarted now.","restartBtn":"restart now"}}}}')}}); \ No newline at end of file