diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fe3e47e..cb5e0b0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Versionsinformationen +## v.3.36.2 (21.01.2023) +**Bugfix** +- Standard-Template: bei Verwendung von Menu wird jetzt auch die Iconfarbe und Disabled berücksichtigt + ## v.3.36.1 (21.01.2023) **Bugfix** - Standard-Template: Icongröße für Menü korrigiert, wenn ein Slider verwendet wird diff --git a/README.md b/README.md index 2997b825..97eeadab 100755 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ In den Template-Dateien können folgende Eigenschaften definiert werden. Die Zuw }, "main": [ { - "leftBtn": ["reading:value:icon:disabled"], + "leftBtn": ["reading:value:icon:disabled:color"], "leftClick": ["reading:value:set_param"], "leftLong": ["reading:value:set_param"], "leftLongRelease": ["reading:value:set_param"], @@ -214,12 +214,12 @@ In den Template-Dateien können folgende Eigenschaften definiert werden. Die Zuw "text": ["reading:value:text:align"], "text2": ["reading:value:text:align"], "slider": ["reading:value:set_param:current:min:max:steps"], - "midBtn": ["reading:value:icon:disabled"], + "midBtn": ["reading:value:icon:disabled:color"], "midClick": ["reading:value:set_param"], "midLong": ["reading:value:set_param"], "midLongRelease": ["reading:value:set_param"], "midMenu": ["text:set_param"], - "rightBtn": ["reading:value:icon:disabled"], + "rightBtn": ["reading:value:icon:disabled:color"], "rightClick": ["reading:value:set_param"], "rightLong": ["reading:value:set_param"], "rightLongRelease": ["reading:value:set_param"], diff --git a/package.json b/package.json index bb4dd093..cdc500f7 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhemapp", - "version": "3.36.1", + "version": "3.36.2", "private": true, "author": "jemu75", "scripts": { diff --git a/public/cfg/config.json b/public/cfg/config.json index fb7f19d9..af99b8e6 100755 --- a/public/cfg/config.json +++ b/public/cfg/config.json @@ -1,4 +1,9 @@ -{ +{ + "connection": { + "location": "http://fhem", + "port": "8083", + "path": "fhem" + }, "options": { "maxChartPoints": 150, "logBuffer": 500 diff --git a/src/components/TemplDefault.vue b/src/components/TemplDefault.vue index 6bb9829d..0d2e27d8 100755 --- a/src/components/TemplDefault.vue +++ b/src/components/TemplDefault.vue @@ -101,6 +101,8 @@ @@ -214,6 +216,8 @@ v-if="!level.text" small icon + :disabled="level.midBtnDisabled" + :color="level.midBtnColor" v-bind="attrs" v-on="on" > @@ -321,6 +325,8 @@ diff --git a/www/fhemapp/css/609.7dde73af.css b/www/fhemapp/css/259.7dde73af.css similarity index 100% rename from www/fhemapp/css/609.7dde73af.css rename to www/fhemapp/css/259.7dde73af.css diff --git a/www/fhemapp/index.html b/www/fhemapp/index.html index 1eb323a6..cec40657 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/259.f397cfaa.js b/www/fhemapp/js/259.f397cfaa.js new file mode 100644 index 00000000..100edc61 --- /dev/null +++ b/www/fhemapp/js/259.f397cfaa.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[259],{8259:function(t,e,i){i.r(e),i.d(e,{default:function(){return B}});var s=i(7179),n=i(3385),l=i(5223),a=i(4437),o=i(4192),r=i(5057),h=i(248),c=i(1908),d=i(2321),u=i(2776),m=i(8228),f=i(92),p=i(1302),v=i(5294),g=i(2059),x=i(5234),_=i(9953),C=function(){var t=this,e=t._self._c;return t.item.Options.show?e(a.Z,{class:t.item.Options.setup.size},[e(n.Z,{attrs:{dark:this.$vuetify.theme.dark,color:"secondary"}},[e(p.Z,{attrs:{height:"7",value:t.item.Options.status.level,color:t.item.Options.status.color,"background-color":"secondary darken-1"}}),e(l.EB,{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.name)+" "),e(x.Z),t.lvlIcon&&t.item.Options.status.isActive?e(s.Z,{attrs:{small:"",icon:""},on:{click:function(e){return t.lvlBtn()}}},[e(r.Z,{attrs:{small:""}},[t._v(" "+t._s(t.lvlIcon)+" ")])],1):t._e(),t.app.options.debugMode?e("jsonList",{attrs:{item:t.item}}):t._e()],1),e(o.Z),t.item.Options.status.isActive?t._e():e("div",[e(l.ZB,[e(v.Z,{attrs:{align:"center"}},[e(a.Z,{attrs:{align:"center"}},[e("div",{staticClass:"headline font-weight-bold"},[t._v(" "+t._s(t.item.Options.status.error)+" ")])])],1)],1),e(o.Z)],1),t.item.Options.status.isActive?e("div",t._l(t.main,(function(i){return e("div",{key:i.idx},[i.show?e("div",[t._v(" "+t._s(i.order)+" "),e(l.ZB,[e(v.Z,{attrs:{align:"center"}},[0==i.leftMenu.length&&i.leftBtn?e(a.Z,{staticClass:"col-3",attrs:{align:"center"}},[e(s.Z,{attrs:{small:"",icon:"",color:i.leftBtnColor,disabled:i.leftBtnDisabled},on:{touchstart:function(e){return t.clickStart(i.idx,"left","touch")},touchend:function(e){return t.clickEnd(i.idx,"left","touch")},mousedown:function(e){return t.clickStart(i.idx,"left","mouse")},mouseup:function(e){return t.clickEnd(i.idx,"left","mouse")}}},[i.slider?e("div",[e(r.Z,[t._v(" "+t._s(i.leftBtn)+" ")])],1):t._e(),i.slider?t._e():e("div",[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.leftBtn)+" ")])],1)])],1):t._e(),i.leftMenu.length>0&&i.leftBtn?e(a.Z,{staticClass:"col-3",attrs:{align:"center"}},[e(f.Z,{attrs:{bottom:"",right:"",transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function({on:n,attrs:l}){return[e(s.Z,t._g(t._b({attrs:{small:"",icon:"",color:i.leftBtnColor,disabled:i.leftBtnDisabled}},"v-btn",l,!1),n),[i.slider?e("div",[e(r.Z,[t._v(" "+t._s(i.leftBtn)+" ")])],1):t._e(),i.slider?t._e():e("div",[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.leftBtn)+" ")])],1)])]}}],null,!0)},[e(h.Z,{attrs:{dense:"",color:"secondary lighten-2"}},[e(u.Z,{attrs:{"active-class":"success--text"},model:{value:i.leftMenuIdx,callback:function(e){t.$set(i,"leftMenuIdx",e)},expression:"level.leftMenuIdx"}},t._l(i.leftMenu,(function(i,s){return e(c.Z,{key:s,on:{click:function(e){return t.sendMenuCmd(i.cmd)}}},[e(d.km,[e(d.V9,{staticClass:"text-subtitle-1"},[t._v(" "+t._s(i.name)+" ")])],1),i.active?e(m.Z,[e(r.Z,[t._v("mdi-check")])],1):t._e()],1)})),1)],1)],1)],1):t._e(),i.leftBtn&&!i.slider?e(o.Z,{attrs:{vertical:""}}):t._e(),i.midBtn||i.slider?t._e():e(a.Z,{attrs:{align:i.textAlign}},[e("div",{staticClass:"headline font-weight-bold"},[t._v(" "+t._s(i.text)+" ")])]),!i.text2||i.midBtn||i.slider?t._e():e(a.Z,{attrs:{align:i.text2Align}},[e("div",{staticClass:"headline font-weight-bold"},[t._v(" "+t._s(i.text2)+" ")])]),0===i.midMenu.length&&i.midBtn?e(a.Z,{staticClass:"headline",attrs:{align:"center"}},[e(s.Z,{attrs:{small:"",icon:"",disabled:i.midBtnDisabled,color:i.midBtnColor},on:{touchstart:function(e){return t.clickStart(i.idx,"mid","touch")},touchend:function(e){return t.clickEnd(i.idx,"mid","touch")},mousedown:function(e){return t.clickStart(i.idx,"mid","mouse")},mouseup:function(e){return t.clickEnd(i.idx,"mid","mouse")}}},[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.midBtn)+" ")])],1)],1):t._e(),i.midMenu.length>0&&i.midBtn?e(a.Z,{staticClass:"headline",attrs:{align:"center"}},[e(f.Z,{attrs:{bottom:"",transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function({on:n,attrs:l}){return[i.text?e(s.Z,t._g(t._b({staticClass:"headline font-weight-bold",attrs:{block:"",plain:""}},"v-btn",l,!1),n),[t._v(" "+t._s(i.text)+" ")]):t._e(),i.text?t._e():e(s.Z,t._g(t._b({attrs:{small:"",icon:"",disabled:i.midBtnDisabled,color:i.midBtnColor}},"v-btn",l,!1),n),[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.midBtn)+" ")])],1)]}}],null,!0)},[e(h.Z,{attrs:{dense:"",color:"secondary lighten-2"}},[e(u.Z,{attrs:{"active-class":"success--text"},model:{value:i.midMenuIdx,callback:function(e){t.$set(i,"midMenuIdx",e)},expression:"level.midMenuIdx"}},t._l(i.midMenu,(function(i,s){return e(c.Z,{key:s,on:{click:function(e){return t.sendMenuCmd(i.cmd)}}},[e(d.km,[e(d.V9,{staticClass:"text-subtitle-1"},[t._v(" "+t._s(i.name)+" ")])],1),i.active?e(m.Z,[e(r.Z,[t._v("mdi-check")])],1):t._e()],1)})),1)],1)],1)],1):t._e(),i.slider?e(a.Z,{attrs:{align:"center"}},[e(g.Z,{attrs:{min:i.sliderMin,max:i.sliderMax,label:i.text,"hide-details":"","thumb-label":"","thumb-size":"48",color:"success",step:i.sliderStep},on:{change:function(e){return t.setSlider(i.idx,i.sliderCurrent)}},scopedSlots:t._u([{key:"thumb-label",fn:function({value:s}){return[e("div",{staticClass:"text-h6"},[t._v(" "+t._s(t.sliderVal(i.idx,s))+" ")])]}}],null,!0),model:{value:i.sliderCurrent,callback:function(e){t.$set(i,"sliderCurrent",e)},expression:"level.sliderCurrent"}})],1):t._e(),i.rightBtn&&!i.slider?e(o.Z,{attrs:{vertical:""}}):t._e(),0===i.rightMenu.length&&i.rightBtn?e(a.Z,{staticClass:"col-3",attrs:{align:"center"}},[e(s.Z,{attrs:{small:"",icon:"",disabled:i.rightBtnDisabled,color:i.rightBtnColor},on:{touchstart:function(e){return t.clickStart(i.idx,"right","touch")},touchend:function(e){return t.clickEnd(i.idx,"right","touch")},mousedown:function(e){return t.clickStart(i.idx,"right","mouse")},mouseup:function(e){return t.clickEnd(i.idx,"right","mouse")}}},[i.slider?e("div",[e(r.Z,[t._v(" "+t._s(i.rightBtn)+" ")])],1):t._e(),i.slider?t._e():e("div",[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.rightBtn)+" ")])],1)])],1):t._e(),i.rightMenu.length>0&&i.rightBtn?e(a.Z,{staticClass:"col-3",attrs:{align:"center"}},[e(f.Z,{attrs:{bottom:"",left:"",transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function({on:n,attrs:l}){return[e(s.Z,t._g(t._b({attrs:{small:"",icon:"",disabled:i.rightBtnDisabled,color:i.rightBtnColor}},"v-btn",l,!1),n),[i.slider?e("div",[e(r.Z,[t._v(" "+t._s(i.rightBtn)+" ")])],1):t._e(),i.slider?t._e():e("div",[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.rightBtn)+" ")])],1)])]}}],null,!0)},[e(h.Z,{attrs:{dense:"",color:"secondary lighten-2"}},[e(u.Z,{attrs:{"active-class":"success--text"},model:{value:i.rightMenuIdx,callback:function(e){t.$set(i,"rightMenuIdx",e)},expression:"level.rightMenuIdx"}},t._l(i.rightMenu,(function(i,s){return e(c.Z,{key:s,on:{click:function(e){return t.sendMenuCmd(i.cmd)}}},[e(d.km,[e(d.V9,{staticClass:"text-subtitle-1"},[t._v(" "+t._s(i.name)+" ")])],1),i.active?e(m.Z,[e(r.Z,[t._v("mdi-check")])],1):t._e()],1)})),1)],1)],1)],1):t._e()],1)],1),e(o.Z)],1):t._e()])})),0):t._e(),e(_.Z,{attrs:{color:"secondary darken-1"}},[e(r.Z,{staticClass:"ml-0",attrs:{color:t.item.Options.info.left1IconColor}},[t._v(" "+t._s(t.item.Options.info.left1Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.left1Text)+" ")]),e(r.Z,{staticClass:"ml-2",attrs:{color:t.item.Options.info.left2IconColor}},[t._v(" "+t._s(t.item.Options.info.left2Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.left2Text)+" ")]),e(x.Z),e(r.Z,{attrs:{color:t.item.Options.info.mid1IconColor}},[t._v(" "+t._s(t.item.Options.info.mid1Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.mid1Text)+" ")]),e(r.Z,{staticClass:"ml-2",attrs:{color:t.item.Options.info.mid2IconColor}},[t._v(" "+t._s(t.item.Options.info.mid2Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.mid2Text)+" ")]),e(x.Z),e(r.Z,{attrs:{color:t.item.Options.info.right1IconColor}},[t._v(" "+t._s(t.item.Options.info.right1Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.right1Text)+" ")]),e(r.Z,{staticClass:"ml-2 mr-0",attrs:{color:t.item.Options.info.right2IconColor}},[t._v(" "+t._s(t.item.Options.info.right2Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.right2Text)+" ")])],1)],1)],1):t._e()},k=[],Z=(i(7658),i(8813)),b={components:{jsonList:Z.Z},props:{item:{type:Object,default:()=>({name:"default"})}},data:()=>({name:"default",app:{options:{debugMode:!1}},main:[],lvlMax:1,lvlIcon:null,timer:!1,long:!1,pendingClick:0,touchFirst:!1}),watch:{item:{immediate:!1,deep:!0,handler(){this.setVals()}}},created(){this.app.options=this.$fhem.app.options,this.lvlMax=this.item.Options.setup.main.length,this.lvlIcon=this.lvlMax>1?this.item.Options.setup.expand?"mdi-arrow-expand":"mdi-swap-vertical":null,this.setLvl(this.$fhem.getEl(this.item,"Options","setup","expanded")&&this.$fhem.getEl(this.item,"Options","setup","expand")?-1:0),this.setVals()},methods:{sendCmd(t,e){e?(this.pendingClick&&(clearTimeout(this.pendingClick),this.pendingClick=0),this.pendingClick=setTimeout((()=>{this.$fhem.request(t)}),1e3)):this.$fhem.request(t)},sendMenuCmd(t){let e=this.$fhem.getEl(this.item,"Internals","NAME");/%d/.test(t)&&(t=t.replace("%d",e)),this.sendCmd(t)},updateReading(t){let e=t.split(" ");4===e.length&&this.$fhem.getEl(this.item,"Readings",e[2],"Value")&&(this.item.Readings[e[2]].Value=e[3])},createCmd(t){let e="";if(t.match("set")||t.match("get")){let i=t.trim().split(" ");if(i[1]&&i[1].match("Connected")){let t=i[1].replace("Connected.","");i[1]=this.$fhem.getEl(this.item,"Connected",t,"Internals","NAME"),i[1]?e=i.join(" "):this.$fhem.log({lvl:1,msg:"Connected Device not found. "+this.item.Options})}else e=t}else e="set "+this.item.Name+" "+t;return e},clickStart(t,e,i){this.long=!1,this.$fhem.log({lvl:5,msg:"ClickStart: type "+e+":"+i}),this.touchFirst&&"mouse"===i||("touch"===i&&(this.touchFirst=!0),this.timer=setInterval((()=>{this.long=!0;let i=this.item.Options.setup.main[t][e+"Long"];if(this.$fhem.log({lvl:5,msg:"ClickEvent: Long ["+i+"]"}),i){let t=this.$fhem.handleVals(this.item,i);if(t[0]){let e=this.createCmd(t[0]);this.sendCmd(e),this.timer=clearInterval(this.timer)}}}),1e3))},clickEnd(t,e,i){if(this.$fhem.log({lvl:5,msg:"ClickEnd: type "+e+":"+i}),this.touchFirst&&"mouse"===i)return;"touch"===i&&(this.touchFirst=!0),this.timer=clearInterval(this.timer);let s=this.item.Options.setup.main[t][e+(this.long?"LongRelease":"Click")];if(this.$fhem.log({lvl:5,msg:"ClickEvent: "+(this.long?"LongRelease":"Click")+" ["+s+"]"}),s){let e=this.$fhem.handleVals(this.item,s);if(e[0]){let i=this.item.Options.setup.expand?t:0;this.main[i].sliderPrevent=!1;let n=this.createCmd(e[0]),l=-1!=s.findIndex((t=>t.match("%i")));!this.long&&l&&this.updateReading(n),this.sendCmd(n,l)}}},sliderVal(t,e){let i=this.item.Options.setup.main[t].slider,s=e;if(i){let t=this.$fhem.handleVals(this.item,i),n=t[4]&&t[4].match(".")?1:0;s=e.toFixed(n)}return s},setSlider(t,e){let i=this.item.Options.setup.main[t].slider;if(i){let s=this.$fhem.handleVals(this.item,i);if(s[0]){let i=this.item.Options.setup.expand?t:0;this.main[i].sliderPrevent=!0;let n=this.createCmd(s[0]),l=s[4]&&s[4].match("\\.")?1:0;n=n.replace("%v",e.toFixed(l)),this.sendCmd(n)}}},checkMenu(t){let e=!1;if(t){let i=t.split(" ");i[0].match("set")&&i.splice(0,2),1===i.length&&i.splice(0,0,"state");let s=/\./.test(i[0])?i[0].split("."):["Readings",i[0],"Value"],n=this.$fhem.getEl(this.item,...s);n&&n===i[1]&&(e=!0)}return e},createMenu(t){let e=[];if("string"===typeof t){let e=/\./.test(t)?t.split("."):["Readings",t,"Value"],i=this.$fhem.getEl(this.item,...e);t=JSON.parse(i)}if(t&&t.length>0)for(let i of t){let t=i.split(":");if(t.length>1){let i=this.createCmd(t[1].replace(/:/g,":")),s=this.checkMenu(i);e.push({name:t[0],cmd:i,active:s})}}return e},lvlBtn(){let t=0;this.item.Options.setup.expand?(t=this.main.length>1?0:-1,this.lvlIcon=-1===t?"mdi-arrow-collapse":"mdi-arrow-expand"):(t=this.main[0].idx+1,t>this.lvlMax-1&&(t=0)),this.setLvl(t),this.setVals()},setLvl(t){let e=-1!=t?t:0,i=-1!=t?t:this.lvlMax-1;this.main.splice(0);for(let s=e;s<=i;s++){let t={idx:s,show:!0,leftBtn:"",leftBtnDisabled:!1,leftBtnColor:"",leftMenu:[],leftMenuIdx:-1,text:"",textAlign:"",text2:"",text2Align:"",midBtn:"",midBtnDisabled:!1,midBtnColor:"",midMenu:[],midMenuIdx:-1,slider:!1,sliderCurrent:0,sliderPrevent:!1,sliderMin:0,sliderMax:100,sliderStep:1,rightBtn:"",rightBtnDisabled:!1,rightBtnColor:"",rightMenu:[],rightMenuIdx:-1};this.main.push(t)}},setVals(){for(const t in this.main){let e=this.main[t].idx,i=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].show),s=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].text),n=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].text2),l=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].slider),a=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].leftBtn),o=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].midBtn),r=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].rightBtn),h=this.createMenu(this.item.Options.setup.main[e].leftMenu),c=this.createMenu(this.item.Options.setup.main[e].midMenu),d=this.createMenu(this.item.Options.setup.main[e].rightMenu);this.main[t].show="false"!==i[0],this.main[t].text=s[0]||"",this.main[t].textAlign=s[1]||"center",this.main[t].text2=n[0]||"",this.main[t].text2Align=n[1]||"center",this.main[t].leftBtn=a[0]||"",this.main[t].midBtn=o[0]||"",this.main[t].rightBtn=r[0]||"",this.main[t].leftBtnDisabled=!!a[1],this.main[t].midBtnDisabled=!!o[1],this.main[t].rightBtnDisabled=!!r[1],this.main[t].leftBtnColor=a[2]||"",this.main[t].midBtnColor=o[2]||"",this.main[t].rightBtnColor=r[2]||"",this.main[t].leftMenu=h,this.main[t].leftMenuIdx=h.map((t=>t.active)).indexOf(!0),this.main[t].midMenu=c,this.main[t].midMenuIdx=c.map((t=>t.active)).indexOf(!0),this.main[t].rightMenu=d,this.main[t].rightMenuIdx=d.map((t=>t.active)).indexOf(!0),this.main[t].slider=!!l[0],this.main[t].sliderMin=l[2]||0,this.main[t].sliderMax=l[3]||100,this.main[t].sliderStep=l[4]||1,this.main[t].sliderPrevent?this.main[t].sliderCurrent===l[1]&&(this.main[t].sliderPrevent=!1,this.main[t].sliderCurrent=l[1]||0):this.main[t].sliderCurrent=l[1]||0}}}},M=b,O=i(1001),I=(0,O.Z)(M,C,k,!1,null,null,null),B=I.exports},92:function(t,e,i){i.d(e,{Z:function(){return x}});i(7658);var s=i(8791),n=i(5840),l=i(4019),a=i(2524),o=i(7482),r=i(1649),h=i(3960),c=i(3276),d=i(9042),u=i(9495),m=i(4987),f=i(6596),p=i(1050),v=i(473);const g=(0,m.Z)(a.Z,l.Z,r.Z,h.Z,c.Z,o.Z);var x=g.extend({name:"v-menu",directives:{ClickOutside:d.Z,Resize:u.Z},provide(){return{isInMenu:!0,theme:this.theme}},props:{auto:Boolean,closeOnClick:{type:Boolean,default:!0},closeOnContentClick:{type:Boolean,default:!0},disabled:Boolean,disableKeys:Boolean,maxHeight:{type:[Number,String],default:"auto"},offsetX:Boolean,offsetY:Boolean,openOnHover:Boolean,origin:{type:String,default:"top left"},transition:{type:[Boolean,String],default:"v-menu-transition"}},data(){return{calculatedTopAuto:0,defaultOffset:8,hasJustFocused:!1,listIndex:-1,resizeTimeout:0,selectedIndex:null,tiles:[]}},computed:{activeTile(){return this.tiles[this.listIndex]},calculatedLeft(){const t=Math.max(this.dimensions.content.width,parseFloat(this.calculatedMinWidth));return this.auto?(0,p.kb)(this.calcXOverflow(this.calcLeftAuto(),t))||"0":this.calcLeft(t)||"0"},calculatedMaxHeight(){const t=this.auto?"200px":(0,p.kb)(this.maxHeight);return t||"0"},calculatedMaxWidth(){return(0,p.kb)(this.maxWidth)||"0"},calculatedMinWidth(){if(this.minWidth)return(0,p.kb)(this.minWidth)||"0";const t=Math.min(this.dimensions.activator.width+Number(this.nudgeWidth)+(this.auto?16:0),Math.max(this.pageWidth-24,0)),e=isNaN(parseInt(this.calculatedMaxWidth))?t:parseInt(this.calculatedMaxWidth);return(0,p.kb)(Math.min(e,t))||"0"},calculatedTop(){const t=this.auto?(0,p.kb)(this.calcYOverflow(this.calculatedTopAuto)):this.calcTop();return t||"0"},hasClickableTiles(){return Boolean(this.tiles.find((t=>t.tabIndex>-1)))},styles(){return{maxHeight:this.calculatedMaxHeight,minWidth:this.calculatedMinWidth,maxWidth:this.calculatedMaxWidth,top:this.calculatedTop,left:this.calculatedLeft,transformOrigin:this.origin,zIndex:this.zIndex||this.activeZIndex}}},watch:{isActive(t){t||(this.listIndex=-1)},isContentActive(t){this.hasJustFocused=t},listIndex(t,e){if(t in this.tiles){const e=this.tiles[t];e.classList.add("v-list-item--highlighted");const i=this.$refs.content.scrollTop,s=this.$refs.content.clientHeight;i>e.offsetTop-8?(0,v.Z)(e.offsetTop-e.clientHeight,{appOffset:!1,duration:300,container:this.$refs.content}):i+s{this.startTransition().then((()=>{this.$refs.content&&(this.calculatedTopAuto=this.calcTopAuto(),this.auto&&(this.$refs.content.scrollTop=this.calcScrollPosition()))}))}))},calcScrollPosition(){const t=this.$refs.content,e=t.querySelector(".v-list-item--active"),i=t.scrollHeight-t.offsetHeight;return e?Math.min(i,Math.max(0,e.offsetTop-t.offsetHeight/2+e.offsetHeight/2)):t.scrollTop},calcLeftAuto(){return parseInt(this.dimensions.activator.left-2*this.defaultOffset)},calcTopAuto(){const t=this.$refs.content,e=t.querySelector(".v-list-item--active");if(e||(this.selectedIndex=null),this.offsetY||!e)return this.computedTop;this.selectedIndex=Array.from(this.tiles).indexOf(e);const i=e.offsetTop-this.calcScrollPosition(),s=t.querySelector(".v-list-item").offsetTop;return this.computedTop-i-s-1},changeListIndex(t){if(this.getTiles(),this.isActive&&this.hasClickableTiles)if(t.keyCode!==p.Do.tab){if(t.keyCode===p.Do.down)this.nextTile();else if(t.keyCode===p.Do.up)this.prevTile();else if(t.keyCode===p.Do.end)this.lastTile();else if(t.keyCode===p.Do.home)this.firstTile();else{if(t.keyCode!==p.Do.enter||-1===this.listIndex)return;this.tiles[this.listIndex].click()}t.preventDefault()}else this.isActive=!1},closeConditional(t){const e=t.target;return this.isActive&&!this._isDestroyed&&this.closeOnClick&&!this.$refs.content.contains(e)},genActivatorAttributes(){const t=n.Z.options.methods.genActivatorAttributes.call(this);return this.activeTile&&this.activeTile.id?{...t,"aria-activedescendant":this.activeTile.id}:t},genActivatorListeners(){const t=o.Z.options.methods.genActivatorListeners.call(this);return this.disableKeys||(t.keydown=this.onKeyDown),t},genTransition(){const t=this.genContent();return this.transition?this.$createElement("transition",{props:{name:this.transition}},[t]):t},genDirectives(){const t=[{name:"show",value:this.isContentActive}];return!this.openOnHover&&this.closeOnClick&&t.push({name:"click-outside",value:{handler:()=>{this.isActive=!1},closeConditional:this.closeConditional,include:()=>[this.$el,...this.getOpenDependentElements()]}}),t},genContent(){const t={attrs:{...this.getScopeIdAttrs(),role:"role"in this.$attrs?this.$attrs.role:"menu"},staticClass:"v-menu__content",class:{...this.rootThemeClasses,...this.roundedClasses,"v-menu__content--auto":this.auto,"v-menu__content--fixed":this.activatorFixed,menuable__content__active:this.isActive,[this.contentClass.trim()]:!0},style:this.styles,directives:this.genDirectives(),ref:"content",on:{click:t=>{const e=t.target;e.getAttribute("disabled")||this.closeOnContentClick&&(this.isActive=!1)},keydown:this.onKeyDown}};return this.$listeners.scroll&&(t.on=t.on||{},t.on.scroll=this.$listeners.scroll),!this.disabled&&this.openOnHover&&(t.on=t.on||{},t.on.mouseenter=this.mouseEnterHandler),this.openOnHover&&(t.on=t.on||{},t.on.mouseleave=this.mouseLeaveHandler),this.$createElement("div",t,this.getContentSlot())},getTiles(){this.$refs.content&&(this.tiles=Array.from(this.$refs.content.querySelectorAll(".v-list-item, .v-divider, .v-subheader")))},mouseEnterHandler(){this.runDelay("open",(()=>{this.hasJustFocused||(this.hasJustFocused=!0)}))},mouseLeaveHandler(t){this.runDelay("close",(()=>{var e;(null===(e=this.$refs.content)||void 0===e?void 0:e.contains(t.relatedTarget))||requestAnimationFrame((()=>{this.isActive=!1,this.callDeactivate()}))}))},nextTile(){const t=this.tiles[this.listIndex+1];if(!t){if(!this.tiles.length)return;return this.listIndex=-1,void this.nextTile()}this.listIndex++,-1===t.tabIndex&&this.nextTile()},prevTile(){const t=this.tiles[this.listIndex-1];if(!t){if(!this.tiles.length)return;return this.listIndex=this.tiles.length,void this.prevTile()}this.listIndex--,-1===t.tabIndex&&this.prevTile()},lastTile(){const t=this.tiles[this.tiles.length-1];t&&(this.listIndex=this.tiles.length-1,-1===t.tabIndex&&this.prevTile())},firstTile(){const t=this.tiles[0];t&&(this.listIndex=0,-1===t.tabIndex&&this.nextTile())},onKeyDown(t){if(t.keyCode===p.Do.esc){setTimeout((()=>{this.isActive=!1}));const t=this.getActivator();this.$nextTick((()=>t&&t.focus()))}else!this.isActive&&[p.Do.up,p.Do.down].includes(t.keyCode)&&(this.isActive=!0);this.$nextTick((()=>this.changeListIndex(t)))},onResize(){this.isActive&&(this.$refs.content.offsetWidth,this.updateDimensions(),clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(this.updateDimensions,100))}},render(t){const e={staticClass:"v-menu",class:{"v-menu--attached":""===this.attach||!0===this.attach||"attach"===this.attach},directives:[{arg:"500",name:"resize",value:this.onResize}]};return t("div",e,[!this.activator&&this.genActivator(),this.showLazyContent((()=>[this.$createElement(s.Z,{props:{root:!0,light:this.light,dark:this.dark}},[this.genTransition()])]))])}})}}]); \ No newline at end of file diff --git a/www/fhemapp/js/609.352726ea.js b/www/fhemapp/js/609.352726ea.js deleted file mode 100644 index 00ab303e..00000000 --- a/www/fhemapp/js/609.352726ea.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[609],{3609:function(t,e,i){i.r(e),i.d(e,{default:function(){return T}});var s=i(7179),n=i(3385),l=i(5223),a=i(4437),o=i(4192),r=i(5057),h=i(248),c=i(1908),d=i(2321),u=i(2776),m=i(8228),f=i(92),p=i(1302),v=i(5294),g=i(2059),x=i(5234),_=i(9953),C=function(){var t=this,e=t._self._c;return t.item.Options.show?e(a.Z,{class:t.item.Options.setup.size},[e(n.Z,{attrs:{dark:this.$vuetify.theme.dark,color:"secondary"}},[e(p.Z,{attrs:{height:"7",value:t.item.Options.status.level,color:t.item.Options.status.color,"background-color":"secondary darken-1"}}),e(l.EB,{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.name)+" "),e(x.Z),t.lvlIcon&&t.item.Options.status.isActive?e(s.Z,{attrs:{small:"",icon:""},on:{click:function(e){return t.lvlBtn()}}},[e(r.Z,{attrs:{small:""}},[t._v(" "+t._s(t.lvlIcon)+" ")])],1):t._e(),t.app.options.debugMode?e("jsonList",{attrs:{item:t.item}}):t._e()],1),e(o.Z),t.item.Options.status.isActive?t._e():e("div",[e(l.ZB,[e(v.Z,{attrs:{align:"center"}},[e(a.Z,{attrs:{align:"center"}},[e("div",{staticClass:"headline font-weight-bold"},[t._v(" "+t._s(t.item.Options.status.error)+" ")])])],1)],1),e(o.Z)],1),t.item.Options.status.isActive?e("div",t._l(t.main,(function(i){return e("div",{key:i.idx},[i.show?e("div",[t._v(" "+t._s(i.order)+" "),e(l.ZB,[e(v.Z,{attrs:{align:"center"}},[0==i.leftMenu.length&&i.leftBtn?e(a.Z,{staticClass:"col-3",attrs:{align:"center"}},[e(s.Z,{attrs:{small:"",icon:"",color:i.leftBtnColor,disabled:i.leftBtnDisabled},on:{touchstart:function(e){return t.clickStart(i.idx,"left","touch")},touchend:function(e){return t.clickEnd(i.idx,"left","touch")},mousedown:function(e){return t.clickStart(i.idx,"left","mouse")},mouseup:function(e){return t.clickEnd(i.idx,"left","mouse")}}},[i.slider?e("div",[e(r.Z,[t._v(" "+t._s(i.leftBtn)+" ")])],1):t._e(),i.slider?t._e():e("div",[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.leftBtn)+" ")])],1)])],1):t._e(),i.leftMenu.length>0&&i.leftBtn?e(a.Z,{staticClass:"col-3",attrs:{align:"center"}},[e(f.Z,{attrs:{bottom:"",right:"",transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function({on:n,attrs:l}){return[e(s.Z,t._g(t._b({attrs:{small:"",icon:""}},"v-btn",l,!1),n),[i.slider?e("div",[e(r.Z,[t._v(" "+t._s(i.leftBtn)+" ")])],1):t._e(),i.slider?t._e():e("div",[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.leftBtn)+" ")])],1)])]}}],null,!0)},[e(h.Z,{attrs:{dense:"",color:"secondary lighten-2"}},[e(u.Z,{attrs:{"active-class":"success--text"},model:{value:i.leftMenuIdx,callback:function(e){t.$set(i,"leftMenuIdx",e)},expression:"level.leftMenuIdx"}},t._l(i.leftMenu,(function(i,s){return e(c.Z,{key:s,on:{click:function(e){return t.sendMenuCmd(i.cmd)}}},[e(d.km,[e(d.V9,{staticClass:"text-subtitle-1"},[t._v(" "+t._s(i.name)+" ")])],1),i.active?e(m.Z,[e(r.Z,[t._v("mdi-check")])],1):t._e()],1)})),1)],1)],1)],1):t._e(),i.leftBtn&&!i.slider?e(o.Z,{attrs:{vertical:""}}):t._e(),i.midBtn||i.slider?t._e():e(a.Z,{attrs:{align:i.textAlign}},[e("div",{staticClass:"headline font-weight-bold"},[t._v(" "+t._s(i.text)+" ")])]),!i.text2||i.midBtn||i.slider?t._e():e(a.Z,{attrs:{align:i.text2Align}},[e("div",{staticClass:"headline font-weight-bold"},[t._v(" "+t._s(i.text2)+" ")])]),0===i.midMenu.length&&i.midBtn?e(a.Z,{staticClass:"headline",attrs:{align:"center"}},[e(s.Z,{attrs:{small:"",icon:"",disabled:i.midBtnDisabled,color:i.midBtnColor},on:{touchstart:function(e){return t.clickStart(i.idx,"mid","touch")},touchend:function(e){return t.clickEnd(i.idx,"mid","touch")},mousedown:function(e){return t.clickStart(i.idx,"mid","mouse")},mouseup:function(e){return t.clickEnd(i.idx,"mid","mouse")}}},[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.midBtn)+" ")])],1)],1):t._e(),i.midMenu.length>0&&i.midBtn?e(a.Z,{staticClass:"headline",attrs:{align:"center"}},[e(f.Z,{attrs:{bottom:"",transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function({on:n,attrs:l}){return[i.text?e(s.Z,t._g(t._b({staticClass:"headline font-weight-bold",attrs:{block:"",plain:""}},"v-btn",l,!1),n),[t._v(" "+t._s(i.text)+" ")]):t._e(),i.text?t._e():e(s.Z,t._g(t._b({attrs:{small:"",icon:""}},"v-btn",l,!1),n),[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.midBtn)+" ")])],1)]}}],null,!0)},[e(h.Z,{attrs:{dense:"",color:"secondary lighten-2"}},[e(u.Z,{attrs:{"active-class":"success--text"},model:{value:i.midMenuIdx,callback:function(e){t.$set(i,"midMenuIdx",e)},expression:"level.midMenuIdx"}},t._l(i.midMenu,(function(i,s){return e(c.Z,{key:s,on:{click:function(e){return t.sendMenuCmd(i.cmd)}}},[e(d.km,[e(d.V9,{staticClass:"text-subtitle-1"},[t._v(" "+t._s(i.name)+" ")])],1),i.active?e(m.Z,[e(r.Z,[t._v("mdi-check")])],1):t._e()],1)})),1)],1)],1)],1):t._e(),i.slider?e(a.Z,{attrs:{align:"center"}},[e(g.Z,{attrs:{min:i.sliderMin,max:i.sliderMax,label:i.text,"hide-details":"","thumb-label":"","thumb-size":"48",color:"success",step:i.sliderStep},on:{change:function(e){return t.setSlider(i.idx,i.sliderCurrent)}},scopedSlots:t._u([{key:"thumb-label",fn:function({value:s}){return[e("div",{staticClass:"text-h6"},[t._v(" "+t._s(t.sliderVal(i.idx,s))+" ")])]}}],null,!0),model:{value:i.sliderCurrent,callback:function(e){t.$set(i,"sliderCurrent",e)},expression:"level.sliderCurrent"}})],1):t._e(),i.rightBtn&&!i.slider?e(o.Z,{attrs:{vertical:""}}):t._e(),0===i.rightMenu.length&&i.rightBtn?e(a.Z,{staticClass:"col-3",attrs:{align:"center"}},[e(s.Z,{attrs:{small:"",icon:"",disabled:i.rightBtnDisabled,color:i.rightBtnColor},on:{touchstart:function(e){return t.clickStart(i.idx,"right","touch")},touchend:function(e){return t.clickEnd(i.idx,"right","touch")},mousedown:function(e){return t.clickStart(i.idx,"right","mouse")},mouseup:function(e){return t.clickEnd(i.idx,"right","mouse")}}},[i.slider?e("div",[e(r.Z,[t._v(" "+t._s(i.rightBtn)+" ")])],1):t._e(),i.slider?t._e():e("div",[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.rightBtn)+" ")])],1)])],1):t._e(),i.rightMenu.length>0&&i.rightBtn?e(a.Z,{staticClass:"col-3",attrs:{align:"center"}},[e(f.Z,{attrs:{bottom:"",left:"",transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function({on:n,attrs:l}){return[e(s.Z,t._g(t._b({attrs:{small:"",icon:""}},"v-btn",l,!1),n),[i.slider?e("div",[e(r.Z,[t._v(" "+t._s(i.rightBtn)+" ")])],1):t._e(),i.slider?t._e():e("div",[e(r.Z,{attrs:{large:""}},[t._v(" "+t._s(i.rightBtn)+" ")])],1)])]}}],null,!0)},[e(h.Z,{attrs:{dense:"",color:"secondary lighten-2"}},[e(u.Z,{attrs:{"active-class":"success--text"},model:{value:i.rightMenuIdx,callback:function(e){t.$set(i,"rightMenuIdx",e)},expression:"level.rightMenuIdx"}},t._l(i.rightMenu,(function(i,s){return e(c.Z,{key:s,on:{click:function(e){return t.sendMenuCmd(i.cmd)}}},[e(d.km,[e(d.V9,{staticClass:"text-subtitle-1"},[t._v(" "+t._s(i.name)+" ")])],1),i.active?e(m.Z,[e(r.Z,[t._v("mdi-check")])],1):t._e()],1)})),1)],1)],1)],1):t._e()],1)],1),e(o.Z)],1):t._e()])})),0):t._e(),e(_.Z,{attrs:{color:"secondary darken-1"}},[e(r.Z,{staticClass:"ml-0",attrs:{color:t.item.Options.info.left1IconColor}},[t._v(" "+t._s(t.item.Options.info.left1Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.left1Text)+" ")]),e(r.Z,{staticClass:"ml-2",attrs:{color:t.item.Options.info.left2IconColor}},[t._v(" "+t._s(t.item.Options.info.left2Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.left2Text)+" ")]),e(x.Z),e(r.Z,{attrs:{color:t.item.Options.info.mid1IconColor}},[t._v(" "+t._s(t.item.Options.info.mid1Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.mid1Text)+" ")]),e(r.Z,{staticClass:"ml-2",attrs:{color:t.item.Options.info.mid2IconColor}},[t._v(" "+t._s(t.item.Options.info.mid2Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.mid2Text)+" ")]),e(x.Z),e(r.Z,{attrs:{color:t.item.Options.info.right1IconColor}},[t._v(" "+t._s(t.item.Options.info.right1Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.right1Text)+" ")]),e(r.Z,{staticClass:"ml-2 mr-0",attrs:{color:t.item.Options.info.right2IconColor}},[t._v(" "+t._s(t.item.Options.info.right2Icon)+" ")]),e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(t.item.Options.info.right2Text)+" ")])],1)],1)],1):t._e()},k=[],Z=(i(7658),i(8813)),M={components:{jsonList:Z.Z},props:{item:{type:Object,default:()=>({name:"default"})}},data:()=>({name:"default",app:{options:{debugMode:!1}},main:[],lvlMax:1,lvlIcon:null,timer:!1,long:!1,pendingClick:0,touchFirst:!1}),watch:{item:{immediate:!1,deep:!0,handler(){this.setVals()}}},created(){this.app.options=this.$fhem.app.options,this.lvlMax=this.item.Options.setup.main.length,this.lvlIcon=this.lvlMax>1?this.item.Options.setup.expand?"mdi-arrow-expand":"mdi-swap-vertical":null,this.setLvl(this.$fhem.getEl(this.item,"Options","setup","expanded")&&this.$fhem.getEl(this.item,"Options","setup","expand")?-1:0),this.setVals()},methods:{sendCmd(t,e){e?(this.pendingClick&&(clearTimeout(this.pendingClick),this.pendingClick=0),this.pendingClick=setTimeout((()=>{this.$fhem.request(t)}),1e3)):this.$fhem.request(t)},sendMenuCmd(t){let e=this.$fhem.getEl(this.item,"Internals","NAME");/%d/.test(t)&&(t=t.replace("%d",e)),this.sendCmd(t)},updateReading(t){let e=t.split(" ");4===e.length&&this.$fhem.getEl(this.item,"Readings",e[2],"Value")&&(this.item.Readings[e[2]].Value=e[3])},createCmd(t){let e="";if(t.match("set")||t.match("get")){let i=t.trim().split(" ");if(i[1]&&i[1].match("Connected")){let t=i[1].replace("Connected.","");i[1]=this.$fhem.getEl(this.item,"Connected",t,"Internals","NAME"),i[1]?e=i.join(" "):this.$fhem.log({lvl:1,msg:"Connected Device not found. "+this.item.Options})}else e=t}else e="set "+this.item.Name+" "+t;return e},clickStart(t,e,i){this.long=!1,this.$fhem.log({lvl:5,msg:"ClickStart: type "+e+":"+i}),this.touchFirst&&"mouse"===i||("touch"===i&&(this.touchFirst=!0),this.timer=setInterval((()=>{this.long=!0;let i=this.item.Options.setup.main[t][e+"Long"];if(this.$fhem.log({lvl:5,msg:"ClickEvent: Long ["+i+"]"}),i){let t=this.$fhem.handleVals(this.item,i);if(t[0]){let e=this.createCmd(t[0]);this.sendCmd(e),this.timer=clearInterval(this.timer)}}}),1e3))},clickEnd(t,e,i){if(this.$fhem.log({lvl:5,msg:"ClickEnd: type "+e+":"+i}),this.touchFirst&&"mouse"===i)return;"touch"===i&&(this.touchFirst=!0),this.timer=clearInterval(this.timer);let s=this.item.Options.setup.main[t][e+(this.long?"LongRelease":"Click")];if(this.$fhem.log({lvl:5,msg:"ClickEvent: "+(this.long?"LongRelease":"Click")+" ["+s+"]"}),s){let e=this.$fhem.handleVals(this.item,s);if(e[0]){let i=this.item.Options.setup.expand?t:0;this.main[i].sliderPrevent=!1;let n=this.createCmd(e[0]),l=-1!=s.findIndex((t=>t.match("%i")));!this.long&&l&&this.updateReading(n),this.sendCmd(n,l)}}},sliderVal(t,e){let i=this.item.Options.setup.main[t].slider,s=e;if(i){let t=this.$fhem.handleVals(this.item,i),n=t[4]&&t[4].match(".")?1:0;s=e.toFixed(n)}return s},setSlider(t,e){let i=this.item.Options.setup.main[t].slider;if(i){let s=this.$fhem.handleVals(this.item,i);if(s[0]){let i=this.item.Options.setup.expand?t:0;this.main[i].sliderPrevent=!0;let n=this.createCmd(s[0]),l=s[4]&&s[4].match("\\.")?1:0;n=n.replace("%v",e.toFixed(l)),this.sendCmd(n)}}},checkMenu(t){let e=!1;if(t){let i=t.split(" ");i[0].match("set")&&i.splice(0,2),1===i.length&&i.splice(0,0,"state");let s=/\./.test(i[0])?i[0].split("."):["Readings",i[0],"Value"],n=this.$fhem.getEl(this.item,...s);n&&n===i[1]&&(e=!0)}return e},createMenu(t){let e=[];if("string"===typeof t){let e=/\./.test(t)?t.split("."):["Readings",t,"Value"],i=this.$fhem.getEl(this.item,...e);t=JSON.parse(i)}if(t&&t.length>0)for(let i of t){let t=i.split(":");if(t.length>1){let i=this.createCmd(t[1].replace(/:/g,":")),s=this.checkMenu(i);e.push({name:t[0],cmd:i,active:s})}}return e},lvlBtn(){let t=0;this.item.Options.setup.expand?(t=this.main.length>1?0:-1,this.lvlIcon=-1===t?"mdi-arrow-collapse":"mdi-arrow-expand"):(t=this.main[0].idx+1,t>this.lvlMax-1&&(t=0)),this.setLvl(t),this.setVals()},setLvl(t){let e=-1!=t?t:0,i=-1!=t?t:this.lvlMax-1;this.main.splice(0);for(let s=e;s<=i;s++){let t={idx:s,show:!0,leftBtn:"",leftBtnDisabled:!1,leftBtnColor:"",leftMenu:[],leftMenuIdx:-1,text:"",textAlign:"",text2:"",text2Align:"",midBtn:"",midBtnDisabled:!1,midBtnColor:"",midMenu:[],midMenuIdx:-1,slider:!1,sliderCurrent:0,sliderPrevent:!1,sliderMin:0,sliderMax:100,sliderStep:1,rightBtn:"",rightBtnDisabled:!1,rightBtnColor:"",rightMenu:[],rightMenuIdx:-1};this.main.push(t)}},setVals(){for(const t in this.main){let e=this.main[t].idx,i=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].show),s=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].text),n=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].text2),l=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].slider),a=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].leftBtn),o=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].midBtn),r=this.$fhem.handleVals(this.item,this.item.Options.setup.main[e].rightBtn),h=this.createMenu(this.item.Options.setup.main[e].leftMenu),c=this.createMenu(this.item.Options.setup.main[e].midMenu),d=this.createMenu(this.item.Options.setup.main[e].rightMenu);this.main[t].show="false"!==i[0],this.main[t].text=s[0]||"",this.main[t].textAlign=s[1]||"center",this.main[t].text2=n[0]||"",this.main[t].text2Align=n[1]||"center",this.main[t].leftBtn=a[0]||"",this.main[t].midBtn=o[0]||"",this.main[t].rightBtn=r[0]||"",this.main[t].leftBtnDisabled=!!a[1],this.main[t].midBtnDisabled=!!o[1],this.main[t].rightBtnDisabled=!!r[1],this.main[t].leftBtnColor=a[2]||"",this.main[t].midBtnColor=o[2]||"",this.main[t].rightBtnColor=r[2]||"",this.main[t].leftMenu=h,this.main[t].leftMenuIdx=h.map((t=>t.active)).indexOf(!0),this.main[t].midMenu=c,this.main[t].midMenuIdx=c.map((t=>t.active)).indexOf(!0),this.main[t].rightMenu=d,this.main[t].rightMenuIdx=d.map((t=>t.active)).indexOf(!0),this.main[t].slider=!!l[0],this.main[t].sliderMin=l[2]||0,this.main[t].sliderMax=l[3]||100,this.main[t].sliderStep=l[4]||1,this.main[t].sliderPrevent?this.main[t].sliderCurrent===l[1]&&(this.main[t].sliderPrevent=!1,this.main[t].sliderCurrent=l[1]||0):this.main[t].sliderCurrent=l[1]||0}}}},O=M,b=i(1001),I=(0,b.Z)(O,C,k,!1,null,null,null),T=I.exports},92:function(t,e,i){i.d(e,{Z:function(){return x}});i(7658);var s=i(8791),n=i(5840),l=i(4019),a=i(2524),o=i(7482),r=i(1649),h=i(3960),c=i(3276),d=i(9042),u=i(9495),m=i(4987),f=i(6596),p=i(1050),v=i(473);const g=(0,m.Z)(a.Z,l.Z,r.Z,h.Z,c.Z,o.Z);var x=g.extend({name:"v-menu",directives:{ClickOutside:d.Z,Resize:u.Z},provide(){return{isInMenu:!0,theme:this.theme}},props:{auto:Boolean,closeOnClick:{type:Boolean,default:!0},closeOnContentClick:{type:Boolean,default:!0},disabled:Boolean,disableKeys:Boolean,maxHeight:{type:[Number,String],default:"auto"},offsetX:Boolean,offsetY:Boolean,openOnHover:Boolean,origin:{type:String,default:"top left"},transition:{type:[Boolean,String],default:"v-menu-transition"}},data(){return{calculatedTopAuto:0,defaultOffset:8,hasJustFocused:!1,listIndex:-1,resizeTimeout:0,selectedIndex:null,tiles:[]}},computed:{activeTile(){return this.tiles[this.listIndex]},calculatedLeft(){const t=Math.max(this.dimensions.content.width,parseFloat(this.calculatedMinWidth));return this.auto?(0,p.kb)(this.calcXOverflow(this.calcLeftAuto(),t))||"0":this.calcLeft(t)||"0"},calculatedMaxHeight(){const t=this.auto?"200px":(0,p.kb)(this.maxHeight);return t||"0"},calculatedMaxWidth(){return(0,p.kb)(this.maxWidth)||"0"},calculatedMinWidth(){if(this.minWidth)return(0,p.kb)(this.minWidth)||"0";const t=Math.min(this.dimensions.activator.width+Number(this.nudgeWidth)+(this.auto?16:0),Math.max(this.pageWidth-24,0)),e=isNaN(parseInt(this.calculatedMaxWidth))?t:parseInt(this.calculatedMaxWidth);return(0,p.kb)(Math.min(e,t))||"0"},calculatedTop(){const t=this.auto?(0,p.kb)(this.calcYOverflow(this.calculatedTopAuto)):this.calcTop();return t||"0"},hasClickableTiles(){return Boolean(this.tiles.find((t=>t.tabIndex>-1)))},styles(){return{maxHeight:this.calculatedMaxHeight,minWidth:this.calculatedMinWidth,maxWidth:this.calculatedMaxWidth,top:this.calculatedTop,left:this.calculatedLeft,transformOrigin:this.origin,zIndex:this.zIndex||this.activeZIndex}}},watch:{isActive(t){t||(this.listIndex=-1)},isContentActive(t){this.hasJustFocused=t},listIndex(t,e){if(t in this.tiles){const e=this.tiles[t];e.classList.add("v-list-item--highlighted");const i=this.$refs.content.scrollTop,s=this.$refs.content.clientHeight;i>e.offsetTop-8?(0,v.Z)(e.offsetTop-e.clientHeight,{appOffset:!1,duration:300,container:this.$refs.content}):i+s{this.startTransition().then((()=>{this.$refs.content&&(this.calculatedTopAuto=this.calcTopAuto(),this.auto&&(this.$refs.content.scrollTop=this.calcScrollPosition()))}))}))},calcScrollPosition(){const t=this.$refs.content,e=t.querySelector(".v-list-item--active"),i=t.scrollHeight-t.offsetHeight;return e?Math.min(i,Math.max(0,e.offsetTop-t.offsetHeight/2+e.offsetHeight/2)):t.scrollTop},calcLeftAuto(){return parseInt(this.dimensions.activator.left-2*this.defaultOffset)},calcTopAuto(){const t=this.$refs.content,e=t.querySelector(".v-list-item--active");if(e||(this.selectedIndex=null),this.offsetY||!e)return this.computedTop;this.selectedIndex=Array.from(this.tiles).indexOf(e);const i=e.offsetTop-this.calcScrollPosition(),s=t.querySelector(".v-list-item").offsetTop;return this.computedTop-i-s-1},changeListIndex(t){if(this.getTiles(),this.isActive&&this.hasClickableTiles)if(t.keyCode!==p.Do.tab){if(t.keyCode===p.Do.down)this.nextTile();else if(t.keyCode===p.Do.up)this.prevTile();else if(t.keyCode===p.Do.end)this.lastTile();else if(t.keyCode===p.Do.home)this.firstTile();else{if(t.keyCode!==p.Do.enter||-1===this.listIndex)return;this.tiles[this.listIndex].click()}t.preventDefault()}else this.isActive=!1},closeConditional(t){const e=t.target;return this.isActive&&!this._isDestroyed&&this.closeOnClick&&!this.$refs.content.contains(e)},genActivatorAttributes(){const t=n.Z.options.methods.genActivatorAttributes.call(this);return this.activeTile&&this.activeTile.id?{...t,"aria-activedescendant":this.activeTile.id}:t},genActivatorListeners(){const t=o.Z.options.methods.genActivatorListeners.call(this);return this.disableKeys||(t.keydown=this.onKeyDown),t},genTransition(){const t=this.genContent();return this.transition?this.$createElement("transition",{props:{name:this.transition}},[t]):t},genDirectives(){const t=[{name:"show",value:this.isContentActive}];return!this.openOnHover&&this.closeOnClick&&t.push({name:"click-outside",value:{handler:()=>{this.isActive=!1},closeConditional:this.closeConditional,include:()=>[this.$el,...this.getOpenDependentElements()]}}),t},genContent(){const t={attrs:{...this.getScopeIdAttrs(),role:"role"in this.$attrs?this.$attrs.role:"menu"},staticClass:"v-menu__content",class:{...this.rootThemeClasses,...this.roundedClasses,"v-menu__content--auto":this.auto,"v-menu__content--fixed":this.activatorFixed,menuable__content__active:this.isActive,[this.contentClass.trim()]:!0},style:this.styles,directives:this.genDirectives(),ref:"content",on:{click:t=>{const e=t.target;e.getAttribute("disabled")||this.closeOnContentClick&&(this.isActive=!1)},keydown:this.onKeyDown}};return this.$listeners.scroll&&(t.on=t.on||{},t.on.scroll=this.$listeners.scroll),!this.disabled&&this.openOnHover&&(t.on=t.on||{},t.on.mouseenter=this.mouseEnterHandler),this.openOnHover&&(t.on=t.on||{},t.on.mouseleave=this.mouseLeaveHandler),this.$createElement("div",t,this.getContentSlot())},getTiles(){this.$refs.content&&(this.tiles=Array.from(this.$refs.content.querySelectorAll(".v-list-item, .v-divider, .v-subheader")))},mouseEnterHandler(){this.runDelay("open",(()=>{this.hasJustFocused||(this.hasJustFocused=!0)}))},mouseLeaveHandler(t){this.runDelay("close",(()=>{var e;(null===(e=this.$refs.content)||void 0===e?void 0:e.contains(t.relatedTarget))||requestAnimationFrame((()=>{this.isActive=!1,this.callDeactivate()}))}))},nextTile(){const t=this.tiles[this.listIndex+1];if(!t){if(!this.tiles.length)return;return this.listIndex=-1,void this.nextTile()}this.listIndex++,-1===t.tabIndex&&this.nextTile()},prevTile(){const t=this.tiles[this.listIndex-1];if(!t){if(!this.tiles.length)return;return this.listIndex=this.tiles.length,void this.prevTile()}this.listIndex--,-1===t.tabIndex&&this.prevTile()},lastTile(){const t=this.tiles[this.tiles.length-1];t&&(this.listIndex=this.tiles.length-1,-1===t.tabIndex&&this.prevTile())},firstTile(){const t=this.tiles[0];t&&(this.listIndex=0,-1===t.tabIndex&&this.nextTile())},onKeyDown(t){if(t.keyCode===p.Do.esc){setTimeout((()=>{this.isActive=!1}));const t=this.getActivator();this.$nextTick((()=>t&&t.focus()))}else!this.isActive&&[p.Do.up,p.Do.down].includes(t.keyCode)&&(this.isActive=!0);this.$nextTick((()=>this.changeListIndex(t)))},onResize(){this.isActive&&(this.$refs.content.offsetWidth,this.updateDimensions(),clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(this.updateDimensions,100))}},render(t){const e={staticClass:"v-menu",class:{"v-menu--attached":""===this.attach||!0===this.attach||"attach"===this.attach},directives:[{arg:"500",name:"resize",value:this.onResize}]};return t("div",e,[!this.activator&&this.genActivator(),this.showLazyContent((()=>[this.$createElement(s.Z,{props:{root:!0,light:this.light,dark:this.dark}},[this.genTransition()])]))])}})}}]); \ No newline at end of file diff --git a/www/fhemapp/js/654.9f84969d.js b/www/fhemapp/js/654.d05facf3.js similarity index 96% rename from www/fhemapp/js/654.9f84969d.js rename to www/fhemapp/js/654.d05facf3.js index cfb24a95..df9eb0cc 100644 --- a/www/fhemapp/js/654.9f84969d.js +++ b/www/fhemapp/js/654.d05facf3.js @@ -1 +1 @@ -"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[654],{3654:function(e,t,i){i.r(t),i.d(t,{default:function(){return m}});var s=i(5294),a=function(){var e=this,t=e._self._c;return t("div",[t(s.Z,e._l(e.app.data.deviceList,(function(e){return t(e.Options.component,{key:e.Internals.FUUID,tag:"component",attrs:{item:e}})})),1)],1)},n=[],p={name:"DevicesView",components:{templ_default:()=>Promise.all([i.e(399),i.e(445),i.e(609)]).then(i.bind(i,3609)),templ_panel:()=>Promise.all([i.e(399),i.e(630)]).then(i.bind(i,5283)),templ_chart:()=>Promise.all([i.e(399),i.e(137),i.e(270),i.e(570)]).then(i.bind(i,9860)),templ_chart2:()=>Promise.all([i.e(399),i.e(137),i.e(270),i.e(651)]).then(i.bind(i,4329)),templ_weather:()=>i.e(838).then(i.bind(i,1838)),templ_list:()=>Promise.all([i.e(399),i.e(32)]).then(i.bind(i,311)),templ_wdtimer:()=>Promise.all([i.e(399),i.e(999)]).then(i.bind(i,9950)),templ_scenes:()=>i.e(4).then(i.bind(i,7004)),templ_sonos:()=>Promise.all([i.e(399),i.e(445),i.e(454)]).then(i.bind(i,454)),templ_sysmon:()=>Promise.all([i.e(399),i.e(592)]).then(i.bind(i,8053)),templ_hmlan:()=>i.e(590).then(i.bind(i,7590)),templ_cam:()=>Promise.all([i.e(399),i.e(994)]).then(i.bind(i,2156)),templ_iframe:()=>Promise.all([i.e(399),i.e(705)]).then(i.bind(i,1998))},data:()=>({app:{session:{connect:!1},options:{mobileHeader:!1},data:{deviceList:[],header:""}}}),watch:{$route(){this.subscribe()},"app.session.ready"(e){e&&this.subscribe()}},mounted(){this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data},methods:{setHeader(){(this.app.options.mobileHeader||"page"===this.app.options.mobileHeaderContent)&&("Devices"===this.$route.name?this.$route.params.filter.match("device=")?this.$fhem.app.appBar.mobileHeader="":this.$fhem.app.appBar.mobileHeader=this.$route.params.filter.split("=")[1]:this.$fhem.app.appBar.mobileHeader=this.$route.name)},subscribe(){let e=this.$route.params.filter||this.$route.path;this.setHeader(),this.$fhem.getDevices(e)}}},l=p,r=i(1001),h=(0,r.Z)(l,a,n,!1,null,null,null),m=h.exports}}]); \ No newline at end of file +"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[654],{3654:function(e,t,i){i.r(t),i.d(t,{default:function(){return m}});var s=i(5294),a=function(){var e=this,t=e._self._c;return t("div",[t(s.Z,e._l(e.app.data.deviceList,(function(e){return t(e.Options.component,{key:e.Internals.FUUID,tag:"component",attrs:{item:e}})})),1)],1)},n=[],p={name:"DevicesView",components:{templ_default:()=>Promise.all([i.e(399),i.e(445),i.e(259)]).then(i.bind(i,8259)),templ_panel:()=>Promise.all([i.e(399),i.e(630)]).then(i.bind(i,5283)),templ_chart:()=>Promise.all([i.e(399),i.e(137),i.e(270),i.e(570)]).then(i.bind(i,9860)),templ_chart2:()=>Promise.all([i.e(399),i.e(137),i.e(270),i.e(651)]).then(i.bind(i,4329)),templ_weather:()=>i.e(838).then(i.bind(i,1838)),templ_list:()=>Promise.all([i.e(399),i.e(32)]).then(i.bind(i,311)),templ_wdtimer:()=>Promise.all([i.e(399),i.e(999)]).then(i.bind(i,9950)),templ_scenes:()=>i.e(4).then(i.bind(i,7004)),templ_sonos:()=>Promise.all([i.e(399),i.e(445),i.e(454)]).then(i.bind(i,454)),templ_sysmon:()=>Promise.all([i.e(399),i.e(592)]).then(i.bind(i,8053)),templ_hmlan:()=>i.e(590).then(i.bind(i,7590)),templ_cam:()=>Promise.all([i.e(399),i.e(994)]).then(i.bind(i,2156)),templ_iframe:()=>Promise.all([i.e(399),i.e(705)]).then(i.bind(i,1998))},data:()=>({app:{session:{connect:!1},options:{mobileHeader:!1},data:{deviceList:[],header:""}}}),watch:{$route(){this.subscribe()},"app.session.ready"(e){e&&this.subscribe()}},mounted(){this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data},methods:{setHeader(){(this.app.options.mobileHeader||"page"===this.app.options.mobileHeaderContent)&&("Devices"===this.$route.name?this.$route.params.filter.match("device=")?this.$fhem.app.appBar.mobileHeader="":this.$fhem.app.appBar.mobileHeader=this.$route.params.filter.split("=")[1]:this.$fhem.app.appBar.mobileHeader=this.$route.name)},subscribe(){let e=this.$route.params.filter||this.$route.path;this.setHeader(),this.$fhem.getDevices(e)}}},l=p,r=i(1001),h=(0,r.Z)(l,a,n,!1,null,null,null),m=h.exports}}]); \ No newline at end of file diff --git a/www/fhemapp/js/app.7f5956b9.js b/www/fhemapp/js/app.cac0b616.js similarity index 98% rename from www/fhemapp/js/app.7f5956b9.js rename to www/fhemapp/js/app.cac0b616.js index dc8b6f84..91f40458 100644 --- a/www/fhemapp/js/app.7f5956b9.js +++ b/www/fhemapp/js/app.cac0b616.js @@ -1 +1 @@ -(function(){var t={4835:function(t,e,s){"use strict";var a=s(144),n=s(1096),o=s(677),i=s(8983),r=s(7179),l=s(4944),p=s(6035),c=s(4192),h=s(5057),d=s(2469),u=s(248),m=s(1161),f=s(1908),g=s(2321),v=s(8228),b=s(3551),y=s(1969),w=s(8236),O=s(6275),k=s(5234),C=s(3432),x=function(){var t=this,e=t._self._c;return e(n.Z,{staticClass:"noselect"},[e(w.Z,{attrs:{value:t.app.options.loading}},[e(O.Z,{attrs:{indeterminate:"",size:"64"}})],1),e(o.Z,{attrs:{app:"",color:t.appBar.color,dark:"","clipped-left":""}},[t.appBar.drawer?t._e():e("div",[e(i.Z,{on:{click:function(e){e.stopPropagation(),t.appBar.drawer=!t.appBar.drawer}}})],1),t.appBar.drawer?e("div",{staticClass:"text-h5"},[e("div",{staticClass:"text-h5 hidden-md-and-down"},[t._v(" "+t._s(t.appBar.clock)+" ")])]):t._e(),e(k.Z),t.app.options.mobileHeader||t.app.options.mobileHeaderContent?e("div",{staticClass:"text-h5 hidden-lg-and-up"},[t._v(" "+t._s(t.appBar.mobileHeader)+" ")]):t._e(),e("div",{staticClass:"text-h5 hidden-md-and-down"},[t._v(" "+t._s(t.appBar.header)+" ")]),e(k.Z),t.app.options.debugMode?e(r.Z,{attrs:{icon:""},on:{click:function(e){return t.goTo("/syslog")}}},[e(h.Z,[t._v("mdi-format-list-bulleted")])],1):t._e(),t.app.options.reloadBtn?e(r.Z,{attrs:{icon:""},on:{click:function(e){return t.reload()}}},[e(h.Z,[t._v("mdi-reload")])],1):t._e(),t.app.options.homeBtn&&!t.appBar.drawer?e(r.Z,{staticClass:"text-h5",attrs:{icon:""},on:{click:function(e){return t.goTo()}}},[e(h.Z,[t._v("mdi-home")])],1):t._e(),e(C.Z,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:s,attrs:a}){return[e(h.Z,t._g(t._b({staticClass:"ml-3",attrs:{small:"",color:t.status.color},domProps:{textContent:t._s(t.status.icon)}},"v-icon",a,!1),s))]}}])},[e("div",{domProps:{textContent:t._s(t.status.text)}}),e("div",{domProps:{textContent:t._s(t.status.time)}})])],1),e(y.Z,{attrs:{app:"",color:"secondary",dark:this.$vuetify.theme.dark,clipped:""},model:{value:t.appBar.drawer,callback:function(e){t.$set(t.appBar,"drawer",e)},expression:"appBar.drawer"}},[e(d.Z,{attrs:{src:s(2862)}}),e(c.Z),e(u.Z,{attrs:{nav:""}},[e(f.Z,{key:"home",attrs:{link:"",to:"/"}},[e(v.Z,[e(h.Z,[t._v("mdi-home")])],1),e(g.km,[e(g.V9,{staticClass:"text-left"},[t._v(" "+t._s(t.$t("app.navigation.home"))+" ")])],1)],1),e(c.Z),t.showGroups?e(m.Z,{attrs:{color:"secondary lighten-4","prepend-icon":"mdi-lightbulb-group",value:t.app.options.expandGroups},scopedSlots:t._u([{key:"activator",fn:function(){return[e(g.V9,[t._v(t._s(t.$t("app.navigation.group")))])]},proxy:!0}],null,!1,444615855)},t._l(t.app.data.groupList,(function(s){return e(l.Z,{key:s.title,staticClass:"ma-2",attrs:{link:"",to:"/devices/"+s.route}},[t._v(" "+t._s(s.title)+" ")])})),1):t._e(),t.showRooms?e(m.Z,{attrs:{color:"secondary lighten-4","prepend-icon":"mdi-floor-plan",value:t.app.options.expandRooms},scopedSlots:t._u([{key:"activator",fn:function(){return[e(g.V9,[t._v(t._s(t.$t("app.navigation.room")))])]},proxy:!0}],null,!1,438615151)},t._l(t.app.data.roomList,(function(s){return e(l.Z,{key:s.title,staticClass:"ma-2",attrs:{link:"",to:"/devices/"+s.route}},[t._v(" "+t._s(s.title)+" ")])})),1):t._e(),e(c.Z),e(f.Z,{key:"dashboard",attrs:{link:"",to:"/dashboard"}},[e(v.Z,[e(h.Z,[t._v("mdi-view-dashboard")])],1),e(g.km,[e(g.V9,{staticClass:"text-left"},[t._v(" "+t._s(t.$t("app.navigation.dashboard"))+" ")])],1)],1),e(c.Z),e(f.Z,{key:"system",attrs:{link:"",to:"/system"}},[e(v.Z,[e(h.Z,[t._v("mdi-tools")])],1),e(g.km,[e(g.V9,{staticClass:"text-left"},[t._v(" "+t._s(t.$t("app.navigation.system"))+" ")])],1)],1),e(c.Z),e(f.Z,[e(g.km,[e(g.oZ,[t._v(" "+t._s(t.version)+" ")])],1)],1)],1)],1),e(b.Z,[e(p.Z,{attrs:{fluid:""}},[e("Broadcaster"),e("router-view")],1)],1)],1)},_=[],Z=(s(7658),s(2202)),L=s(4437),D=s(5294),j=function(){var t=this,e=t._self._c;return e(Z.Z,{attrs:{value:t.alert,type:t.type,dense:"",text:"",outlined:""}},[e(D.Z,{attrs:{align:"center"}},[e(L.Z,[e("div",[t._v(" "+t._s(t.message)+" ")]),e("div",[t._v(" "+t._s(t.meta)+" ")])]),e(L.Z,{staticClass:"shrink"},[e(r.Z,{attrs:{icon:"",small:""},on:{click:function(e){return t.clearMessage()}}},[e(h.Z,{attrs:{color:t.type}},[t._v(" mdi-close-circle ")])],1)],1)],1)],1)},R=[],S=(s(541),{name:"BroadCaster",data:()=>({alert:!1,type:"info",types:["","error","info","info","success","warning"],message:"",meta:"",msgList:[]}),watch:{msgList(){this.msgList&&this.msgList.length>0?(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(){this.$fhem.on("message",(t=>{let e={lvl:5,msg:"no valid message received",meta:""};Object.assign(e,t),this.msgList.unshift(e)}))},methods:{clearMessage(){this.msgList.length>0&&this.msgList.splice(0,1)}}}),T=S,P=s(1001),E=(0,P.Z)(T,j,R,!1,null,null,null),F=E.exports,B={components:{Broadcaster:F},data:()=>({appBar:{color:"",drawer:null,clock:null,header:null},app:{options:{loading:!1,reloadBtn:!1,expandGroups:!1,expandRooms:!1,mobileHeaderContent:!1},session:{connect:!1},data:{roomList:[],groupList:[]}},version:"v"+s(4147).i8,status:{color:"secondary",icon:"mdi-circle",text:"unbekannt",time:""}}),computed:{showRooms(){return this.app.data.roomList.length>0},showGroups(){return this.app.data.groupList.length>0}},watch:{"app.session.connect"(t){this.status.color=t?"success":"error",this.status.text=t?"online":"offline",this.status.time=this.$fhem.getDateTime()}},mounted(){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(){location.reload(!0)},goTo(t){let e=t||"/";this.$router.currentRoute.path!=e&&this.$router.push(e)}}},N=B,I=(0,P.Z)(N,x,_,!1,null,"3b4d7587",null),H=I.exports,A=s(8345);a.ZP.use(A.ZP);const M=[{path:"/",name:"Home",component:()=>s.e(654).then(s.bind(s,3654))},{path:"/system",name:"System",component:()=>s.e(654).then(s.bind(s,3654))},{path:"/dashboard",name:"Dashboard",component:()=>s.e(654).then(s.bind(s,3654))},{path:"/devices/:filter",name:"Devices",component:()=>s.e(654).then(s.bind(s,3654))},{path:"/settings",name:"Settings",component:()=>s.e(665).then(s.bind(s,9665))},{path:"/syslog",name:"Syslog",component:()=>Promise.all([s.e(399),s.e(137),s.e(661)]).then(s.bind(s,5661))}],V=new A.ZP({mode:"hash",base:"",routes:M});var U=V,$=s(2250),q=s(1229),z=s(8103);a.ZP.use($.Z);const G={lang:{locales:{de:q.Z},current:"de"},theme:{dark:!0,themes:{dark:{primary:z.Z.grey.darken4,secondary:z.Z.grey.darken3,success:z.Z.green.accent2,accent:z.Z.green.accent2},light:{primary:z.Z.grey,secondary:z.Z.grey.lighten3,success:z.Z.green.accent3,accent:z.Z.green.accent3}}}};var J=new $.Z(G),X=s(7166),Y=s.n(X),W=s(7152);function K(){const t=s(8973),e={};return t.keys().forEach((s=>{const a=s.match(/([A-Za-z0-9-_]+)\./i);if(a&&a.length>1){const n=a[1];e[n]=t(s)}})),e}a.ZP.use(W.Z);var Q=new W.Z({locale:"de",fallbackLocale:"en",messages:K()}),tt=s(7187),et=s.n(tt);class st extends(et()){constructor(){super(),this.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:1e3,clockFormat:{hour:"2-digit",minute:"2-digit"},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,mobileHeader:null},templates:[],componentMap:[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"chart2",component:"templ_chart2"},{name:"weather",component:"templ_weather"},{name:"list",component:"templ_list"},{name:"wdtimer",component:"templ_wdtimer"},{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"},{name:"iframe",component:"templ_iframe"}],data:{roomList:[],groupList:[],deviceList:[],routeList:[],header:""},hasConnected:[]}}set loading(t){t&&this.app.options.loadCount++,!t&&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)}log(t){let e=["","mdi-alert-outline","mdi-connection","mdi-send-circle-outline","mdi-sync","mdi-hexagon-multiple-outline"],s=["","error","info","success","success","warning"],a=(new Date).toLocaleTimeString(this.app.options.lang),n=(new Date).getMilliseconds(),o={time:a+":"+("000"+n).slice(-3),msg:t.msg||"",lvl:t.lvl||5,meta:t.meta||null,icon:e[t.lvl||5],color:s[t.lvl||5]};this.app.options.logRecord&&o.lvl<=this.app.options.debugLevel&&(this.app.session.logList.unshift(o),this.app.session.logList.length>this.app.options.logBuffer&&(this.app.session.logList.length=this.app.options.logBuffer)),1==o.lvl&&(this.app.options.loadCount=0,this.app.options.loading=!1,this.emit("message",o))}getDate(t){let e=t?parseInt(t):0;return(t=>new Date(t.setDate(t.getDate()-e)).toISOString())(new Date).split("T")[0]}getWeekDay(t){let e=null;if(t){let s=/\d{2}.\d{2}.\d{4}/.exec(t);if(s&&1===s.length){let e=s[0].split(".");t=e[2]+"/"+e[1]+"/"+e[0]}e=new Date(t).toLocaleString(this.app.options.lang,{weekday:"long"})}return e}getDateTime(t){let e=t||(new Date).toISOString();return new Date(e.replace(" ","T")).toLocaleString(this.app.options.lang,{dateStyle:"short",timeStyle:"medium"}).replace(",","")}createURL(t){let e=this.app.connection,s=e.location?e.location:"",a=e.port?":"+e.port.replace(":",""):"",n=e.path?"/"+e.path.replace("/",""):"",o="";return"object"==typeof t&&t.length>0&&t.forEach((t=>{t.param&&t.value&&(o+=o?"&":"?",o+=t.param+"="+encodeURIComponent(t.value))})),s+a+n+o}getEl(t,...e){return e.reduce(((t,e)=>t&&t[e]),t)}async request(t,e,s){let a=[];"csrf"!=e&&a.push({param:"fwcsrf",value:this.app.session.csrf}),"json"!==e&&"csrf"!==e||a.push({param:"XHR",value:"1"}),"object"===typeof t&&(t.length>0?a.push(...t):a.push(t)),"string"===typeof t&&a.push({param:"cmd",value:t});let n=this.createURL(a);return this.log({lvl:3,msg:"Request: "+n}),await fetch(n).then((t=>{let a=null;return"csrf"===e&&(a=t.headers.get("x-fhem-csrftoken")),"json"===e&&(a=t.json()),a||(a=t.text()),"object"===typeof s?Object.assign(s,{data:a}):a})).catch((t=>this.log({lvl:1,msg:"Request failed "+n,meta:t.message})))}async getJsonFile(t){let e=new Headers;e.append("pragma","no-cache"),e.append("cache-control","no-cache");let s={method:"GET",headers:e},a=await fetch(t,s).then((t=>t.json())).catch((e=>this.log({lvl:1,msg:"Read Json-Data from "+t+" failed.",meta:e})));return a&&this.log({lvl:5,msg:"Json-Data parsed from "+t,meta:a}),await a}async readConfig(t){let e=await this.getJsonFile(t);if(e){for(const t of Object.keys(e))t in this.app&&Object.assign(this.app[t],e[t]);this.app.options.debugMode&&(this.app.appBar.color="pink darken-4")}else this.log({lvl:2,msg:"No Configuration File found. FHEMApp starting with default settings.",meta:this.app.options})}async createOptions(t){let e=null;if("appOptions"in t.Attributes){try{e=JSON.parse(t.Attributes.appOptions)}catch(s){this.log({lvl:1,msg:"Read `appOptions` from "+t.Name+" failed.",meta:s.message})}e&&(e.device=t.Name,e.name||(e.name=this.getEl(t,"Attributes","alias")||t.Name),e.sortby||this.app.options.ignoreFhemSortby||(e.sortby=this.getEl(t,"Attributes","sortby")||"zzz"),e.room||this.app.options.ignoreFhemRoom||(e.room=this.getEl(t,"Attributes","room")||""),e.group||this.app.options.ignoreFhemGroup||(e.group=this.getEl(t,"Attributes","group")||""),"hidden"===e.room&&(e.room=""),"hidden"===e.group&&(e.group=""),e.sortby||(e.sortby="zzz"),e.setup||(e.setup={}),e.show=!0,e.status={level:null,color:null,isActive:!0,error:null},e.info={left1Icon:null,left1IconColor:null,left1Text:null,left2Icon:null,left2IconColor:null,left2Text:null,mid1Icon:null,mid1IconColor:null,mid1Text:null,mid2Icon:null,mid2IconColor:null,mid2Text:null,right1Icon:null,right1IconColor:null,right1Text:null,right2Icon:null,right2IconColor:null,right2Text:null})}return await e}createRoutes(t,e){let s=this.app.data.routeList.map((t=>t.route)).indexOf(e);-1!=s?this.app.data.routeList[s].deviceList.push(t.device):this.app.data.routeList.push({route:e,deviceList:[t.device]})}createNaviItems(t,e,s){let a=t[s].split(",");for(const n of a){let a=s+"="+n;-1==e.map((t=>t.title)).indexOf(n)&&e.push({title:n,route:a}),this.createRoutes(t,a)}}async getTemplate(t){if(-1==this.app.componentMap.map((t=>t.name)).indexOf(t.template)&&-1==this.app.templates.map((t=>t.name)).indexOf(t.template))return await this.getJsonFile("./cfg/templ_"+t.template+".json")}async loadStructure(){let t=await this.request({param:"cmd",value:"jsonList2 appOptions!= appOptions room group"},"json");if(t&&t.Results.length>0){let e=[],s=[];this.app.data.routeList.splice(0);for(const a of t.Results){let t=await this.createOptions(a);if(t.template){let a=await this.getTemplate(t);a&&this.app.templates.push(a),t.room&&this.createNaviItems(t,e,"room"),t.group&&this.createNaviItems(t,s,"group"),t.home&&this.createRoutes(t,"/"),t.dashboard&&this.createRoutes(t,"/dashboard"),t.system&&this.createRoutes(t,"/system")}}e.sort(((t,e)=>t.title>e.title?1:e.title>t.title?-1:0)),s.sort(((t,e)=>t.title>e.title?1:e.title>t.title?-1:0)),this.app.data.roomList=Object.assign([],e),this.app.data.groupList=Object.assign([],s),this.app.session.ready=!0,this.loading=!1}}async createConnected(t){let e={},s=this.app.hasConnected.indexOf(t.Name);if(-1==s){if(this.app.hasConnected.push(t.Name),"connected"in t.Options){let s=Object.keys(t.Options.connected);for(const a of s){let s=await this.request({param:"cmd",value:"jsonlist2 "+t.Options.connected[a]},"json");if(s&&1==s.Results.length){"PossibleSets"in s.Results[0]&&delete s.Results[0].PossibleSets,"PossibleAttrs"in s.Results[0]&&delete s.Results[0].PossibleAttrs;let t=await this.createOptions(s.Results[0]);t&&(s.Results[0].Options=t),t&&s.Results[0].Options.connected&&(s.Results[0].Connected=await this.createConnected(s.Results[0])),s.Results[0].Options&&this.handleTemplate(s.Results[0]),e[a]=s.Results[0]}}}}else this.log({lvl:1,msg:"FHEM Device "+t.Name+" is defined as connected device, witch is called from himself. ",meta:t});return e}getSetup(t){let e=this.app.templates.map((t=>t.name)).indexOf(t);if(-1!=e){let t=this.app.templates[e],s={};return t.status&&Object.assign(s,{status:t.status}),t.main&&Object.assign(s,{main:t.main}),t.info&&Object.assign(s,{info:t.info}),t.show&&Object.assign(s,{show:t.show}),s.size=t.size||"col-12 col-sm-6 col-md-4 col-lg-4",s.expand=t.expand||!1,s.expanded=t.expanded||!1,s}this.log({lvl:1,msg:"Template Definition "+t+" not found."})}getComponent(t){let e={component:"templ_default"},s=this.app.componentMap.map((t=>t.name)).indexOf(t);if(-1!=s){let t=this.app.componentMap[s].component;t&&(e.component=t)}return e}async getDevices(t){let e=this.app.data.routeList.map((t=>t.route)).indexOf(t);if(this.app.data.deviceList.splice(0),this.app.hasConnected=[],-1!=e||t.match("device=")){let s=-1!=e?this.app.data.routeList[e].deviceList.join(","):t.replace("device=","").split("&")[0];if(s){this.loading=!0;let t=await this.request({param:"cmd",value:"jsonlist2 "+s},"json"),e=[],a=1;for(const s of t.Results){"PossibleSets"in s&&delete s.PossibleSets,"PossibleAttrs"in s&&delete s.PossibleAttrs;let n=await this.createOptions(s),o=this.getComponent(n.template);if(Object.assign(n,o),"templ_default"===n.component){let t=await this.getSetup(n.template);n.setup&&Object.assign(t,n.setup),n.setup=t}s.Options=n,s.Options.connected&&(s.Connected=await this.createConnected(s)),this.handleTemplate(s),e.push(s),a===t.Results.length&&(e.sort(((t,e)=>t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0)),this.app.data.deviceList=Object.assign([],e),this.loading=!1),a++}}}}async checkUpdate(){let t=await this.request([{param:"cmd",value:"update check"},{param:"XHR",value:"1"}]),e=0;if(t){let s=t.split("\n").splice(2);for(const t of s)t.match("UPD")&&!t.match("excluded")&&e++}return e>0}handleLogData(t,e){let s=t.split("\n");s.length>3&&s.splice(-3,3);let a=[],n=s.length>this.app.options.maxChartPoints?parseInt(s.length/this.app.options.maxChartPoints):1,o=n,i=null,r=null,l=1,p=null;for(const c of s){let t=c.split(" "),h=Date.parse(t[0].replace("_","T")),d=new Date(h),u=null,m=parseFloat(t[1]);e?(/-min/.test(e)&&(i>m||!i)&&(i=m),/-max/.test(e)&&ip||l===s.length)&&(a.push({timestamp:p,value:i}),i=null,r=null,p=u)):(i+=m,(l>=o||l===s.length)&&(l===s.length&&(n-=o-l),a.push({timestamp:h,value:i/n}),o+=n,i=0)),l++}return this.log({lvl:5,msg:"handle Chartdata (Lines: "+s.length+")"}),a}async readLogData(t){let e=[];if(this.loading=!0,t.defs&&t.defs.length>0){let s=0;for(const a of t.defs){let n=/\(.*\)/.exec(a),o=n?a.replace(n[0],"_").split(":"):a.split(":"),i="get ";i+=o[0]?o[0]:t.deviceName,i+=t.from?" - - "+t.from:"",i+=t.to?" "+t.to:"",i+=n?" "+n[0].replace(/\(|\)/g,""):" 4:"+o[1];let r=await this.request([{param:"cmd",value:i},{param:"XHR",value:"1"}],"text",{id:s}),l=o[11]?o[11]:null;r&&e.push({id:r.id,data:this.handleLogData(await r.data,l)}),s++}}return this.loading=!1,Object.assign(t,{data:e})}replaceVals(t,e,s){let a=/-?[0-9]/.exec(e),n=[];for(var o=2;o1?r+"Tage ":r>0?r+"Tag ":"";c+=l>0?l+"h ":"",c+=p>0?p+"min":"",i=t[o].replace("%a",c)}if(/%n/.test(t[o])&&a){/%n.[0-9]/.test(t[o])||(t[o]=t[o].replace("%n","%n.0"));let s=/%n../.exec(t[o]),n=s[0].replace("%n.","");i=t[o].replace(s[0],parseFloat(e.slice(a.index)).toLocaleString(this.app.options.lang,{minimumFractionDigits:n,maximumFractionDigits:n}))}if(/%i/.test(t[o])&&a){let s=parseFloat(t[o].split("%i")[1]);if("isNaN"!=s){let n=s.toString().split(".")[1]||"",r=n.length,l=parseFloat(e.slice(a.index))+s;i=t[o].replace("%i"+s,l.toFixed(r))}}i=i.replace(/:/g,":"),n.push(i)}return n}handleVals(t,e){let s=[];if("string"===typeof e&&(s=[e]),"object"===typeof t&&"object"===typeof e&&e.length>0)for(const a of e){let e=a.split(":");if(e.length>2){let a=/\./.test(e[0])?e[0].split("."):["Readings",e[0],"Value"],n=this.getEl(t,...a)||this.getEl(t,"Readings",e[0],"Value");if(n){let a=!1,o=parseFloat(e[1]);if(isNaN(o))RegExp(e[1]?e[1]:".").test(n)&&(a=!0);else{let t=/-?[0-9]/.exec(n);-1!=t.index&&parseFloat(n.slice(t.index))>=o&&(a=!0)}if(a){s=this.replaceVals(e,n,t.Name);break}}}}return s}handleTemplate(t){let e=this.getEl(t,"Options","setup","show"),s=this.getEl(t,"Options","setup","status","bar"),a=this.getEl(t,"Options","setup","status","error"),n=this.getEl(t,"Options","setup","info");if(e){let s=this.handleVals(t,e);t.Options.show="false"!==s[0],s[1]&&(t.Options.setup.size=s[1]),s[2]&&(t.Options.sortby=s[2])}if(s){let e=this.getEl(t,"Options","setup","status","min")||0,a=this.getEl(t,"Options","setup","status","max")||100,n=this.handleVals(t,s),o=100/(a-e),i=(n[0]||"0"-e)*o;t.Options.status.level=n[2]?100-i:i,t.Options.status.color=n[1]||"success"}if(a){let e=this.handleVals(t,a);e.length>0?(t.Options.status.level=e[0]||"100",t.Options.status.color=e[1]||"error",t.Options.status.error=e[2]||"Fehler",t.Options.status.isActive=!1):t.Options.status.isActive=!0}if(n){let e=this.handleVals(t,n.left1),s=this.handleVals(t,n.left2),a=this.handleVals(t,n.mid1),o=this.handleVals(t,n.mid2),i=this.handleVals(t,n.right1),r=this.handleVals(t,n.right2);t.Options.info.left1IconColor=e[2]||"",t.Options.info.left1Icon=e[1]||"",t.Options.info.left1Text=e[0]||"",t.Options.info.left2IconColor=s[2]||"",t.Options.info.left2Icon=s[1]||"",t.Options.info.left2Text=s[0]||"",t.Options.info.mid1IconColor=a[2]||"",t.Options.info.mid1Icon=a[1]||"",t.Options.info.mid1Text=a[0]||"",t.Options.info.mid2IconColor=o[2]||"",t.Options.info.mid2Icon=o[1]||"",t.Options.info.mid2Text=o[0]||"",t.Options.info.right1IconColor=i[2]||"",t.Options.info.right1Icon=i[1]||"",t.Options.info.right1Text=i[0]||"",t.Options.info.right2IconColor=r[2]||"",t.Options.info.right2Icon=r[1]||"",t.Options.info.right2Text=r[0]||""}}handleData(t){let e=JSON.parse(t),s=null;if(!e[2].match("0){let t=this.handleData(s);if(t){let e=0;for(const s of this.app.data.deviceList){let a=this.app.data.deviceList[e],n=Object.assign({},a);if(s.Name===t.Name&&("Readings"===t.devicePart&&this.getEl(n,"Readings",t.param,t.paramPart)&&(n.Readings[t.param][t.paramPart]=t.value),"Attributes"===t.devicePart&&this.getEl(n,"Attributes",t.param)&&(n.Attributes[t.param]=t.value),this.handleTemplate(n),this.app.data.deviceList.splice(e,1,n),this.app.data.deviceList.sort(((t,e)=>t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0))),"Connected"in s){let a=0;for(const o of Object.values(s.Connected)){if(o.Name===t.Name){let o=Object.keys(s.Connected)[a];"Readings"===t.devicePart&&this.getEl(n.Connected[o],"Readings",t.param,t.paramPart)&&(n.Connected[o].Readings[t.param][t.paramPart]=t.value),"Attributes"===t.devicePart&&this.getEl(n.Connected[o],"Attributes",t.param)&&(n.Connected[o].Attributes[t.param]=t.value),this.handleTemplate(n),this.app.data.deviceList.splice(e,1,n),this.app.data.deviceList.sort(((t,e)=>t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0))}a++}}e++}}}}async connOpen(){this.app.session.connect=!0,this.app.session.restartCnt=0,this.log({lvl:2,msg:"Connection with FHEM is opened.",meta:this.app.connection}),this.app.session.csrf=await this.request({},"csrf"),this.log({lvl:2,msg:"Crsf-Token received.",meta:{token:this.app.session.csrf}}),this.loadStructure()}async connClose(t){if(this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.ready=!1,this.app.conn=null,!this.app.session.restart){let e=0==this.app.session.restartCnt?1:3e3;this.app.session.restart=!0,setTimeout((()=>{this.app.session.restart=!1,this.app.session.restartCnt++,this.connStart()}),e);let s={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 "+e/1e3+" seconds...",meta:s}),this.loading=!1}}async connStart(){let t=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],e=this.createURL(t);"websocket"===this.app.connection.type?(this.app.conn=new WebSocket(e.replace(/^http/i,"ws")),this.app.conn.onopen=()=>this.connOpen(),this.app.conn.onmessage=t=>this.doUpdate(t),this.app.conn.onclose=()=>this.connClose(),this.app.conn.onerror=t=>this.connClose(t)):(this.app.conn=new XMLHttpRequest,this.app.conn.open("GET",e,!0),this.app.conn.onreadystatechange=()=>{200===this.app.conn.status&&2===this.app.conn.readyState&&this.connOpen(),200===this.app.conn.status&&3===this.app.conn.readyState&&this.doUpdate()},this.app.conn.onerror=t=>this.connClose(t),this.app.conn.send())}setClock(){let t=new Date;this.app.appBar.clock=t.toLocaleString(this.app.options.lang,this.app.options.clockFormat),this.app.appBar.header=t.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"clock"===this.app.options.mobileHeaderContent&&(this.app.appBar.mobileHeader=t.toLocaleString(this.app.options.lang,this.app.options.clockFormat)),"date"===this.app.options.mobileHeaderContent&&(this.app.appBar.mobileHeader=t.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}async init(t,e){this.getWeekDay("2022-04-06 08:37:29"),this.log({lvl:2,msg:"Starting FHEMApp..."}),this.loading=!0,await this.readConfig("./cfg/config.json"),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)),e&&this.app.options.lang&&(e.locale=this.app.options.lang),this.setClock(),setInterval((()=>this.setClock()),this.app.options.clockInterval)}}var at={install(t,e,s){t.prototype.$fhem=new st,t.prototype.$fhem.init(e,s)}};a.ZP.use(at,J,Q),a.ZP.use(Y()),a.ZP.component("apex-chart",Y()),a.ZP.config.productionTip=!1,new a.ZP({vuetify:J,router:U,i18n:Q,render:t=>t(H)}).$mount("#app")},8973:function(t,e,s){var a={"./de.json":9929,"./en.json":790};function n(t){var e=o(t);return s(e)}function o(t){if(!s.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}n.keys=function(){return Object.keys(a)},n.resolve=o,t.exports=n,n.id=8973},2862:function(t,e,s){"use strict";t.exports=s.p+"img/FHEM_Logo.a2a7fc8d.png"},4147:function(t){"use strict";t.exports={i8:"3.36.1"}},9929:function(t){"use strict";t.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Gruppen","room":"Bereiche","dashboard":"Dashboard","system":"System"},"dates":{"from":"von","to":"bis","range":"Zeitraum"}},"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"}}}}')},790:function(t){"use strict";t.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Groups","room":"Area","dashboard":"Dashboard","system":"System"},"dates":{"from":"From","to":"To","range":"Daterange"}},"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"}}}}')}},e={};function s(a){var n=e[a];if(void 0!==n)return n.exports;var o=e[a]={exports:{}};return t[a].call(o.exports,o,o.exports,s),o.exports}s.m=t,function(){var t=[];s.O=function(e,a,n,o){if(!a){var i=1/0;for(c=0;c=o)&&Object.keys(s.O).every((function(t){return s.O[t](a[l])}))?a.splice(l--,1):(r=!1,o0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[a,n,o]}}(),function(){s.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return s.d(e,{a:e}),e}}(),function(){s.d=function(t,e){for(var a in e)s.o(e,a)&&!s.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}}(),function(){s.f={},s.e=function(t){return Promise.all(Object.keys(s.f).reduce((function(e,a){return s.f[a](t,e),e}),[]))}}(),function(){s.u=function(t){return"js/"+t+"."+{4:"56e77bea",32:"356eff7f",137:"56d91d2a",270:"25da2e0b",399:"4058331d",445:"4fb7dc80",454:"1ebe9cbf",570:"203e3c7a",590:"4024bd68",592:"37807531",609:"352726ea",630:"b4397fa0",651:"11a77b53",654:"9f84969d",661:"294db997",665:"98d4ea68",705:"5f0492aa",838:"c296a3eb",994:"3ff835bb",999:"db98e2bf"}[t]+".js"}}(),function(){s.miniCssF=function(t){return"css/"+t+"."+{4:"570a1df0",32:"853e6840",137:"1284c544",445:"8b1f0757",570:"57253e28",590:"57098c94",592:"853e6840",609:"7dde73af",630:"b7f1b37d",651:"57253e28",661:"80f62a8a",705:"853e6840",838:"57098c94",994:"853e6840",999:"d256501f"}[t]+".css"}}(),function(){s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){var t={},e="fhemapp:";s.l=function(a,n,o,i){if(t[a])t[a].push(n);else{var r,l;if(void 0!==o)for(var p=document.getElementsByTagName("script"),c=0;c({alert:!1,type:"info",types:["","error","info","info","success","warning"],message:"",meta:"",msgList:[]}),watch:{msgList(){this.msgList&&this.msgList.length>0?(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(){this.$fhem.on("message",(t=>{let e={lvl:5,msg:"no valid message received",meta:""};Object.assign(e,t),this.msgList.unshift(e)}))},methods:{clearMessage(){this.msgList.length>0&&this.msgList.splice(0,1)}}}),T=S,P=s(1001),E=(0,P.Z)(T,j,R,!1,null,null,null),F=E.exports,B={components:{Broadcaster:F},data:()=>({appBar:{color:"",drawer:null,clock:null,header:null},app:{options:{loading:!1,reloadBtn:!1,expandGroups:!1,expandRooms:!1,mobileHeaderContent:!1},session:{connect:!1},data:{roomList:[],groupList:[]}},version:"v"+s(4147).i8,status:{color:"secondary",icon:"mdi-circle",text:"unbekannt",time:""}}),computed:{showRooms(){return this.app.data.roomList.length>0},showGroups(){return this.app.data.groupList.length>0}},watch:{"app.session.connect"(t){this.status.color=t?"success":"error",this.status.text=t?"online":"offline",this.status.time=this.$fhem.getDateTime()}},mounted(){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(){location.reload(!0)},goTo(t){let e=t||"/";this.$router.currentRoute.path!=e&&this.$router.push(e)}}},N=B,I=(0,P.Z)(N,x,_,!1,null,"3b4d7587",null),H=I.exports,A=s(8345);a.ZP.use(A.ZP);const M=[{path:"/",name:"Home",component:()=>s.e(654).then(s.bind(s,3654))},{path:"/system",name:"System",component:()=>s.e(654).then(s.bind(s,3654))},{path:"/dashboard",name:"Dashboard",component:()=>s.e(654).then(s.bind(s,3654))},{path:"/devices/:filter",name:"Devices",component:()=>s.e(654).then(s.bind(s,3654))},{path:"/settings",name:"Settings",component:()=>s.e(665).then(s.bind(s,9665))},{path:"/syslog",name:"Syslog",component:()=>Promise.all([s.e(399),s.e(137),s.e(661)]).then(s.bind(s,5661))}],V=new A.ZP({mode:"hash",base:"",routes:M});var U=V,$=s(2250),q=s(1229),z=s(8103);a.ZP.use($.Z);const G={lang:{locales:{de:q.Z},current:"de"},theme:{dark:!0,themes:{dark:{primary:z.Z.grey.darken4,secondary:z.Z.grey.darken3,success:z.Z.green.accent2,accent:z.Z.green.accent2},light:{primary:z.Z.grey,secondary:z.Z.grey.lighten3,success:z.Z.green.accent3,accent:z.Z.green.accent3}}}};var J=new $.Z(G),X=s(7166),Y=s.n(X),W=s(7152);function K(){const t=s(8973),e={};return t.keys().forEach((s=>{const a=s.match(/([A-Za-z0-9-_]+)\./i);if(a&&a.length>1){const n=a[1];e[n]=t(s)}})),e}a.ZP.use(W.Z);var Q=new W.Z({locale:"de",fallbackLocale:"en",messages:K()}),tt=s(7187),et=s.n(tt);class st extends(et()){constructor(){super(),this.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:1e3,clockFormat:{hour:"2-digit",minute:"2-digit"},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,mobileHeader:null},templates:[],componentMap:[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"chart2",component:"templ_chart2"},{name:"weather",component:"templ_weather"},{name:"list",component:"templ_list"},{name:"wdtimer",component:"templ_wdtimer"},{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"},{name:"iframe",component:"templ_iframe"}],data:{roomList:[],groupList:[],deviceList:[],routeList:[],header:""},hasConnected:[]}}set loading(t){t&&this.app.options.loadCount++,!t&&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)}log(t){let e=["","mdi-alert-outline","mdi-connection","mdi-send-circle-outline","mdi-sync","mdi-hexagon-multiple-outline"],s=["","error","info","success","success","warning"],a=(new Date).toLocaleTimeString(this.app.options.lang),n=(new Date).getMilliseconds(),o={time:a+":"+("000"+n).slice(-3),msg:t.msg||"",lvl:t.lvl||5,meta:t.meta||null,icon:e[t.lvl||5],color:s[t.lvl||5]};this.app.options.logRecord&&o.lvl<=this.app.options.debugLevel&&(this.app.session.logList.unshift(o),this.app.session.logList.length>this.app.options.logBuffer&&(this.app.session.logList.length=this.app.options.logBuffer)),1==o.lvl&&(this.app.options.loadCount=0,this.app.options.loading=!1,this.emit("message",o))}getDate(t){let e=t?parseInt(t):0;return(t=>new Date(t.setDate(t.getDate()-e)).toISOString())(new Date).split("T")[0]}getWeekDay(t){let e=null;if(t){let s=/\d{2}.\d{2}.\d{4}/.exec(t);if(s&&1===s.length){let e=s[0].split(".");t=e[2]+"/"+e[1]+"/"+e[0]}e=new Date(t).toLocaleString(this.app.options.lang,{weekday:"long"})}return e}getDateTime(t){let e=t||(new Date).toISOString();return new Date(e.replace(" ","T")).toLocaleString(this.app.options.lang,{dateStyle:"short",timeStyle:"medium"}).replace(",","")}createURL(t){let e=this.app.connection,s=e.location?e.location:"",a=e.port?":"+e.port.replace(":",""):"",n=e.path?"/"+e.path.replace("/",""):"",o="";return"object"==typeof t&&t.length>0&&t.forEach((t=>{t.param&&t.value&&(o+=o?"&":"?",o+=t.param+"="+encodeURIComponent(t.value))})),s+a+n+o}getEl(t,...e){return e.reduce(((t,e)=>t&&t[e]),t)}async request(t,e,s){let a=[];"csrf"!=e&&a.push({param:"fwcsrf",value:this.app.session.csrf}),"json"!==e&&"csrf"!==e||a.push({param:"XHR",value:"1"}),"object"===typeof t&&(t.length>0?a.push(...t):a.push(t)),"string"===typeof t&&a.push({param:"cmd",value:t});let n=this.createURL(a);return this.log({lvl:3,msg:"Request: "+n}),await fetch(n).then((t=>{let a=null;return"csrf"===e&&(a=t.headers.get("x-fhem-csrftoken")),"json"===e&&(a=t.json()),a||(a=t.text()),"object"===typeof s?Object.assign(s,{data:a}):a})).catch((t=>this.log({lvl:1,msg:"Request failed "+n,meta:t.message})))}async getJsonFile(t){let e=new Headers;e.append("pragma","no-cache"),e.append("cache-control","no-cache");let s={method:"GET",headers:e},a=await fetch(t,s).then((t=>t.json())).catch((e=>this.log({lvl:1,msg:"Read Json-Data from "+t+" failed.",meta:e})));return a&&this.log({lvl:5,msg:"Json-Data parsed from "+t,meta:a}),await a}async readConfig(t){let e=await this.getJsonFile(t);if(e){for(const t of Object.keys(e))t in this.app&&Object.assign(this.app[t],e[t]);this.app.options.debugMode&&(this.app.appBar.color="pink darken-4")}else this.log({lvl:2,msg:"No Configuration File found. FHEMApp starting with default settings.",meta:this.app.options})}async createOptions(t){let e=null;if("appOptions"in t.Attributes){try{e=JSON.parse(t.Attributes.appOptions)}catch(s){this.log({lvl:1,msg:"Read `appOptions` from "+t.Name+" failed.",meta:s.message})}e&&(e.device=t.Name,e.name||(e.name=this.getEl(t,"Attributes","alias")||t.Name),e.sortby||this.app.options.ignoreFhemSortby||(e.sortby=this.getEl(t,"Attributes","sortby")||"zzz"),e.room||this.app.options.ignoreFhemRoom||(e.room=this.getEl(t,"Attributes","room")||""),e.group||this.app.options.ignoreFhemGroup||(e.group=this.getEl(t,"Attributes","group")||""),"hidden"===e.room&&(e.room=""),"hidden"===e.group&&(e.group=""),e.sortby||(e.sortby="zzz"),e.setup||(e.setup={}),e.show=!0,e.status={level:null,color:null,isActive:!0,error:null},e.info={left1Icon:null,left1IconColor:null,left1Text:null,left2Icon:null,left2IconColor:null,left2Text:null,mid1Icon:null,mid1IconColor:null,mid1Text:null,mid2Icon:null,mid2IconColor:null,mid2Text:null,right1Icon:null,right1IconColor:null,right1Text:null,right2Icon:null,right2IconColor:null,right2Text:null})}return await e}createRoutes(t,e){let s=this.app.data.routeList.map((t=>t.route)).indexOf(e);-1!=s?this.app.data.routeList[s].deviceList.push(t.device):this.app.data.routeList.push({route:e,deviceList:[t.device]})}createNaviItems(t,e,s){let a=t[s].split(",");for(const n of a){let a=s+"="+n;-1==e.map((t=>t.title)).indexOf(n)&&e.push({title:n,route:a}),this.createRoutes(t,a)}}async getTemplate(t){if(-1==this.app.componentMap.map((t=>t.name)).indexOf(t.template)&&-1==this.app.templates.map((t=>t.name)).indexOf(t.template))return await this.getJsonFile("./cfg/templ_"+t.template+".json")}async loadStructure(){let t=await this.request({param:"cmd",value:"jsonList2 appOptions!= appOptions room group"},"json");if(t&&t.Results.length>0){let e=[],s=[];this.app.data.routeList.splice(0);for(const a of t.Results){let t=await this.createOptions(a);if(t.template){let a=await this.getTemplate(t);a&&this.app.templates.push(a),t.room&&this.createNaviItems(t,e,"room"),t.group&&this.createNaviItems(t,s,"group"),t.home&&this.createRoutes(t,"/"),t.dashboard&&this.createRoutes(t,"/dashboard"),t.system&&this.createRoutes(t,"/system")}}e.sort(((t,e)=>t.title>e.title?1:e.title>t.title?-1:0)),s.sort(((t,e)=>t.title>e.title?1:e.title>t.title?-1:0)),this.app.data.roomList=Object.assign([],e),this.app.data.groupList=Object.assign([],s),this.app.session.ready=!0,this.loading=!1}}async createConnected(t){let e={},s=this.app.hasConnected.indexOf(t.Name);if(-1==s){if(this.app.hasConnected.push(t.Name),"connected"in t.Options){let s=Object.keys(t.Options.connected);for(const a of s){let s=await this.request({param:"cmd",value:"jsonlist2 "+t.Options.connected[a]},"json");if(s&&1==s.Results.length){"PossibleSets"in s.Results[0]&&delete s.Results[0].PossibleSets,"PossibleAttrs"in s.Results[0]&&delete s.Results[0].PossibleAttrs;let t=await this.createOptions(s.Results[0]);t&&(s.Results[0].Options=t),t&&s.Results[0].Options.connected&&(s.Results[0].Connected=await this.createConnected(s.Results[0])),s.Results[0].Options&&this.handleTemplate(s.Results[0]),e[a]=s.Results[0]}}}}else this.log({lvl:1,msg:"FHEM Device "+t.Name+" is defined as connected device, witch is called from himself. ",meta:t});return e}getSetup(t){let e=this.app.templates.map((t=>t.name)).indexOf(t);if(-1!=e){let t=this.app.templates[e],s={};return t.status&&Object.assign(s,{status:t.status}),t.main&&Object.assign(s,{main:t.main}),t.info&&Object.assign(s,{info:t.info}),t.show&&Object.assign(s,{show:t.show}),s.size=t.size||"col-12 col-sm-6 col-md-4 col-lg-4",s.expand=t.expand||!1,s.expanded=t.expanded||!1,s}this.log({lvl:1,msg:"Template Definition "+t+" not found."})}getComponent(t){let e={component:"templ_default"},s=this.app.componentMap.map((t=>t.name)).indexOf(t);if(-1!=s){let t=this.app.componentMap[s].component;t&&(e.component=t)}return e}async getDevices(t){let e=this.app.data.routeList.map((t=>t.route)).indexOf(t);if(this.app.data.deviceList.splice(0),this.app.hasConnected=[],-1!=e||t.match("device=")){let s=-1!=e?this.app.data.routeList[e].deviceList.join(","):t.replace("device=","").split("&")[0];if(s){this.loading=!0;let t=await this.request({param:"cmd",value:"jsonlist2 "+s},"json"),e=[],a=1;for(const s of t.Results){"PossibleSets"in s&&delete s.PossibleSets,"PossibleAttrs"in s&&delete s.PossibleAttrs;let n=await this.createOptions(s),o=this.getComponent(n.template);if(Object.assign(n,o),"templ_default"===n.component){let t=await this.getSetup(n.template);n.setup&&Object.assign(t,n.setup),n.setup=t}s.Options=n,s.Options.connected&&(s.Connected=await this.createConnected(s)),this.handleTemplate(s),e.push(s),a===t.Results.length&&(e.sort(((t,e)=>t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0)),this.app.data.deviceList=Object.assign([],e),this.loading=!1),a++}}}}async checkUpdate(){let t=await this.request([{param:"cmd",value:"update check"},{param:"XHR",value:"1"}]),e=0;if(t){let s=t.split("\n").splice(2);for(const t of s)t.match("UPD")&&!t.match("excluded")&&e++}return e>0}handleLogData(t,e){let s=t.split("\n");s.length>3&&s.splice(-3,3);let a=[],n=s.length>this.app.options.maxChartPoints?parseInt(s.length/this.app.options.maxChartPoints):1,o=n,i=null,r=null,l=1,p=null;for(const c of s){let t=c.split(" "),h=Date.parse(t[0].replace("_","T")),d=new Date(h),u=null,m=parseFloat(t[1]);e?(/-min/.test(e)&&(i>m||!i)&&(i=m),/-max/.test(e)&&ip||l===s.length)&&(a.push({timestamp:p,value:i}),i=null,r=null,p=u)):(i+=m,(l>=o||l===s.length)&&(l===s.length&&(n-=o-l),a.push({timestamp:h,value:i/n}),o+=n,i=0)),l++}return this.log({lvl:5,msg:"handle Chartdata (Lines: "+s.length+")"}),a}async readLogData(t){let e=[];if(this.loading=!0,t.defs&&t.defs.length>0){let s=0;for(const a of t.defs){let n=/\(.*\)/.exec(a),o=n?a.replace(n[0],"_").split(":"):a.split(":"),i="get ";i+=o[0]?o[0]:t.deviceName,i+=t.from?" - - "+t.from:"",i+=t.to?" "+t.to:"",i+=n?" "+n[0].replace(/\(|\)/g,""):" 4:"+o[1];let r=await this.request([{param:"cmd",value:i},{param:"XHR",value:"1"}],"text",{id:s}),l=o[11]?o[11]:null;r&&e.push({id:r.id,data:this.handleLogData(await r.data,l)}),s++}}return this.loading=!1,Object.assign(t,{data:e})}replaceVals(t,e,s){let a=/-?[0-9]/.exec(e),n=[];for(var o=2;o1?r+"Tage ":r>0?r+"Tag ":"";c+=l>0?l+"h ":"",c+=p>0?p+"min":"",i=t[o].replace("%a",c)}if(/%n/.test(t[o])&&a){/%n.[0-9]/.test(t[o])||(t[o]=t[o].replace("%n","%n.0"));let s=/%n../.exec(t[o]),n=s[0].replace("%n.","");i=t[o].replace(s[0],parseFloat(e.slice(a.index)).toLocaleString(this.app.options.lang,{minimumFractionDigits:n,maximumFractionDigits:n}))}if(/%i/.test(t[o])&&a){let s=parseFloat(t[o].split("%i")[1]);if("isNaN"!=s){let n=s.toString().split(".")[1]||"",r=n.length,l=parseFloat(e.slice(a.index))+s;i=t[o].replace("%i"+s,l.toFixed(r))}}i=i.replace(/:/g,":"),n.push(i)}return n}handleVals(t,e){let s=[];if("string"===typeof e&&(s=[e]),"object"===typeof t&&"object"===typeof e&&e.length>0)for(const a of e){let e=a.split(":");if(e.length>2){let a=/\./.test(e[0])?e[0].split("."):["Readings",e[0],"Value"],n=this.getEl(t,...a)||this.getEl(t,"Readings",e[0],"Value");if(n){let a=!1,o=parseFloat(e[1]);if(isNaN(o))RegExp(e[1]?e[1]:".").test(n)&&(a=!0);else{let t=/-?[0-9]/.exec(n);-1!=t.index&&parseFloat(n.slice(t.index))>=o&&(a=!0)}if(a){s=this.replaceVals(e,n,t.Name);break}}}}return s}handleTemplate(t){let e=this.getEl(t,"Options","setup","show"),s=this.getEl(t,"Options","setup","status","bar"),a=this.getEl(t,"Options","setup","status","error"),n=this.getEl(t,"Options","setup","info");if(e){let s=this.handleVals(t,e);t.Options.show="false"!==s[0],s[1]&&(t.Options.setup.size=s[1]),s[2]&&(t.Options.sortby=s[2])}if(s){let e=this.getEl(t,"Options","setup","status","min")||0,a=this.getEl(t,"Options","setup","status","max")||100,n=this.handleVals(t,s),o=100/(a-e),i=(n[0]||"0"-e)*o;t.Options.status.level=n[2]?100-i:i,t.Options.status.color=n[1]||"success"}if(a){let e=this.handleVals(t,a);e.length>0?(t.Options.status.level=e[0]||"100",t.Options.status.color=e[1]||"error",t.Options.status.error=e[2]||"Fehler",t.Options.status.isActive=!1):t.Options.status.isActive=!0}if(n){let e=this.handleVals(t,n.left1),s=this.handleVals(t,n.left2),a=this.handleVals(t,n.mid1),o=this.handleVals(t,n.mid2),i=this.handleVals(t,n.right1),r=this.handleVals(t,n.right2);t.Options.info.left1IconColor=e[2]||"",t.Options.info.left1Icon=e[1]||"",t.Options.info.left1Text=e[0]||"",t.Options.info.left2IconColor=s[2]||"",t.Options.info.left2Icon=s[1]||"",t.Options.info.left2Text=s[0]||"",t.Options.info.mid1IconColor=a[2]||"",t.Options.info.mid1Icon=a[1]||"",t.Options.info.mid1Text=a[0]||"",t.Options.info.mid2IconColor=o[2]||"",t.Options.info.mid2Icon=o[1]||"",t.Options.info.mid2Text=o[0]||"",t.Options.info.right1IconColor=i[2]||"",t.Options.info.right1Icon=i[1]||"",t.Options.info.right1Text=i[0]||"",t.Options.info.right2IconColor=r[2]||"",t.Options.info.right2Icon=r[1]||"",t.Options.info.right2Text=r[0]||""}}handleData(t){let e=JSON.parse(t),s=null;if(!e[2].match("0){let t=this.handleData(s);if(t){let e=0;for(const s of this.app.data.deviceList){let a=this.app.data.deviceList[e],n=Object.assign({},a);if(s.Name===t.Name&&("Readings"===t.devicePart&&this.getEl(n,"Readings",t.param,t.paramPart)&&(n.Readings[t.param][t.paramPart]=t.value),"Attributes"===t.devicePart&&this.getEl(n,"Attributes",t.param)&&(n.Attributes[t.param]=t.value),this.handleTemplate(n),this.app.data.deviceList.splice(e,1,n),this.app.data.deviceList.sort(((t,e)=>t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0))),"Connected"in s){let a=0;for(const o of Object.values(s.Connected)){if(o.Name===t.Name){let o=Object.keys(s.Connected)[a];"Readings"===t.devicePart&&this.getEl(n.Connected[o],"Readings",t.param,t.paramPart)&&(n.Connected[o].Readings[t.param][t.paramPart]=t.value),"Attributes"===t.devicePart&&this.getEl(n.Connected[o],"Attributes",t.param)&&(n.Connected[o].Attributes[t.param]=t.value),this.handleTemplate(n),this.app.data.deviceList.splice(e,1,n),this.app.data.deviceList.sort(((t,e)=>t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0))}a++}}e++}}}}async connOpen(){this.app.session.connect=!0,this.app.session.restartCnt=0,this.log({lvl:2,msg:"Connection with FHEM is opened.",meta:this.app.connection}),this.app.session.csrf=await this.request({},"csrf"),this.log({lvl:2,msg:"Crsf-Token received.",meta:{token:this.app.session.csrf}}),this.loadStructure()}async connClose(t){if(this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.ready=!1,this.app.conn=null,!this.app.session.restart){let e=0==this.app.session.restartCnt?1:3e3;this.app.session.restart=!0,setTimeout((()=>{this.app.session.restart=!1,this.app.session.restartCnt++,this.connStart()}),e);let s={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 "+e/1e3+" seconds...",meta:s}),this.loading=!1}}async connStart(){let t=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],e=this.createURL(t);"websocket"===this.app.connection.type?(this.app.conn=new WebSocket(e.replace(/^http/i,"ws")),this.app.conn.onopen=()=>this.connOpen(),this.app.conn.onmessage=t=>this.doUpdate(t),this.app.conn.onclose=()=>this.connClose(),this.app.conn.onerror=t=>this.connClose(t)):(this.app.conn=new XMLHttpRequest,this.app.conn.open("GET",e,!0),this.app.conn.onreadystatechange=()=>{200===this.app.conn.status&&2===this.app.conn.readyState&&this.connOpen(),200===this.app.conn.status&&3===this.app.conn.readyState&&this.doUpdate()},this.app.conn.onerror=t=>this.connClose(t),this.app.conn.send())}setClock(){let t=new Date;this.app.appBar.clock=t.toLocaleString(this.app.options.lang,this.app.options.clockFormat),this.app.appBar.header=t.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"clock"===this.app.options.mobileHeaderContent&&(this.app.appBar.mobileHeader=t.toLocaleString(this.app.options.lang,this.app.options.clockFormat)),"date"===this.app.options.mobileHeaderContent&&(this.app.appBar.mobileHeader=t.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}async init(t,e){this.getWeekDay("2022-04-06 08:37:29"),this.log({lvl:2,msg:"Starting FHEMApp..."}),this.loading=!0,await this.readConfig("./cfg/config.json"),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)),e&&this.app.options.lang&&(e.locale=this.app.options.lang),this.setClock(),setInterval((()=>this.setClock()),this.app.options.clockInterval)}}var at={install(t,e,s){t.prototype.$fhem=new st,t.prototype.$fhem.init(e,s)}};a.ZP.use(at,J,Q),a.ZP.use(Y()),a.ZP.component("apex-chart",Y()),a.ZP.config.productionTip=!1,new a.ZP({vuetify:J,router:U,i18n:Q,render:t=>t(H)}).$mount("#app")},8973:function(t,e,s){var a={"./de.json":9929,"./en.json":790};function n(t){var e=o(t);return s(e)}function o(t){if(!s.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}n.keys=function(){return Object.keys(a)},n.resolve=o,t.exports=n,n.id=8973},2862:function(t,e,s){"use strict";t.exports=s.p+"img/FHEM_Logo.a2a7fc8d.png"},4147:function(t){"use strict";t.exports={i8:"3.36.2"}},9929:function(t){"use strict";t.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Gruppen","room":"Bereiche","dashboard":"Dashboard","system":"System"},"dates":{"from":"von","to":"bis","range":"Zeitraum"}},"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"}}}}')},790:function(t){"use strict";t.exports=JSON.parse('{"app":{"navigation":{"home":"Home","group":"Groups","room":"Area","dashboard":"Dashboard","system":"System"},"dates":{"from":"From","to":"To","range":"Daterange"}},"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"}}}}')}},e={};function s(a){var n=e[a];if(void 0!==n)return n.exports;var o=e[a]={exports:{}};return t[a].call(o.exports,o,o.exports,s),o.exports}s.m=t,function(){var t=[];s.O=function(e,a,n,o){if(!a){var i=1/0;for(c=0;c=o)&&Object.keys(s.O).every((function(t){return s.O[t](a[l])}))?a.splice(l--,1):(r=!1,o0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[a,n,o]}}(),function(){s.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return s.d(e,{a:e}),e}}(),function(){s.d=function(t,e){for(var a in e)s.o(e,a)&&!s.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}}(),function(){s.f={},s.e=function(t){return Promise.all(Object.keys(s.f).reduce((function(e,a){return s.f[a](t,e),e}),[]))}}(),function(){s.u=function(t){return"js/"+t+"."+{4:"56e77bea",32:"356eff7f",137:"56d91d2a",259:"f397cfaa",270:"25da2e0b",399:"4058331d",445:"4fb7dc80",454:"1ebe9cbf",570:"203e3c7a",590:"4024bd68",592:"37807531",630:"b4397fa0",651:"11a77b53",654:"d05facf3",661:"294db997",665:"98d4ea68",705:"5f0492aa",838:"c296a3eb",994:"3ff835bb",999:"db98e2bf"}[t]+".js"}}(),function(){s.miniCssF=function(t){return"css/"+t+"."+{4:"570a1df0",32:"853e6840",137:"1284c544",259:"7dde73af",445:"8b1f0757",570:"57253e28",590:"57098c94",592:"853e6840",630:"b7f1b37d",651:"57253e28",661:"80f62a8a",705:"853e6840",838:"57098c94",994:"853e6840",999:"d256501f"}[t]+".css"}}(),function(){s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){var t={},e="fhemapp:";s.l=function(a,n,o,i){if(t[a])t[a].push(n);else{var r,l;if(void 0!==o)for(var p=document.getElementsByTagName("script"),c=0;c