diff --git a/package.json b/package.json index 42f9cbaf..4e144867 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fhemapp", - "version": "3.30.2", + "version": "3.30.3", "private": true, "author": "jemu75", "scripts": { diff --git a/public/cfg/templ_shellyswitch_mqtt.json b/public/cfg/templ_shellyswitch_mqtt.json new file mode 100644 index 00000000..7e115a9e --- /dev/null +++ b/public/cfg/templ_shellyswitch_mqtt.json @@ -0,0 +1,25 @@ +{ + "name": "shellyswitch_mqtt", + "author": "jemu75", + "date": "2022-03-18", + "status": { + "bar": ["state:on:100:success","state:off:0:success"], + "error": ["network:^(?!connected):100:error:keine Verbindung"] + }, + "main": [ + { + "leftBtn": "mdi-power-off", + "leftClick": ["state::off"], + "text": ["state:on:an","state:off:aus"], + "rightBtn": "mdi-power-on", + "rightClick": ["state::on"] + } + ], + "info": { + "left1": ["state:on::mdi-power-plug","state:::mdi-power-plug-off"], + "left2": ["relay_0_power:0.1:%n.2w"], + "mid1": ["tmp_tC::%n.1°C"], + "right1": ["new_fw:true::mdi-cloud-download"], + "right2": ["wifi_sta_connected:true::mdi-wifi","network:::mdi-wifi-off"] + } +} diff --git a/src/components/TemplSysmon.vue b/src/components/TemplSysmon.vue index dbee4e8b..26572bf4 100644 --- a/src/components/TemplSysmon.vue +++ b/src/components/TemplSysmon.vue @@ -20,54 +20,71 @@ /> - - {{ vals.subTitle }} - - - - - + + + +
+ {{ item.Options.status.error }} +
+
+
+
+ + + +
+ + {{ vals.subTitle }} + + + + + +
+ {{ itm.name }} +
+ +
{{ itm.subText }}
+
+
+
+ + -
- {{ itm.name }} -
- -
{{ itm.subText }}
- - - - - - mdi-format-list-bulleted - - - - {{ updateText }} - - - {{ $t('templates.sysmon.restartBtn') }} - - + mdi-format-list-bulleted +
+ + + {{ updateText }} + + + {{ $t('templates.sysmon.restartBtn') }} + +
+
+ diff --git a/www/fhemapp/cfg/templ_shellyswitch_mqtt.json b/www/fhemapp/cfg/templ_shellyswitch_mqtt.json new file mode 100644 index 00000000..7e115a9e --- /dev/null +++ b/www/fhemapp/cfg/templ_shellyswitch_mqtt.json @@ -0,0 +1,25 @@ +{ + "name": "shellyswitch_mqtt", + "author": "jemu75", + "date": "2022-03-18", + "status": { + "bar": ["state:on:100:success","state:off:0:success"], + "error": ["network:^(?!connected):100:error:keine Verbindung"] + }, + "main": [ + { + "leftBtn": "mdi-power-off", + "leftClick": ["state::off"], + "text": ["state:on:an","state:off:aus"], + "rightBtn": "mdi-power-on", + "rightClick": ["state::on"] + } + ], + "info": { + "left1": ["state:on::mdi-power-plug","state:::mdi-power-plug-off"], + "left2": ["relay_0_power:0.1:%n.2w"], + "mid1": ["tmp_tC::%n.1°C"], + "right1": ["new_fw:true::mdi-cloud-download"], + "right2": ["wifi_sta_connected:true::mdi-wifi","network:::mdi-wifi-off"] + } +} diff --git a/www/fhemapp/css/524.8ecd64f4.css b/www/fhemapp/css/997.8ecd64f4.css similarity index 100% rename from www/fhemapp/css/524.8ecd64f4.css rename to www/fhemapp/css/997.8ecd64f4.css diff --git a/www/fhemapp/index.html b/www/fhemapp/index.html index 55aeadce..4aa8e1c5 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/320-legacy.363319ed.js b/www/fhemapp/js/320-legacy.be5fa758.js similarity index 97% rename from www/fhemapp/js/320-legacy.363319ed.js rename to www/fhemapp/js/320-legacy.be5fa758.js index 39172774..943f4c4c 100644 --- a/www/fhemapp/js/320-legacy.363319ed.js +++ b/www/fhemapp/js/320-legacy.be5fa758.js @@ -1 +1 @@ -"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[320],{4320:function(e,t,n){n.r(t),n.d(t,{default:function(){return m}});var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("v-row",e._l(e.app.data.deviceList,(function(e){return n(e.Options.component,{key:e.Internals.FUUID,tag:"component",attrs:{item:e}})})),1)],1)},s=[],a=(n(1539),n(8783),n(3948),n(8309),n(4916),n(4723),n(7327),n(3123),{name:"DevicesView",components:{templ_default:function(){return Promise.all([n.e(121),n.e(288),n.e(322),n.e(846)]).then(n.bind(n,8115))},templ_panel:function(){return Promise.all([n.e(121),n.e(337)]).then(n.bind(n,2965))},templ_chart:function(){return Promise.all([n.e(121),n.e(288),n.e(285),n.e(387)]).then(n.bind(n,387))},templ_weather:function(){return n.e(947).then(n.bind(n,9285))},templ_scenes:function(){return n.e(869).then(n.bind(n,1869))},templ_sonos:function(){return Promise.all([n.e(121),n.e(288),n.e(322),n.e(475)]).then(n.bind(n,400))},templ_sysmon:function(){return Promise.all([n.e(121),n.e(524)]).then(n.bind(n,327))},templ_hmlan:function(){return n.e(438).then(n.bind(n,7438))},templ_cam:function(){return Promise.all([n.e(121),n.e(396)]).then(n.bind(n,8519))},templ_iframe:function(){return Promise.all([n.e(121),n.e(154)]).then(n.bind(n,2756))}},data:function(){return{app:{session:{connect:!1},options:{mobileHeader:!1},data:{deviceList:[],header:""}}}},watch:{$route:function(){this.subscribe()},"app.session.ready":function(e){e&&this.subscribe()}},mounted:function(){this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data},methods:{setHeader:function(){this.app.options.mobileHeader&&("Devices"===this.$route.name?this.$route.params.filter.match("device=")?this.$fhem.app.appBar.header="":this.$fhem.app.appBar.header=this.$route.params.filter.split("=")[1]:this.$fhem.app.appBar.header=this.$route.name)},subscribe:function(){var e=this.$route.params.filter||this.$route.path;this.setHeader(),this.$fhem.getDevices(e)}}}),r=a,o=n(1001),p=n(3453),h=n.n(p),u=n(2877),l=(0,o.Z)(r,i,s,!1,null,null,null),m=l.exports;h()(l,{VRow:u.Z})}}]); \ No newline at end of file +"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[320],{4320:function(e,t,n){n.r(t),n.d(t,{default:function(){return m}});var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("v-row",e._l(e.app.data.deviceList,(function(e){return n(e.Options.component,{key:e.Internals.FUUID,tag:"component",attrs:{item:e}})})),1)],1)},s=[],a=(n(1539),n(8783),n(3948),n(8309),n(4916),n(4723),n(7327),n(3123),{name:"DevicesView",components:{templ_default:function(){return Promise.all([n.e(121),n.e(288),n.e(322),n.e(846)]).then(n.bind(n,8115))},templ_panel:function(){return Promise.all([n.e(121),n.e(337)]).then(n.bind(n,2965))},templ_chart:function(){return Promise.all([n.e(121),n.e(288),n.e(285),n.e(387)]).then(n.bind(n,387))},templ_weather:function(){return n.e(947).then(n.bind(n,9285))},templ_scenes:function(){return n.e(869).then(n.bind(n,1869))},templ_sonos:function(){return Promise.all([n.e(121),n.e(288),n.e(322),n.e(475)]).then(n.bind(n,400))},templ_sysmon:function(){return Promise.all([n.e(121),n.e(997)]).then(n.bind(n,214))},templ_hmlan:function(){return n.e(438).then(n.bind(n,7438))},templ_cam:function(){return Promise.all([n.e(121),n.e(396)]).then(n.bind(n,8519))},templ_iframe:function(){return Promise.all([n.e(121),n.e(154)]).then(n.bind(n,2756))}},data:function(){return{app:{session:{connect:!1},options:{mobileHeader:!1},data:{deviceList:[],header:""}}}},watch:{$route:function(){this.subscribe()},"app.session.ready":function(e){e&&this.subscribe()}},mounted:function(){this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data},methods:{setHeader:function(){this.app.options.mobileHeader&&("Devices"===this.$route.name?this.$route.params.filter.match("device=")?this.$fhem.app.appBar.header="":this.$fhem.app.appBar.header=this.$route.params.filter.split("=")[1]:this.$fhem.app.appBar.header=this.$route.name)},subscribe:function(){var e=this.$route.params.filter||this.$route.path;this.setHeader(),this.$fhem.getDevices(e)}}}),r=a,o=n(1001),p=n(3453),h=n.n(p),u=n(2877),l=(0,o.Z)(r,i,s,!1,null,null,null),m=l.exports;h()(l,{VRow:u.Z})}}]); \ No newline at end of file diff --git a/www/fhemapp/js/320.14e9d509.js b/www/fhemapp/js/320.2ba04f2e.js similarity index 93% rename from www/fhemapp/js/320.14e9d509.js rename to www/fhemapp/js/320.2ba04f2e.js index 97f83372..c170597a 100644 --- a/www/fhemapp/js/320.14e9d509.js +++ b/www/fhemapp/js/320.2ba04f2e.js @@ -1 +1 @@ -"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[320],{4320:function(e,t,s){s.r(t),s.d(t,{default:function(){return d}});var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("v-row",e._l(e.app.data.deviceList,(function(e){return s(e.Options.component,{key:e.Internals.FUUID,tag:"component",attrs:{item:e}})})),1)],1)},i=[],n={name:"DevicesView",components:{templ_default:()=>Promise.all([s.e(121),s.e(288),s.e(322),s.e(846)]).then(s.bind(s,8115)),templ_panel:()=>Promise.all([s.e(121),s.e(337)]).then(s.bind(s,2965)),templ_chart:()=>Promise.all([s.e(121),s.e(288),s.e(285),s.e(387)]).then(s.bind(s,387)),templ_weather:()=>s.e(947).then(s.bind(s,9285)),templ_scenes:()=>s.e(869).then(s.bind(s,1869)),templ_sonos:()=>Promise.all([s.e(121),s.e(288),s.e(322),s.e(475)]).then(s.bind(s,400)),templ_sysmon:()=>Promise.all([s.e(121),s.e(524)]).then(s.bind(s,327)),templ_hmlan:()=>s.e(438).then(s.bind(s,7438)),templ_cam:()=>Promise.all([s.e(121),s.e(396)]).then(s.bind(s,8519)),templ_iframe:()=>Promise.all([s.e(121),s.e(154)]).then(s.bind(s,2756))},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&&("Devices"===this.$route.name?this.$route.params.filter.match("device=")?this.$fhem.app.appBar.header="":this.$fhem.app.appBar.header=this.$route.params.filter.split("=")[1]:this.$fhem.app.appBar.header=this.$route.name)},subscribe(){let e=this.$route.params.filter||this.$route.path;this.setHeader(),this.$fhem.getDevices(e)}}},p=n,h=s(1001),r=s(3453),o=s.n(r),l=s(2877),m=(0,h.Z)(p,a,i,!1,null,null,null),d=m.exports;o()(m,{VRow:l.Z})}}]); \ No newline at end of file +"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[320],{4320:function(e,t,s){s.r(t),s.d(t,{default:function(){return d}});var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("v-row",e._l(e.app.data.deviceList,(function(e){return s(e.Options.component,{key:e.Internals.FUUID,tag:"component",attrs:{item:e}})})),1)],1)},i=[],n={name:"DevicesView",components:{templ_default:()=>Promise.all([s.e(121),s.e(288),s.e(322),s.e(846)]).then(s.bind(s,8115)),templ_panel:()=>Promise.all([s.e(121),s.e(337)]).then(s.bind(s,2965)),templ_chart:()=>Promise.all([s.e(121),s.e(288),s.e(285),s.e(387)]).then(s.bind(s,387)),templ_weather:()=>s.e(947).then(s.bind(s,9285)),templ_scenes:()=>s.e(869).then(s.bind(s,1869)),templ_sonos:()=>Promise.all([s.e(121),s.e(288),s.e(322),s.e(475)]).then(s.bind(s,400)),templ_sysmon:()=>Promise.all([s.e(121),s.e(997)]).then(s.bind(s,214)),templ_hmlan:()=>s.e(438).then(s.bind(s,7438)),templ_cam:()=>Promise.all([s.e(121),s.e(396)]).then(s.bind(s,8519)),templ_iframe:()=>Promise.all([s.e(121),s.e(154)]).then(s.bind(s,2756))},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&&("Devices"===this.$route.name?this.$route.params.filter.match("device=")?this.$fhem.app.appBar.header="":this.$fhem.app.appBar.header=this.$route.params.filter.split("=")[1]:this.$fhem.app.appBar.header=this.$route.name)},subscribe(){let e=this.$route.params.filter||this.$route.path;this.setHeader(),this.$fhem.getDevices(e)}}},p=n,h=s(1001),r=s(3453),o=s.n(r),l=s(2877),m=(0,h.Z)(p,a,i,!1,null,null,null),d=m.exports;o()(m,{VRow:l.Z})}}]); \ No newline at end of file diff --git a/www/fhemapp/js/524-legacy.5dc6a0fe.js b/www/fhemapp/js/524-legacy.5dc6a0fe.js deleted file mode 100644 index 06d8b758..00000000 --- a/www/fhemapp/js/524-legacy.5dc6a0fe.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[524],{1830:function(t,s,e){e.d(s,{Z:function(){return b}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"text-center"},["zzz"!=t.item.Options.sortby?e("v-chip",{attrs:{small:"",color:"secondary"}},[e("v-icon",{attrs:{left:""}},[t._v(" mdi-sort-ascending ")]),t._v(" "+t._s(t.item.Options.sortby)+" ")],1):t._e(),e("v-btn",{attrs:{href:t.toFhem(),target:"_blank",small:"",icon:""}},[e("v-icon",{attrs:{small:""}},[t._v(" mdi-link ")])],1),e("v-dialog",{attrs:{"max-width":"90%",scrollable:""},scopedSlots:t._u([{key:"activator",fn:function(s){var i=s.on,a=s.attrs;return[e("v-btn",t._g(t._b({attrs:{small:"",icon:""}},"v-btn",a,!1),i),[e("v-icon",{attrs:{small:""}},[t._v(" mdi-code-json ")])],1)]}}]),model:{value:t.dialog,callback:function(s){t.dialog=s},expression:"dialog"}},[e("v-card",{staticClass:"secondary lighten-1"},[e("v-card-title",{staticClass:"secondary"},[e("v-btn",{attrs:{icon:""},on:{click:function(s){t.deep=t.deep>1?1:5}}},[e("v-icon",[t._v("mdi-file-tree-outline")])],1),e("v-spacer"),t._v(" "+t._s(t.item.Name)+" "),e("v-spacer"),e("v-btn",{attrs:{icon:""},on:{click:function(s){t.dialog=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[e("div",{ref:"jsonContent",staticClass:"select"},[e("vue-json-pretty",{attrs:{"show-line":!1,deep:t.deep,data:t.item}})],1)])],1)],1)],1)},a=[],n=e(4566),o=e.n(n),l={name:"JsonList",props:{item:{type:Object,default:function(){return{name:"json"}}}},data:function(){return{dialog:!1,deep:1}},components:{VueJsonPretty:o()},methods:{toFhem:function(){var t=this.$fhem.createURL([{param:"detail",value:this.item.Name}]);return t}}},r=l,c=e(1001),h=e(3453),u=e.n(h),m=e(3150),d=e(2371),v=e(7118),p=e(5424),f=e(4497),g=e(6428),_=e(9762),x=(0,c.Z)(r,i,a,!1,null,"4fc9ba56",null),b=x.exports;u()(x,{VBtn:m.Z,VCard:d.Z,VCardText:v.ZB,VCardTitle:v.EB,VChip:p.Z,VDialog:f.Z,VIcon:g.Z,VSpacer:_.Z})},327:function(t,s,e){e.r(s),e.d(s,{default:function(){return k}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("v-col",{class:t.setup.size},[e("v-card",{attrs:{dark:this.$vuetify.theme.dark,color:"secondary"}},[e("v-progress-linear",{attrs:{height:"7",value:t.getLevel,color:t.vals.status.color,"background-color":"secondary darken-1"}}),e("v-card-title",{staticClass:"text-truncate"},[t._v(" "+t._s(t.vals.title)+" "),e("v-spacer"),t.app.options.debugMode?e("jsonList",{attrs:{item:t.item}}):t._e()],1),e("v-divider"),e("v-card-subtitle",[t._v(" "+t._s(t.vals.subTitle)+" ")]),e("v-card-text",[e("v-row",t._l(t.vals.list,(function(s){return e("v-col",{key:s.name,staticClass:"col-12 col-md-4 col-lg-4"},[e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(s.name)+" ")]),s.isBar?e("v-progress-linear",{attrs:{height:"7",value:s.value,color:s.color,min:s.min,max:s.max,"background-color":"secondary lighten-4"}}):t._e(),e("div",[t._v(t._s(s.subText))])],1)})),1)],1),t.setup.fhemBtns?e("v-card-actions",[e("v-btn",{staticClass:"mr-2",on:{click:function(s){return t.goTo()}}},[e("v-icon",[t._v("mdi-format-list-bulleted")])],1),e("v-spacer"),e("v-btn",{attrs:{disabled:!t.update},on:{click:t.fhemUpdate}},[t._v(" "+t._s(t.updateText)+" ")]),e("v-btn",{attrs:{disabled:!t.restart},on:{click:t.fhemRestart}},[t._v(" "+t._s(t.$t("templates.sysmon.restartBtn"))+" ")])],1):t._e(),e("v-divider"),e("v-system-bar",{attrs:{color:"secondary darken-1"}},[e("v-icon",{staticClass:"ml-0"},[t._v(" "+t._s(t.vals.info.left1Icon)+" ")]),t._v(t._s(t.vals.info.left1Text)+" "),e("v-icon",{staticClass:"ml-2"},[t._v(" "+t._s(t.vals.info.left2Icon)+" ")]),t._v(t._s(t.vals.info.left2Text)+" "),e("v-spacer"),e("v-icon",[t._v(t._s(t.vals.info.mid1Icon))]),t._v(t._s(t.vals.info.mid1Text)+" "),e("v-icon",{staticClass:"ml-2"},[t._v(" "+t._s(t.vals.info.mid2Icon)+" ")]),t._v(t._s(t.vals.info.mid2Text)+" "),e("v-spacer"),e("v-icon",[t._v(t._s(t.vals.info.right1Icon))]),t._v(t._s(t.vals.info.right1Text)+" "),e("v-icon",{staticClass:"ml-2 mr-0"},[t._v(" "+t._s(t.vals.info.right2Icon)+" ")]),t._v(t._s(t.vals.info.right2Text)+" ")],1),e("v-dialog",{attrs:{"max-width":"420px"},model:{value:t.updateDialog,callback:function(s){t.updateDialog=s},expression:"updateDialog"}},[e("v-card",{attrs:{color:"secondary lighten-2"}},[e("v-card-title",[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.header"))+" "),e("v-spacer"),e("v-btn",{attrs:{icon:"",small:""},on:{click:function(s){t.updateDialog=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.text"))+" ")]),e("v-card-actions",[e("v-spacer"),e("v-btn",{on:{click:function(s){return t.fhemRestart()}}},[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.restartBtn"))+" ")])],1)],1)],1)],1)],1)},a=[],n=e(6198),o=e(2032),l=(e(5666),e(1249),e(8309),e(561),e(1539),e(1830)),r={components:{jsonList:l.Z},props:{item:{type:Object,default:function(){return{name:"sysmon"}}}},data:function(){return{name:"sysmon",app:{options:{updateProcess:!1,debugMode:!1}},setup:{size:"col-12 col-sm-12 col-md-6 col-lg-6",status:{bar:[],error:[],min:0,max:100},subTitle:[],main:[],fhemBtns:!0,info:{left1:[],left2:[],mid1:[],mid2:[],right1:[],right2:[]}},vals:{title:"",subTitle:"",status:{level:0,color:"success"},list:[],info:{left1Icon:"",left1Text:"",left2Icon:"",left2Text:"",mid1Icon:"",mid1Text:"",mid2Icon:"",mid2Text:"",right1Icon:"",right1Text:"",right2Icon:"",right2Text:""}},restart:!0,update:!0,updateText:"",updateDialog:!1}},computed:{getLevel:function(){var t=100/(this.setup.status.max-this.setup.status.min),s=(this.vals.status.level-this.setup.status.min)*t;return this.vals.status.invert?100-s:s}},watch:{item:{immediate:!0,deep:!0,handler:function(t){var s=this.$fhem.getEl(t,"Attributes","alias")||t.Name;this.vals.title=this.$fhem.getEl(t,"Options","name")||s,this.setValues(),this.doList()}},setup:{deep:!0,handler:function(){this.setValues(),this.doList()}},"app.options.updateProcess":function(t){t||(this.updateDialog=!0,this.updateText=this.$t("templates.sysmon.updateBtn[1]"),this.restart=!0)}},mounted:function(){this.app.options=this.$fhem.app.options,this.fhemUpdateCheck();var t=this.$fhem.getEl(this.item,"Options","setup","size"),s=this.$fhem.getEl(this.item,"Options","setup","subTitle"),e=this.$fhem.getEl(this.item,"Options","setup","fhemBtns"),i=this.$fhem.getEl(this.item,"Options","setup","status"),a=this.$fhem.getEl(this.item,"Options","setup","main"),n=this.$fhem.getEl(this.item,"Options","setup","info");t&&(this.setup.size=t),s&&(this.setup.subTitle=s),i&&Object.assign(this.setup.status,i),a&&Object.assign(this.setup.main,a),n&&Object.assign(this.setup.info,n),this.setup.fhemBtns=e},methods:{setValues:function(){var t=this.$fhem.handleVals(this.item,this.setup.status.bar),s=this.$fhem.handleVals(this.item,this.setup.status.error),e=this.$fhem.handleVals(this.item,this.setup.subTitle),i=this.$fhem.handleVals(this.item,this.setup.info.left1),a=this.$fhem.handleVals(this.item,this.setup.info.left2),n=this.$fhem.handleVals(this.item,this.setup.info.mid1),o=this.$fhem.handleVals(this.item,this.setup.info.mid2),l=this.$fhem.handleVals(this.item,this.setup.info.right1),r=this.$fhem.handleVals(this.item,this.setup.info.right2);this.vals.status.level=t[0]||"100",this.vals.status.color=t[1]||"success",this.vals.subTitle=e[0]||"",this.vals.info.left1Icon=i[1]||"",this.vals.info.left1Text=i[0]||"",this.vals.info.left2Icon=a[1]||"",this.vals.info.left2Text=a[0]||"",this.vals.info.mid1Icon=n[1]||"",this.vals.info.mid1Text=n[0]||"",this.vals.info.mid2Icon=o[1]||"",this.vals.info.mid2Text=o[0]||"",this.vals.info.right1Icon=l[1]||"",this.vals.info.right1Text=l[0]||"",this.vals.info.right2Icon=r[1]||"",this.vals.info.right2Text=r[0]||"",s.length>0&&(this.vals.status.level=s[0]||"100",this.vals.status.color=s[1]||"error")},doList:function(){var t,s=(0,o.Z)(this.setup.main);try{for(s.s();!(t=s.n()).done;){var e=t.value,i=this.vals.list.map((function(t){return t.name})).indexOf(e.name),a=this.$fhem.handleVals(this.item,e.bar),n=this.$fhem.handleVals(this.item,e.subText),l={name:e.name,isBar:a.length>0,value:a[0]||0,color:a[1]||"success",min:a[2]||0,max:a[3]||100,subText:n[0]||""};l.isBar&&"success"!=l.color&&(this.vals.status.color=l.color),-1!=i?this.vals.list.splice(i,1,l):this.vals.list.push(l)}}catch(r){s.e(r)}finally{s.f()}},fhemRestart:function(){this.restart=!1,this.updateDialog=!1,this.$fhem.request({param:"cmd",value:"shutdown restart"})},fhemUpdateCheck:function(){var t=this;return(0,n.Z)(regeneratorRuntime.mark((function s(){var e;return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return e=new Promise((function(s,e){t.restart=!1,t.update=!1,t.updateText=t.$t("templates.sysmon.updateBtn[0]"),t.$fhem.checkUpdate().then((function(e){e?(t.updateText=t.$t("templates.sysmon.updateBtn[2]"),t.update=!0):t.updateText=t.$t("templates.sysmon.updateBtn[1]"),s(e)})).catch((function(s){t.$fhem.log({lvl:1,msg:"Update check failed.",meta:s}),e()})).finally((function(){t.restart=!0}))})),s.abrupt("return",e);case 2:case"end":return s.stop()}}),s)})))()},fhemUpdate:function(){this.restart=!1,this.update=!1,this.updateText=this.$t("templates.sysmon.updateBtn[3]"),this.app.options.updateProcess=!0,this.$fhem.request({param:"cmd",value:"update"})},goTo:function(){this.$router.push("syslog")}}},c=r,h=e(1001),u=e(3453),m=e.n(u),d=e(3150),v=e(2371),p=e(7118),f=e(2102),g=e(4497),_=e(1418),x=e(6428),b=e(7003),T=e(2877),$=e(9762),V=e(2691),y=(0,h.Z)(c,i,a,!1,null,null,null),k=y.exports;m()(y,{VBtn:d.Z,VCard:v.Z,VCardActions:p.h7,VCardSubtitle:p.Qq,VCardText:p.ZB,VCardTitle:p.EB,VCol:f.Z,VDialog:g.Z,VDivider:_.Z,VIcon:x.Z,VProgressLinear:b.Z,VRow:T.Z,VSpacer:$.Z,VSystemBar:V.Z})}}]); \ No newline at end of file diff --git a/www/fhemapp/js/524.c1bbbde3.js b/www/fhemapp/js/524.c1bbbde3.js deleted file mode 100644 index a5441e37..00000000 --- a/www/fhemapp/js/524.c1bbbde3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[524],{1830:function(t,s,e){e.d(s,{Z:function(){return b}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"text-center"},["zzz"!=t.item.Options.sortby?e("v-chip",{attrs:{small:"",color:"secondary"}},[e("v-icon",{attrs:{left:""}},[t._v(" mdi-sort-ascending ")]),t._v(" "+t._s(t.item.Options.sortby)+" ")],1):t._e(),e("v-btn",{attrs:{href:t.toFhem(),target:"_blank",small:"",icon:""}},[e("v-icon",{attrs:{small:""}},[t._v(" mdi-link ")])],1),e("v-dialog",{attrs:{"max-width":"90%",scrollable:""},scopedSlots:t._u([{key:"activator",fn:function(s){var i=s.on,a=s.attrs;return[e("v-btn",t._g(t._b({attrs:{small:"",icon:""}},"v-btn",a,!1),i),[e("v-icon",{attrs:{small:""}},[t._v(" mdi-code-json ")])],1)]}}]),model:{value:t.dialog,callback:function(s){t.dialog=s},expression:"dialog"}},[e("v-card",{staticClass:"secondary lighten-1"},[e("v-card-title",{staticClass:"secondary"},[e("v-btn",{attrs:{icon:""},on:{click:function(s){t.deep=t.deep>1?1:5}}},[e("v-icon",[t._v("mdi-file-tree-outline")])],1),e("v-spacer"),t._v(" "+t._s(t.item.Name)+" "),e("v-spacer"),e("v-btn",{attrs:{icon:""},on:{click:function(s){t.dialog=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[e("div",{ref:"jsonContent",staticClass:"select"},[e("vue-json-pretty",{attrs:{"show-line":!1,deep:t.deep,data:t.item}})],1)])],1)],1)],1)},a=[],l=e(4566),n=e.n(l),o={name:"JsonList",props:{item:{type:Object,default:()=>({name:"json"})}},data(){return{dialog:!1,deep:1}},components:{VueJsonPretty:n()},methods:{toFhem(){let t=this.$fhem.createURL([{param:"detail",value:this.item.Name}]);return t}}},r=o,h=e(1001),c=e(3453),m=e.n(c),d=e(3150),u=e(2371),v=e(7118),p=e(5424),f=e(4497),g=e(6428),_=e(9762),x=(0,h.Z)(r,i,a,!1,null,"4fc9ba56",null),b=x.exports;m()(x,{VBtn:d.Z,VCard:u.Z,VCardText:v.ZB,VCardTitle:v.EB,VChip:p.Z,VDialog:f.Z,VIcon:g.Z,VSpacer:_.Z})},327:function(t,s,e){e.r(s),e.d(s,{default:function(){return V}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("v-col",{class:t.setup.size},[e("v-card",{attrs:{dark:this.$vuetify.theme.dark,color:"secondary"}},[e("v-progress-linear",{attrs:{height:"7",value:t.getLevel,color:t.vals.status.color,"background-color":"secondary darken-1"}}),e("v-card-title",{staticClass:"text-truncate"},[t._v(" "+t._s(t.vals.title)+" "),e("v-spacer"),t.app.options.debugMode?e("jsonList",{attrs:{item:t.item}}):t._e()],1),e("v-divider"),e("v-card-subtitle",[t._v(" "+t._s(t.vals.subTitle)+" ")]),e("v-card-text",[e("v-row",t._l(t.vals.list,(function(s){return e("v-col",{key:s.name,staticClass:"col-12 col-md-4 col-lg-4"},[e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(s.name)+" ")]),s.isBar?e("v-progress-linear",{attrs:{height:"7",value:s.value,color:s.color,min:s.min,max:s.max,"background-color":"secondary lighten-4"}}):t._e(),e("div",[t._v(t._s(s.subText))])],1)})),1)],1),t.setup.fhemBtns?e("v-card-actions",[e("v-btn",{staticClass:"mr-2",on:{click:function(s){return t.goTo()}}},[e("v-icon",[t._v("mdi-format-list-bulleted")])],1),e("v-spacer"),e("v-btn",{attrs:{disabled:!t.update},on:{click:t.fhemUpdate}},[t._v(" "+t._s(t.updateText)+" ")]),e("v-btn",{attrs:{disabled:!t.restart},on:{click:t.fhemRestart}},[t._v(" "+t._s(t.$t("templates.sysmon.restartBtn"))+" ")])],1):t._e(),e("v-divider"),e("v-system-bar",{attrs:{color:"secondary darken-1"}},[e("v-icon",{staticClass:"ml-0"},[t._v(" "+t._s(t.vals.info.left1Icon)+" ")]),t._v(t._s(t.vals.info.left1Text)+" "),e("v-icon",{staticClass:"ml-2"},[t._v(" "+t._s(t.vals.info.left2Icon)+" ")]),t._v(t._s(t.vals.info.left2Text)+" "),e("v-spacer"),e("v-icon",[t._v(t._s(t.vals.info.mid1Icon))]),t._v(t._s(t.vals.info.mid1Text)+" "),e("v-icon",{staticClass:"ml-2"},[t._v(" "+t._s(t.vals.info.mid2Icon)+" ")]),t._v(t._s(t.vals.info.mid2Text)+" "),e("v-spacer"),e("v-icon",[t._v(t._s(t.vals.info.right1Icon))]),t._v(t._s(t.vals.info.right1Text)+" "),e("v-icon",{staticClass:"ml-2 mr-0"},[t._v(" "+t._s(t.vals.info.right2Icon)+" ")]),t._v(t._s(t.vals.info.right2Text)+" ")],1),e("v-dialog",{attrs:{"max-width":"420px"},model:{value:t.updateDialog,callback:function(s){t.updateDialog=s},expression:"updateDialog"}},[e("v-card",{attrs:{color:"secondary lighten-2"}},[e("v-card-title",[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.header"))+" "),e("v-spacer"),e("v-btn",{attrs:{icon:"",small:""},on:{click:function(s){t.updateDialog=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.text"))+" ")]),e("v-card-actions",[e("v-spacer"),e("v-btn",{on:{click:function(s){return t.fhemRestart()}}},[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.restartBtn"))+" ")])],1)],1)],1)],1)],1)},a=[],l=e(1830),n={components:{jsonList:l.Z},props:{item:{type:Object,default:()=>({name:"sysmon"})}},data:()=>({name:"sysmon",app:{options:{updateProcess:!1,debugMode:!1}},setup:{size:"col-12 col-sm-12 col-md-6 col-lg-6",status:{bar:[],error:[],min:0,max:100},subTitle:[],main:[],fhemBtns:!0,info:{left1:[],left2:[],mid1:[],mid2:[],right1:[],right2:[]}},vals:{title:"",subTitle:"",status:{level:0,color:"success"},list:[],info:{left1Icon:"",left1Text:"",left2Icon:"",left2Text:"",mid1Icon:"",mid1Text:"",mid2Icon:"",mid2Text:"",right1Icon:"",right1Text:"",right2Icon:"",right2Text:""}},restart:!0,update:!0,updateText:"",updateDialog:!1}),computed:{getLevel(){let t=100/(this.setup.status.max-this.setup.status.min),s=(this.vals.status.level-this.setup.status.min)*t;return this.vals.status.invert?100-s:s}},watch:{item:{immediate:!0,deep:!0,handler(t){let s=this.$fhem.getEl(t,"Attributes","alias")||t.Name;this.vals.title=this.$fhem.getEl(t,"Options","name")||s,this.setValues(),this.doList()}},setup:{deep:!0,handler(){this.setValues(),this.doList()}},"app.options.updateProcess"(t){t||(this.updateDialog=!0,this.updateText=this.$t("templates.sysmon.updateBtn[1]"),this.restart=!0)}},mounted(){this.app.options=this.$fhem.app.options,this.fhemUpdateCheck();let t=this.$fhem.getEl(this.item,"Options","setup","size"),s=this.$fhem.getEl(this.item,"Options","setup","subTitle"),e=this.$fhem.getEl(this.item,"Options","setup","fhemBtns"),i=this.$fhem.getEl(this.item,"Options","setup","status"),a=this.$fhem.getEl(this.item,"Options","setup","main"),l=this.$fhem.getEl(this.item,"Options","setup","info");t&&(this.setup.size=t),s&&(this.setup.subTitle=s),i&&Object.assign(this.setup.status,i),a&&Object.assign(this.setup.main,a),l&&Object.assign(this.setup.info,l),this.setup.fhemBtns=e},methods:{setValues(){let t=this.$fhem.handleVals(this.item,this.setup.status.bar),s=this.$fhem.handleVals(this.item,this.setup.status.error),e=this.$fhem.handleVals(this.item,this.setup.subTitle),i=this.$fhem.handleVals(this.item,this.setup.info.left1),a=this.$fhem.handleVals(this.item,this.setup.info.left2),l=this.$fhem.handleVals(this.item,this.setup.info.mid1),n=this.$fhem.handleVals(this.item,this.setup.info.mid2),o=this.$fhem.handleVals(this.item,this.setup.info.right1),r=this.$fhem.handleVals(this.item,this.setup.info.right2);this.vals.status.level=t[0]||"100",this.vals.status.color=t[1]||"success",this.vals.subTitle=e[0]||"",this.vals.info.left1Icon=i[1]||"",this.vals.info.left1Text=i[0]||"",this.vals.info.left2Icon=a[1]||"",this.vals.info.left2Text=a[0]||"",this.vals.info.mid1Icon=l[1]||"",this.vals.info.mid1Text=l[0]||"",this.vals.info.mid2Icon=n[1]||"",this.vals.info.mid2Text=n[0]||"",this.vals.info.right1Icon=o[1]||"",this.vals.info.right1Text=o[0]||"",this.vals.info.right2Icon=r[1]||"",this.vals.info.right2Text=r[0]||"",s.length>0&&(this.vals.status.level=s[0]||"100",this.vals.status.color=s[1]||"error")},doList(){for(var t of this.setup.main){let s=this.vals.list.map((t=>t.name)).indexOf(t.name),e=this.$fhem.handleVals(this.item,t.bar),i=this.$fhem.handleVals(this.item,t.subText),a={name:t.name,isBar:e.length>0,value:e[0]||0,color:e[1]||"success",min:e[2]||0,max:e[3]||100,subText:i[0]||""};a.isBar&&"success"!=a.color&&(this.vals.status.color=a.color),-1!=s?this.vals.list.splice(s,1,a):this.vals.list.push(a)}},fhemRestart(){this.restart=!1,this.updateDialog=!1,this.$fhem.request({param:"cmd",value:"shutdown restart"})},async fhemUpdateCheck(){let t=new Promise(((t,s)=>{this.restart=!1,this.update=!1,this.updateText=this.$t("templates.sysmon.updateBtn[0]"),this.$fhem.checkUpdate().then((s=>{s?(this.updateText=this.$t("templates.sysmon.updateBtn[2]"),this.update=!0):this.updateText=this.$t("templates.sysmon.updateBtn[1]"),t(s)})).catch((t=>{this.$fhem.log({lvl:1,msg:"Update check failed.",meta:t}),s()})).finally((()=>{this.restart=!0}))}));return t},fhemUpdate(){this.restart=!1,this.update=!1,this.updateText=this.$t("templates.sysmon.updateBtn[3]"),this.app.options.updateProcess=!0,this.$fhem.request({param:"cmd",value:"update"})},goTo(){this.$router.push("syslog")}}},o=n,r=e(1001),h=e(3453),c=e.n(h),m=e(3150),d=e(2371),u=e(7118),v=e(2102),p=e(4497),f=e(1418),g=e(6428),_=e(7003),x=e(2877),b=e(9762),T=e(2691),$=(0,r.Z)(o,i,a,!1,null,null,null),V=$.exports;c()($,{VBtn:m.Z,VCard:d.Z,VCardActions:u.h7,VCardSubtitle:u.Qq,VCardText:u.ZB,VCardTitle:u.EB,VCol:v.Z,VDialog:p.Z,VDivider:f.Z,VIcon:g.Z,VProgressLinear:_.Z,VRow:x.Z,VSpacer:b.Z,VSystemBar:T.Z})}}]); \ No newline at end of file diff --git a/www/fhemapp/js/997-legacy.64da21ee.js b/www/fhemapp/js/997-legacy.64da21ee.js new file mode 100644 index 00000000..672802b8 --- /dev/null +++ b/www/fhemapp/js/997-legacy.64da21ee.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[997],{1830:function(t,s,e){e.d(s,{Z:function(){return b}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"text-center"},["zzz"!=t.item.Options.sortby?e("v-chip",{attrs:{small:"",color:"secondary"}},[e("v-icon",{attrs:{left:""}},[t._v(" mdi-sort-ascending ")]),t._v(" "+t._s(t.item.Options.sortby)+" ")],1):t._e(),e("v-btn",{attrs:{href:t.toFhem(),target:"_blank",small:"",icon:""}},[e("v-icon",{attrs:{small:""}},[t._v(" mdi-link ")])],1),e("v-dialog",{attrs:{"max-width":"90%",scrollable:""},scopedSlots:t._u([{key:"activator",fn:function(s){var i=s.on,a=s.attrs;return[e("v-btn",t._g(t._b({attrs:{small:"",icon:""}},"v-btn",a,!1),i),[e("v-icon",{attrs:{small:""}},[t._v(" mdi-code-json ")])],1)]}}]),model:{value:t.dialog,callback:function(s){t.dialog=s},expression:"dialog"}},[e("v-card",{staticClass:"secondary lighten-1"},[e("v-card-title",{staticClass:"secondary"},[e("v-btn",{attrs:{icon:""},on:{click:function(s){t.deep=t.deep>1?1:5}}},[e("v-icon",[t._v("mdi-file-tree-outline")])],1),e("v-spacer"),t._v(" "+t._s(t.item.Name)+" "),e("v-spacer"),e("v-btn",{attrs:{icon:""},on:{click:function(s){t.dialog=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[e("div",{ref:"jsonContent",staticClass:"select"},[e("vue-json-pretty",{attrs:{"show-line":!1,deep:t.deep,data:t.item}})],1)])],1)],1)],1)},a=[],n=e(4566),o=e.n(n),l={name:"JsonList",props:{item:{type:Object,default:function(){return{name:"json"}}}},data:function(){return{dialog:!1,deep:1}},components:{VueJsonPretty:o()},methods:{toFhem:function(){var t=this.$fhem.createURL([{param:"detail",value:this.item.Name}]);return t}}},r=l,c=e(1001),h=e(3453),u=e.n(h),m=e(3150),d=e(2371),v=e(7118),p=e(5424),f=e(4497),g=e(6428),_=e(9762),x=(0,c.Z)(r,i,a,!1,null,"4fc9ba56",null),b=x.exports;u()(x,{VBtn:m.Z,VCard:d.Z,VCardText:v.ZB,VCardTitle:v.EB,VChip:p.Z,VDialog:f.Z,VIcon:g.Z,VSpacer:_.Z})},214:function(t,s,e){e.r(s),e.d(s,{default:function(){return k}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("v-col",{class:t.setup.size},[e("v-card",{attrs:{dark:this.$vuetify.theme.dark,color:"secondary"}},[e("v-progress-linear",{attrs:{height:"7",value:t.getLevel,color:t.vals.status.color,"background-color":"secondary darken-1"}}),e("v-card-title",{staticClass:"text-truncate"},[t._v(" "+t._s(t.vals.title)+" "),e("v-spacer"),t.app.options.debugMode?e("jsonList",{attrs:{item:t.item}}):t._e()],1),e("v-divider"),t.item.Options.status.isActive?t._e():e("div",[e("v-card-text",[e("v-row",{attrs:{align:"center"}},[e("v-col",{attrs:{align:"center"}},[e("div",{staticClass:"headline font-weight-bold"},[t._v(" "+t._s(t.item.Options.status.error)+" ")])])],1)],1),e("v-divider")],1),t.item.Options.status.isActive?e("div",[e("v-card-subtitle",[t._v(" "+t._s(t.vals.subTitle)+" ")]),e("v-card-text",[e("v-row",t._l(t.vals.list,(function(s){return e("v-col",{key:s.name,staticClass:"col-12 col-md-4 col-lg-4"},[e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(s.name)+" ")]),s.isBar?e("v-progress-linear",{attrs:{height:"7",value:s.value,color:s.color,min:s.min,max:s.max,"background-color":"secondary lighten-4"}}):t._e(),e("div",[t._v(t._s(s.subText))])],1)})),1)],1),t.setup.fhemBtns?e("v-card-actions",[e("v-btn",{staticClass:"mr-2",on:{click:function(s){return t.goTo()}}},[e("v-icon",[t._v("mdi-format-list-bulleted")])],1),e("v-spacer"),e("v-btn",{attrs:{disabled:!t.update},on:{click:t.fhemUpdate}},[t._v(" "+t._s(t.updateText)+" ")]),e("v-btn",{attrs:{disabled:!t.restart},on:{click:t.fhemRestart}},[t._v(" "+t._s(t.$t("templates.sysmon.restartBtn"))+" ")])],1):t._e()],1):t._e(),e("v-divider"),e("v-system-bar",{attrs:{color:"secondary darken-1"}},[e("v-icon",{staticClass:"ml-0"},[t._v(" "+t._s(t.vals.info.left1Icon)+" ")]),t._v(t._s(t.vals.info.left1Text)+" "),e("v-icon",{staticClass:"ml-2"},[t._v(" "+t._s(t.vals.info.left2Icon)+" ")]),t._v(t._s(t.vals.info.left2Text)+" "),e("v-spacer"),e("v-icon",[t._v(t._s(t.vals.info.mid1Icon))]),t._v(t._s(t.vals.info.mid1Text)+" "),e("v-icon",{staticClass:"ml-2"},[t._v(" "+t._s(t.vals.info.mid2Icon)+" ")]),t._v(t._s(t.vals.info.mid2Text)+" "),e("v-spacer"),e("v-icon",[t._v(t._s(t.vals.info.right1Icon))]),t._v(t._s(t.vals.info.right1Text)+" "),e("v-icon",{staticClass:"ml-2 mr-0"},[t._v(" "+t._s(t.vals.info.right2Icon)+" ")]),t._v(t._s(t.vals.info.right2Text)+" ")],1),e("v-dialog",{attrs:{"max-width":"420px"},model:{value:t.updateDialog,callback:function(s){t.updateDialog=s},expression:"updateDialog"}},[e("v-card",{attrs:{color:"secondary lighten-2"}},[e("v-card-title",[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.header"))+" "),e("v-spacer"),e("v-btn",{attrs:{icon:"",small:""},on:{click:function(s){t.updateDialog=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.text"))+" ")]),e("v-card-actions",[e("v-spacer"),e("v-btn",{on:{click:function(s){return t.fhemRestart()}}},[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.restartBtn"))+" ")])],1)],1)],1)],1)],1)},a=[],n=e(6198),o=e(2032),l=(e(5666),e(1249),e(8309),e(561),e(1539),e(1830)),r={components:{jsonList:l.Z},props:{item:{type:Object,default:function(){return{name:"sysmon"}}}},data:function(){return{name:"sysmon",app:{options:{updateProcess:!1,debugMode:!1}},setup:{size:"col-12 col-sm-12 col-md-6 col-lg-6",status:{bar:[],error:[],min:0,max:100},subTitle:[],main:[],fhemBtns:!0,info:{left1:[],left2:[],mid1:[],mid2:[],right1:[],right2:[]}},vals:{title:"",subTitle:"",status:{level:0,color:"success"},list:[],info:{left1Icon:"",left1Text:"",left2Icon:"",left2Text:"",mid1Icon:"",mid1Text:"",mid2Icon:"",mid2Text:"",right1Icon:"",right1Text:"",right2Icon:"",right2Text:""}},restart:!0,update:!0,updateText:"",updateDialog:!1}},computed:{getLevel:function(){var t=100/(this.setup.status.max-this.setup.status.min),s=(this.vals.status.level-this.setup.status.min)*t;return this.vals.status.invert?100-s:s}},watch:{item:{immediate:!0,deep:!0,handler:function(t){var s=this.$fhem.getEl(t,"Attributes","alias")||t.Name;this.vals.title=this.$fhem.getEl(t,"Options","name")||s,this.setValues(),this.doList()}},setup:{deep:!0,handler:function(){this.setValues(),this.doList()}},"app.options.updateProcess":function(t){t||(this.updateDialog=!0,this.updateText=this.$t("templates.sysmon.updateBtn[1]"),this.restart=!0)}},mounted:function(){this.app.options=this.$fhem.app.options,this.fhemUpdateCheck();var t=this.$fhem.getEl(this.item,"Options","setup","size"),s=this.$fhem.getEl(this.item,"Options","setup","subTitle"),e=this.$fhem.getEl(this.item,"Options","setup","fhemBtns"),i=this.$fhem.getEl(this.item,"Options","setup","status"),a=this.$fhem.getEl(this.item,"Options","setup","main"),n=this.$fhem.getEl(this.item,"Options","setup","info");t&&(this.setup.size=t),s&&(this.setup.subTitle=s),i&&Object.assign(this.setup.status,i),a&&Object.assign(this.setup.main,a),n&&Object.assign(this.setup.info,n),this.setup.fhemBtns=e},methods:{setValues:function(){var t=this.$fhem.handleVals(this.item,this.setup.status.bar),s=this.$fhem.handleVals(this.item,this.setup.status.error),e=this.$fhem.handleVals(this.item,this.setup.subTitle),i=this.$fhem.handleVals(this.item,this.setup.info.left1),a=this.$fhem.handleVals(this.item,this.setup.info.left2),n=this.$fhem.handleVals(this.item,this.setup.info.mid1),o=this.$fhem.handleVals(this.item,this.setup.info.mid2),l=this.$fhem.handleVals(this.item,this.setup.info.right1),r=this.$fhem.handleVals(this.item,this.setup.info.right2);this.vals.status.level=t[0]||"100",this.vals.status.color=t[1]||"success",this.vals.subTitle=e[0]||"",this.vals.info.left1Icon=i[1]||"",this.vals.info.left1Text=i[0]||"",this.vals.info.left2Icon=a[1]||"",this.vals.info.left2Text=a[0]||"",this.vals.info.mid1Icon=n[1]||"",this.vals.info.mid1Text=n[0]||"",this.vals.info.mid2Icon=o[1]||"",this.vals.info.mid2Text=o[0]||"",this.vals.info.right1Icon=l[1]||"",this.vals.info.right1Text=l[0]||"",this.vals.info.right2Icon=r[1]||"",this.vals.info.right2Text=r[0]||"",s.length>0&&(this.vals.status.level=s[0]||"100",this.vals.status.color=s[1]||"error")},doList:function(){var t,s=(0,o.Z)(this.setup.main);try{for(s.s();!(t=s.n()).done;){var e=t.value,i=this.vals.list.map((function(t){return t.name})).indexOf(e.name),a=this.$fhem.handleVals(this.item,e.bar),n=this.$fhem.handleVals(this.item,e.subText),l={name:e.name,isBar:a.length>0,value:a[0]||0,color:a[1]||"success",min:a[2]||0,max:a[3]||100,subText:n[0]||""};l.isBar&&"success"!=l.color&&(this.vals.status.color=l.color),-1!=i?this.vals.list.splice(i,1,l):this.vals.list.push(l)}}catch(r){s.e(r)}finally{s.f()}},fhemRestart:function(){this.restart=!1,this.updateDialog=!1,this.$fhem.request({param:"cmd",value:"shutdown restart"})},fhemUpdateCheck:function(){var t=this;return(0,n.Z)(regeneratorRuntime.mark((function s(){var e;return regeneratorRuntime.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return e=new Promise((function(s,e){t.restart=!1,t.update=!1,t.updateText=t.$t("templates.sysmon.updateBtn[0]"),t.$fhem.checkUpdate().then((function(e){e?(t.updateText=t.$t("templates.sysmon.updateBtn[2]"),t.update=!0):t.updateText=t.$t("templates.sysmon.updateBtn[1]"),s(e)})).catch((function(s){t.$fhem.log({lvl:1,msg:"Update check failed.",meta:s}),e()})).finally((function(){t.restart=!0}))})),s.abrupt("return",e);case 2:case"end":return s.stop()}}),s)})))()},fhemUpdate:function(){this.restart=!1,this.update=!1,this.updateText=this.$t("templates.sysmon.updateBtn[3]"),this.app.options.updateProcess=!0,this.$fhem.request({param:"cmd",value:"update"})},goTo:function(){this.$router.push("syslog")}}},c=r,h=e(1001),u=e(3453),m=e.n(u),d=e(3150),v=e(2371),p=e(7118),f=e(2102),g=e(4497),_=e(1418),x=e(6428),b=e(7003),T=e(2877),$=e(9762),V=e(2691),y=(0,h.Z)(c,i,a,!1,null,null,null),k=y.exports;m()(y,{VBtn:d.Z,VCard:v.Z,VCardActions:p.h7,VCardSubtitle:p.Qq,VCardText:p.ZB,VCardTitle:p.EB,VCol:f.Z,VDialog:g.Z,VDivider:_.Z,VIcon:x.Z,VProgressLinear:b.Z,VRow:T.Z,VSpacer:$.Z,VSystemBar:V.Z})}}]); \ No newline at end of file diff --git a/www/fhemapp/js/997.e21ab267.js b/www/fhemapp/js/997.e21ab267.js new file mode 100644 index 00000000..a1686e3d --- /dev/null +++ b/www/fhemapp/js/997.e21ab267.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunkfhemapp"]=self["webpackChunkfhemapp"]||[]).push([[997],{1830:function(t,s,e){e.d(s,{Z:function(){return b}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"text-center"},["zzz"!=t.item.Options.sortby?e("v-chip",{attrs:{small:"",color:"secondary"}},[e("v-icon",{attrs:{left:""}},[t._v(" mdi-sort-ascending ")]),t._v(" "+t._s(t.item.Options.sortby)+" ")],1):t._e(),e("v-btn",{attrs:{href:t.toFhem(),target:"_blank",small:"",icon:""}},[e("v-icon",{attrs:{small:""}},[t._v(" mdi-link ")])],1),e("v-dialog",{attrs:{"max-width":"90%",scrollable:""},scopedSlots:t._u([{key:"activator",fn:function(s){var i=s.on,a=s.attrs;return[e("v-btn",t._g(t._b({attrs:{small:"",icon:""}},"v-btn",a,!1),i),[e("v-icon",{attrs:{small:""}},[t._v(" mdi-code-json ")])],1)]}}]),model:{value:t.dialog,callback:function(s){t.dialog=s},expression:"dialog"}},[e("v-card",{staticClass:"secondary lighten-1"},[e("v-card-title",{staticClass:"secondary"},[e("v-btn",{attrs:{icon:""},on:{click:function(s){t.deep=t.deep>1?1:5}}},[e("v-icon",[t._v("mdi-file-tree-outline")])],1),e("v-spacer"),t._v(" "+t._s(t.item.Name)+" "),e("v-spacer"),e("v-btn",{attrs:{icon:""},on:{click:function(s){t.dialog=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[e("div",{ref:"jsonContent",staticClass:"select"},[e("vue-json-pretty",{attrs:{"show-line":!1,deep:t.deep,data:t.item}})],1)])],1)],1)],1)},a=[],l=e(4566),n=e.n(l),o={name:"JsonList",props:{item:{type:Object,default:()=>({name:"json"})}},data(){return{dialog:!1,deep:1}},components:{VueJsonPretty:n()},methods:{toFhem(){let t=this.$fhem.createURL([{param:"detail",value:this.item.Name}]);return t}}},r=o,h=e(1001),c=e(3453),m=e.n(c),d=e(3150),v=e(2371),u=e(7118),p=e(5424),f=e(4497),g=e(6428),_=e(9762),x=(0,h.Z)(r,i,a,!1,null,"4fc9ba56",null),b=x.exports;m()(x,{VBtn:d.Z,VCard:v.Z,VCardText:u.ZB,VCardTitle:u.EB,VChip:p.Z,VDialog:f.Z,VIcon:g.Z,VSpacer:_.Z})},214:function(t,s,e){e.r(s),e.d(s,{default:function(){return V}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("v-col",{class:t.setup.size},[e("v-card",{attrs:{dark:this.$vuetify.theme.dark,color:"secondary"}},[e("v-progress-linear",{attrs:{height:"7",value:t.getLevel,color:t.vals.status.color,"background-color":"secondary darken-1"}}),e("v-card-title",{staticClass:"text-truncate"},[t._v(" "+t._s(t.vals.title)+" "),e("v-spacer"),t.app.options.debugMode?e("jsonList",{attrs:{item:t.item}}):t._e()],1),e("v-divider"),t.item.Options.status.isActive?t._e():e("div",[e("v-card-text",[e("v-row",{attrs:{align:"center"}},[e("v-col",{attrs:{align:"center"}},[e("div",{staticClass:"headline font-weight-bold"},[t._v(" "+t._s(t.item.Options.status.error)+" ")])])],1)],1),e("v-divider")],1),t.item.Options.status.isActive?e("div",[e("v-card-subtitle",[t._v(" "+t._s(t.vals.subTitle)+" ")]),e("v-card-text",[e("v-row",t._l(t.vals.list,(function(s){return e("v-col",{key:s.name,staticClass:"col-12 col-md-4 col-lg-4"},[e("div",{staticClass:"text-truncate"},[t._v(" "+t._s(s.name)+" ")]),s.isBar?e("v-progress-linear",{attrs:{height:"7",value:s.value,color:s.color,min:s.min,max:s.max,"background-color":"secondary lighten-4"}}):t._e(),e("div",[t._v(t._s(s.subText))])],1)})),1)],1),t.setup.fhemBtns?e("v-card-actions",[e("v-btn",{staticClass:"mr-2",on:{click:function(s){return t.goTo()}}},[e("v-icon",[t._v("mdi-format-list-bulleted")])],1),e("v-spacer"),e("v-btn",{attrs:{disabled:!t.update},on:{click:t.fhemUpdate}},[t._v(" "+t._s(t.updateText)+" ")]),e("v-btn",{attrs:{disabled:!t.restart},on:{click:t.fhemRestart}},[t._v(" "+t._s(t.$t("templates.sysmon.restartBtn"))+" ")])],1):t._e()],1):t._e(),e("v-divider"),e("v-system-bar",{attrs:{color:"secondary darken-1"}},[e("v-icon",{staticClass:"ml-0"},[t._v(" "+t._s(t.vals.info.left1Icon)+" ")]),t._v(t._s(t.vals.info.left1Text)+" "),e("v-icon",{staticClass:"ml-2"},[t._v(" "+t._s(t.vals.info.left2Icon)+" ")]),t._v(t._s(t.vals.info.left2Text)+" "),e("v-spacer"),e("v-icon",[t._v(t._s(t.vals.info.mid1Icon))]),t._v(t._s(t.vals.info.mid1Text)+" "),e("v-icon",{staticClass:"ml-2"},[t._v(" "+t._s(t.vals.info.mid2Icon)+" ")]),t._v(t._s(t.vals.info.mid2Text)+" "),e("v-spacer"),e("v-icon",[t._v(t._s(t.vals.info.right1Icon))]),t._v(t._s(t.vals.info.right1Text)+" "),e("v-icon",{staticClass:"ml-2 mr-0"},[t._v(" "+t._s(t.vals.info.right2Icon)+" ")]),t._v(t._s(t.vals.info.right2Text)+" ")],1),e("v-dialog",{attrs:{"max-width":"420px"},model:{value:t.updateDialog,callback:function(s){t.updateDialog=s},expression:"updateDialog"}},[e("v-card",{attrs:{color:"secondary lighten-2"}},[e("v-card-title",[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.header"))+" "),e("v-spacer"),e("v-btn",{attrs:{icon:"",small:""},on:{click:function(s){t.updateDialog=!1}}},[e("v-icon",[t._v("mdi-close")])],1)],1),e("v-card-text",[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.text"))+" ")]),e("v-card-actions",[e("v-spacer"),e("v-btn",{on:{click:function(s){return t.fhemRestart()}}},[t._v(" "+t._s(t.$t("templates.sysmon.updateDialog.restartBtn"))+" ")])],1)],1)],1)],1)],1)},a=[],l=e(1830),n={components:{jsonList:l.Z},props:{item:{type:Object,default:()=>({name:"sysmon"})}},data:()=>({name:"sysmon",app:{options:{updateProcess:!1,debugMode:!1}},setup:{size:"col-12 col-sm-12 col-md-6 col-lg-6",status:{bar:[],error:[],min:0,max:100},subTitle:[],main:[],fhemBtns:!0,info:{left1:[],left2:[],mid1:[],mid2:[],right1:[],right2:[]}},vals:{title:"",subTitle:"",status:{level:0,color:"success"},list:[],info:{left1Icon:"",left1Text:"",left2Icon:"",left2Text:"",mid1Icon:"",mid1Text:"",mid2Icon:"",mid2Text:"",right1Icon:"",right1Text:"",right2Icon:"",right2Text:""}},restart:!0,update:!0,updateText:"",updateDialog:!1}),computed:{getLevel(){let t=100/(this.setup.status.max-this.setup.status.min),s=(this.vals.status.level-this.setup.status.min)*t;return this.vals.status.invert?100-s:s}},watch:{item:{immediate:!0,deep:!0,handler(t){let s=this.$fhem.getEl(t,"Attributes","alias")||t.Name;this.vals.title=this.$fhem.getEl(t,"Options","name")||s,this.setValues(),this.doList()}},setup:{deep:!0,handler(){this.setValues(),this.doList()}},"app.options.updateProcess"(t){t||(this.updateDialog=!0,this.updateText=this.$t("templates.sysmon.updateBtn[1]"),this.restart=!0)}},mounted(){this.app.options=this.$fhem.app.options,this.fhemUpdateCheck();let t=this.$fhem.getEl(this.item,"Options","setup","size"),s=this.$fhem.getEl(this.item,"Options","setup","subTitle"),e=this.$fhem.getEl(this.item,"Options","setup","fhemBtns"),i=this.$fhem.getEl(this.item,"Options","setup","status"),a=this.$fhem.getEl(this.item,"Options","setup","main"),l=this.$fhem.getEl(this.item,"Options","setup","info");t&&(this.setup.size=t),s&&(this.setup.subTitle=s),i&&Object.assign(this.setup.status,i),a&&Object.assign(this.setup.main,a),l&&Object.assign(this.setup.info,l),this.setup.fhemBtns=e},methods:{setValues(){let t=this.$fhem.handleVals(this.item,this.setup.status.bar),s=this.$fhem.handleVals(this.item,this.setup.status.error),e=this.$fhem.handleVals(this.item,this.setup.subTitle),i=this.$fhem.handleVals(this.item,this.setup.info.left1),a=this.$fhem.handleVals(this.item,this.setup.info.left2),l=this.$fhem.handleVals(this.item,this.setup.info.mid1),n=this.$fhem.handleVals(this.item,this.setup.info.mid2),o=this.$fhem.handleVals(this.item,this.setup.info.right1),r=this.$fhem.handleVals(this.item,this.setup.info.right2);this.vals.status.level=t[0]||"100",this.vals.status.color=t[1]||"success",this.vals.subTitle=e[0]||"",this.vals.info.left1Icon=i[1]||"",this.vals.info.left1Text=i[0]||"",this.vals.info.left2Icon=a[1]||"",this.vals.info.left2Text=a[0]||"",this.vals.info.mid1Icon=l[1]||"",this.vals.info.mid1Text=l[0]||"",this.vals.info.mid2Icon=n[1]||"",this.vals.info.mid2Text=n[0]||"",this.vals.info.right1Icon=o[1]||"",this.vals.info.right1Text=o[0]||"",this.vals.info.right2Icon=r[1]||"",this.vals.info.right2Text=r[0]||"",s.length>0&&(this.vals.status.level=s[0]||"100",this.vals.status.color=s[1]||"error")},doList(){for(var t of this.setup.main){let s=this.vals.list.map((t=>t.name)).indexOf(t.name),e=this.$fhem.handleVals(this.item,t.bar),i=this.$fhem.handleVals(this.item,t.subText),a={name:t.name,isBar:e.length>0,value:e[0]||0,color:e[1]||"success",min:e[2]||0,max:e[3]||100,subText:i[0]||""};a.isBar&&"success"!=a.color&&(this.vals.status.color=a.color),-1!=s?this.vals.list.splice(s,1,a):this.vals.list.push(a)}},fhemRestart(){this.restart=!1,this.updateDialog=!1,this.$fhem.request({param:"cmd",value:"shutdown restart"})},async fhemUpdateCheck(){let t=new Promise(((t,s)=>{this.restart=!1,this.update=!1,this.updateText=this.$t("templates.sysmon.updateBtn[0]"),this.$fhem.checkUpdate().then((s=>{s?(this.updateText=this.$t("templates.sysmon.updateBtn[2]"),this.update=!0):this.updateText=this.$t("templates.sysmon.updateBtn[1]"),t(s)})).catch((t=>{this.$fhem.log({lvl:1,msg:"Update check failed.",meta:t}),s()})).finally((()=>{this.restart=!0}))}));return t},fhemUpdate(){this.restart=!1,this.update=!1,this.updateText=this.$t("templates.sysmon.updateBtn[3]"),this.app.options.updateProcess=!0,this.$fhem.request({param:"cmd",value:"update"})},goTo(){this.$router.push("syslog")}}},o=n,r=e(1001),h=e(3453),c=e.n(h),m=e(3150),d=e(2371),v=e(7118),u=e(2102),p=e(4497),f=e(1418),g=e(6428),_=e(7003),x=e(2877),b=e(9762),T=e(2691),$=(0,r.Z)(o,i,a,!1,null,null,null),V=$.exports;c()($,{VBtn:m.Z,VCard:d.Z,VCardActions:v.h7,VCardSubtitle:v.Qq,VCardText:v.ZB,VCardTitle:v.EB,VCol:u.Z,VDialog:p.Z,VDivider:f.Z,VIcon:g.Z,VProgressLinear:_.Z,VRow:x.Z,VSpacer:b.Z,VSystemBar:T.Z})}}]); \ No newline at end of file diff --git a/www/fhemapp/js/app-legacy.99ac0801.js b/www/fhemapp/js/app-legacy.b6a92ef8.js similarity index 98% rename from www/fhemapp/js/app-legacy.99ac0801.js rename to www/fhemapp/js/app-legacy.b6a92ef8.js index cc14875c..8a3f18f6 100644 --- a/www/fhemapp/js/app-legacy.99ac0801.js +++ b/www/fhemapp/js/app-legacy.b6a92ef8.js @@ -1 +1 @@ -(function(){var t={3241:function(t,e,n){"use strict";n(6992),n(8674),n(9601),n(7727);var a=n(144),s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-app",{staticClass:"noselect"},[a("v-overlay",{attrs:{value:t.app.options.loading}},[a("v-progress-circular",{attrs:{indeterminate:"",size:"64"}})],1),a("v-app-bar",{attrs:{app:"",color:t.appBar.color,dark:"","clipped-left":""}},[t.appBar.drawer?t._e():a("div",[a("v-app-bar-nav-icon",{on:{click:function(e){e.stopPropagation(),t.appBar.drawer=!t.appBar.drawer}}})],1),t.appBar.drawer?a("div",{staticClass:"text-h5"},[t._v(" "+t._s(t.appBar.clock)+" ")]):t._e(),a("v-spacer"),t.app.options.mobileHeader?a("div",{staticClass:"text-h5"},[t._v(" "+t._s(t.appBar.header)+" ")]):t._e(),t.app.options.mobileHeader?t._e():a("div",{staticClass:"hidden-md-and-down text-h5"},[t._v(" "+t._s(t.appBar.header)+" ")]),a("v-spacer"),t.app.options.debugMode?a("v-btn",{attrs:{icon:""},on:{click:function(e){return t.goTo("/syslog")}}},[a("v-icon",[t._v("mdi-format-list-bulleted")])],1):t._e(),t.app.options.reloadBtn?a("v-btn",{attrs:{icon:""},on:{click:function(e){return t.reload()}}},[a("v-icon",[t._v("mdi-reload")])],1):t._e(),t.app.options.homeBtn&&!t.appBar.drawer?a("v-btn",{staticClass:"text-h5",attrs:{icon:""},on:{click:function(e){return t.goTo()}}},[a("v-icon",[t._v("mdi-home")])],1):t._e(),a("v-tooltip",{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function(e){var n=e.on,s=e.attrs;return[a("v-icon",t._g(t._b({staticClass:"ml-3",attrs:{small:"",color:t.status.color},domProps:{textContent:t._s(t.status.icon)}},"v-icon",s,!1),n))]}}])},[a("div",{domProps:{textContent:t._s(t.status.text)}}),a("div",{domProps:{textContent:t._s(t.status.time)}})])],1),a("v-navigation-drawer",{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"}},[a("v-img",{attrs:{src:n(2862)}}),a("v-divider"),a("v-list",{attrs:{nav:""}},[a("v-list-item",{key:"home",attrs:{link:"",to:"/"}},[a("v-list-item-icon",[a("v-icon",[t._v("mdi-home")])],1),a("v-list-item-content",[a("v-list-item-title",{staticClass:"text-left"},[t._v(" "+t._s(t.$t("app.navigation.home"))+" ")])],1)],1),a("v-divider"),t.showGroups?a("v-list-group",{attrs:{color:"secondary lighten-4","prepend-icon":"mdi-lightbulb-group",value:t.app.options.expandGroups},scopedSlots:t._u([{key:"activator",fn:function(){return[a("v-list-item-title",[t._v(t._s(t.$t("app.navigation.group")))])]},proxy:!0}],null,!1,444615855)},t._l(t.app.data.groupList,(function(e){return a("v-chip",{key:e.title,staticClass:"ma-2",attrs:{link:"",to:"/devices/"+e.route}},[t._v(" "+t._s(e.title)+" ")])})),1):t._e(),t.showRooms?a("v-list-group",{attrs:{color:"secondary lighten-4","prepend-icon":"mdi-floor-plan",value:t.app.options.expandRooms},scopedSlots:t._u([{key:"activator",fn:function(){return[a("v-list-item-title",[t._v(t._s(t.$t("app.navigation.room")))])]},proxy:!0}],null,!1,438615151)},t._l(t.app.data.roomList,(function(e){return a("v-chip",{key:e.title,staticClass:"ma-2",attrs:{link:"",to:"/devices/"+e.route}},[t._v(" "+t._s(e.title)+" ")])})),1):t._e(),a("v-divider"),a("v-list-item",{key:"dashboard",attrs:{link:"",to:"/dashboard"}},[a("v-list-item-icon",[a("v-icon",[t._v("mdi-view-dashboard")])],1),a("v-list-item-content",[a("v-list-item-title",{staticClass:"text-left"},[t._v(" "+t._s(t.$t("app.navigation.dashboard"))+" ")])],1)],1),a("v-divider"),a("v-list-item",{key:"system",attrs:{link:"",to:"/system"}},[a("v-list-item-icon",[a("v-icon",[t._v("mdi-tools")])],1),a("v-list-item-content",[a("v-list-item-title",{staticClass:"text-left"},[t._v(" "+t._s(t.$t("app.navigation.system"))+" ")])],1)],1),a("v-divider"),a("v-list-item",[a("v-list-item-content",[a("v-list-item-subtitle",[t._v(" "+t._s(t.version)+" ")])],1)],1)],1)],1),a("v-main",[a("v-container",{attrs:{fluid:""}},[a("Broadcaster"),a("router-view")],1)],1)],1)},r=[],i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-alert",{attrs:{value:t.alert,type:t.type,dense:"",text:"",outlined:""}},[n("v-row",{attrs:{align:"center"}},[n("v-col",[n("div",[t._v(" "+t._s(t.message)+" ")]),n("div",[t._v(" "+t._s(t.meta)+" ")])]),n("v-col",{staticClass:"shrink"},[n("v-btn",{attrs:{icon:"",small:""},on:{click:function(e){return t.clearMessage()}}},[n("v-icon",{attrs:{color:t.type}},[t._v(" mdi-close-circle ")])],1)],1)],1)],1)},o=[],p=(n(561),{name:"BroadCaster",data:function(){return{alert:!1,type:"info",types:["","error","info","info","success","warning"],message:"",meta:"",msgList:[]}},watch:{msgList:function(){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:function(){var t=this;this.$fhem.on("message",(function(e){var n={lvl:5,msg:"no valid message received",meta:""};Object.assign(n,e),t.msgList.unshift(n)}))},methods:{clearMessage:function(){this.msgList.length>0&&this.msgList.splice(0,1)}}}),c=p,l=n(1001),u=n(3453),h=n.n(u),d=n(1234),m=n(3150),f=n(2102),v=n(6428),g=n(2877),b=(0,l.Z)(c,i,o,!1,null,null,null),y=b.exports;h()(b,{VAlert:d.Z,VBtn:m.Z,VCol:f.Z,VIcon:v.Z,VRow:g.Z});var k={components:{Broadcaster:y},data:function(){return{appBar:{color:"",drawer:null,clock:null,header:null},app:{options:{loading:!1,reloadBtn:!1,expandGroups:!1,expandRooms:!1},session:{connect:!1},data:{roomList:[],groupList:[]}},version:"v"+n(4147).i8,status:{color:"secondary",icon:"mdi-circle",text:"unbekannt",time:""}}},computed:{showRooms:function(){return this.app.data.roomList.length>0},showGroups:function(){return this.app.data.groupList.length>0}},watch:{"app.session.connect":function(t){this.status.color=t?"success":"error",this.status.text=t?"online":"offline",this.status.time=this.$fhem.getDateTime()}},mounted:function(){this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data,this.appBar=this.$fhem.app.appBar},methods:{reload:function(){location.reload(!0)},goTo:function(t){var e=t||"/";this.$router.currentRoute.path!=e&&this.$router.push(e)}}},x=k,w=n(7524),O=n(426),C=n(5206),Z=n(5424),R=n(9846),_=n(1418),L=n(7047),j=n(6816),T=n(9443),S=n(7620),E=n(1960),I=n(459),V=n(7877),B=n(5132),D=n(1058),A=n(624),P=n(9762),F=n(9330),N=(0,l.Z)(x,s,r,!1,null,"4f254ced",null),M=N.exports;h()(N,{VApp:w.Z,VAppBar:O.Z,VAppBarNavIcon:C.Z,VBtn:m.Z,VChip:Z.Z,VContainer:R.Z,VDivider:_.Z,VIcon:v.Z,VImg:L.Z,VList:j.Z,VListGroup:T.Z,VListItem:S.Z,VListItemContent:E.km,VListItemIcon:I.Z,VListItemSubtitle:E.oZ,VListItemTitle:E.V9,VMain:V.Z,VNavigationDrawer:B.Z,VOverlay:D.Z,VProgressCircular:A.Z,VSpacer:P.Z,VTooltip:F.Z});n(1539),n(8783),n(3948);var H=n(8345);a.Z.use(H.Z);var $=[{path:"/",name:"Home",component:function(){return n.e(320).then(n.bind(n,4320))}},{path:"/system",name:"System",component:function(){return n.e(320).then(n.bind(n,4320))}},{path:"/dashboard",name:"Dashboard",component:function(){return n.e(320).then(n.bind(n,4320))}},{path:"/devices/:filter",name:"Devices",component:function(){return n.e(320).then(n.bind(n,4320))}},{path:"/settings",name:"Settings",component:function(){return n.e(884).then(n.bind(n,6884))}},{path:"/syslog",name:"Syslog",component:function(){return Promise.all([n.e(121),n.e(288),n.e(285),n.e(44)]).then(n.bind(n,4044))}}],U=new H.Z({mode:"hash",base:"",routes:$}),q=U,z=n(9132),G=n(9146),J=n(1846);a.Z.use(z.Z);var X={lang:{locales:{de:G.Z},current:"de"},theme:{dark:!0,themes:{dark:{primary:J.Z.grey.darken4,secondary:J.Z.grey.darken3,success:J.Z.green.accent2,accent:J.Z.green.accent2},light:{primary:J.Z.grey,secondary:J.Z.grey.lighten3,success:J.Z.green.accent3,accent:J.Z.green.accent3}}}},K=new z.Z(X),W=n(7166),Q=n.n(W),Y=(n(4747),n(4916),n(4723),n(7152));function tt(){var t=n(8973),e={};return t.keys().forEach((function(n){var a=n.match(/([A-Za-z0-9-_]+)\./i);if(a&&a.length>1){var s=a[1];e[s]=t(n)}})),e}a.Z.use(Y.Z);var et=new Y.Z({locale:"de",fallbackLocale:"en",messages:tt()}),nt=n(2032),at=n(8932),st=n(6198),rt=n(9726),it=n(6133),ot=n(2751),pt=n(796),ct=n(6035),lt=(n(5666),n(7042),n(3123),n(5306),n(7941),n(8309),n(1249),n(2707),n(9600),n(7601),n(6977),n(9714),n(2222),n(4603),n(8450),n(8386),n(2479),n(7187)),ut=n.n(lt),ht=function(t){(0,pt.Z)(n,t);var e=(0,ct.Z)(n);function n(){var t;return(0,it.Z)(this,n),t=e.call(this),t.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},templates:[],componentMap:[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"weather",component:"templ_weather"},{name:"sysmon",component:"templ_sysmon"},{name:"hmlan",component:"templ_hmlan"},{name:"sonos",component:"templ_sonos"},{name:"scenes",component:"templ_scenes"},{name:"cam",component:"templ_cam"},{name:"iframe",component:"templ_iframe"}],data:{roomList:[],groupList:[],deviceList:[],routeList:[],header:""},hasConnected:[]},t}return(0,ot.Z)(n,[{key:"loading",set:function(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)}},{key:"log",value:function(t){var e=["","mdi-alert-outline","mdi-connection","mdi-send-circle-outline","mdi-sync","mdi-hexagon-multiple-outline"],n=["","error","info","success","success","warning"],a=(new Date).toLocaleTimeString(this.app.options.lang),s=(new Date).getMilliseconds(),r={time:a+":"+("000"+s).slice(-3),msg:t.msg||"",lvl:t.lvl||5,meta:t.meta||null,icon:e[t.lvl||5],color:n[t.lvl||5]};this.app.options.logRecord&&r.lvl<=this.app.options.debugLevel&&(this.app.session.logList.unshift(r),this.app.session.logList.length>this.app.options.logBuffer&&(this.app.session.logList.length=this.app.options.logBuffer)),1==r.lvl&&(this.app.options.loadCount=0,this.app.options.loading=!1,this.emit("message",r))}},{key:"getDate",value:function(t){var e=t?parseInt(t):0;return function(t){return new Date(t.setDate(t.getDate()-e)).toISOString()}(new Date).split("T")[0]}},{key:"getDateTime",value:function(t){var e=t||(new Date).toISOString();return new Date(e.replace(" ","T")).toLocaleString(this.app.options.lang,{dateStyle:"short",timeStyle:"medium"}).replace(",","")}},{key:"createURL",value:function(t){var e=this.app.connection,n=e.location?e.location:"",a=e.port?":"+e.port.replace(":",""):"",s=e.path?"/"+e.path.replace("/",""):"",r="";return"object"==(0,rt.Z)(t)&&t.length>0&&t.forEach((function(t){t.param&&t.value&&(r+=r?"&":"?",r+=t.param+"="+encodeURIComponent(t.value))})),n+a+s+r}},{key:"getEl",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a0?s.push.apply(s,(0,at.Z)(e)):s.push(e)),"string"===typeof e&&s.push({param:"cmd",value:e}),r=this.createURL(s),this.log({lvl:3,msg:"Request: "+r}),t.next=9,fetch(r).then((function(t){var e=null;return"csrf"===n&&(e=t.headers.get("x-fhem-csrftoken")),"json"===n&&(e=t.json()),e||(e=t.text()),"object"===(0,rt.Z)(a)?Object.assign(a,{data:e}):e})).catch((function(t){return i.log({lvl:1,msg:"Request failed "+r,meta:t.message})}));case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})));function e(e,n,a){return t.apply(this,arguments)}return e}()},{key:"getJsonFile",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s,r=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=new Headers,n.append("pragma","no-cache"),n.append("cache-control","no-cache"),a={method:"GET",headers:n},t.next=6,fetch(e,a).then((function(t){return t.json()})).catch((function(t){return r.log({lvl:1,msg:"Read Json-Data from "+e+" failed.",meta:t})}));case 6:return s=t.sent,s&&this.log({lvl:5,msg:"Json-Data parsed from "+e,meta:s}),t.next=10,s;case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"readConfig",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getJsonFile(e);case 2:if(n=t.sent,n){for(a=0,s=Object.keys(n);a0)){t.next=41;break}n=[],a=[],this.app.data.routeList.splice(0),s=(0,nt.Z)(e.Results),t.prev=8,s.s();case 10:if((r=s.n()).done){t.next=27;break}return i=r.value,t.next=14,this.createOptions(i);case 14:if(o=t.sent,!o.template){t.next=25;break}return t.next=18,this.getTemplate(o);case 18:p=t.sent,p&&this.app.templates.push(p),o.room&&this.createNaviItems(o,n,"room"),o.group&&this.createNaviItems(o,a,"group"),o.home&&this.createRoutes(o,"/"),o.dashboard&&this.createRoutes(o,"/dashboard"),o.system&&this.createRoutes(o,"/system");case 25:t.next=10;break;case 27:t.next=32;break;case 29:t.prev=29,t.t0=t["catch"](8),s.e(t.t0);case 32:return t.prev=32,s.f(),t.finish(32);case 35:n.sort((function(t,e){return t.title>e.title?1:e.title>t.title?-1:0})),a.sort((function(t,e){return t.title>e.title?1:e.title>t.title?-1:0})),this.app.data.roomList=Object.assign([],n),this.app.data.groupList=Object.assign([],a),this.app.session.ready=!0,this.loading=!1;case 41:case"end":return t.stop()}}),t,this,[[8,29,32,35]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"createConnected",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s,r,i,o,p,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n={},a=this.app.hasConnected.indexOf(e.Name),-1!=a){t.next=30;break}if(this.app.hasConnected.push(e.Name),!("connected"in e.Options)){t.next=28;break}s=Object.keys(e.Options.connected),r=0,i=s;case 7:if(!(re.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0})),this.app.data.deviceList=Object.assign([],r),this.loading=!1),i++;case 39:t.next=15;break;case 41:t.next=46;break;case 43:t.prev=43,t.t0=t["catch"](13),o.e(t.t0);case 46:return t.prev=46,o.f(),t.finish(46);case 49:case"end":return t.stop()}}),t,this,[[13,43,46,49]])})));function e(e){return t.apply(this,arguments)}return e}()},{key:"checkUpdate",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(){var e,n,a,s,r,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.request([{param:"cmd",value:"update check"},{param:"XHR",value:"1"}]);case 2:if(e=t.sent,n=0,e){a=e.split("\n").splice(2),s=(0,nt.Z)(a);try{for(s.s();!(r=s.n()).done;)i=r.value,i.match("UPD")&&!i.match("excluded")&&n++}catch(o){s.e(o)}finally{s.f()}}return t.abrupt("return",n>0);case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"handleLogData",value:function(t){var e=t.split("\n");e.length>3&&e.splice(-3,3);var n,a=[],s=e.length>this.app.options.maxChartPoints?parseInt(e.length/this.app.options.maxChartPoints):1,r=s,i=0,o=1,p=(0,nt.Z)(e);try{for(p.s();!(n=p.n()).done;){var c=n.value,l=c.split(" "),u=Date.parse(l[0].replace("_","T")),h=parseFloat(l[1]);i+=h,(o>=r||o===e.length)&&(o===e.length&&(s-=r-o),a.push({timestamp:u,value:i/s}),r+=s,i=0),o++}}catch(d){p.e(d)}finally{p.f()}return this.log({lvl:5,msg:"handle Chartdata (Lines: "+e.length+")"}),a}},{key:"readLogData",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s,r,i,o,p,c,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=[],this.loading=!0,!(e.defs&&e.defs.length>0)){t.next=40;break}a=0,s=(0,nt.Z)(e.defs),t.prev=5,s.s();case 7:if((r=s.n()).done){t.next=32;break}return i=r.value,o=/\(.*\)/.exec(i),p=o?i.replace(o[0],"_").split(":"):i.split(":"),c="get ",c+=p[0]?p[0]:e.deviceName,c+=e.from?" - - "+e.from:"",c+=e.to?" "+e.to:"",c+=o?" "+o[0].replace(/\(|\)/g,""):" 4:"+p[1],t.next=18,this.request([{param:"cmd",value:c},{param:"XHR",value:"1"}],"text",{id:a});case 18:if(l=t.sent,!l){t.next=29;break}return t.t0=n,t.t1=l.id,t.t2=this,t.next=25,l.data;case 25:t.t3=t.sent,t.t4=t.t2.handleLogData.call(t.t2,t.t3),t.t5={id:t.t1,data:t.t4},t.t0.push.call(t.t0,t.t5);case 29:a++;case 30:t.next=7;break;case 32:t.next=37;break;case 34:t.prev=34,t.t6=t["catch"](5),s.e(t.t6);case 37:return t.prev=37,s.f(),t.finish(37);case 40:return this.loading=!1,t.abrupt("return",Object.assign(e,{data:n}));case 42:case"end":return t.stop()}}),t,this,[[5,34,37,40]])})));function e(e){return t.apply(this,arguments)}return e}()},{key:"replaceVals",value:function(t,e){for(var n=/-?[0-9]/.exec(e),a=[],s=2;s1?c+"Tage ":c>0?c+"Tag ":"";h+=l>0?l+"h ":"",h+=u>0?u+"min":"",r=t[s].replace("%a",h)}if(/%n/.test(t[s])&&n){/%n.[0-9]/.test(t[s])||(t[s]=t[s].replace("%n","%n.0"));var d=/%n../.exec(t[s]),m=d[0].replace("%n.","");r=t[s].replace(d[0],parseFloat(e.slice(n.index)).toFixed(m))}if(/%i/.test(t[s])&&n){var f=parseFloat(t[s].split("%i")[1]);if("isNaN"!=f){var v=f.toString().split(".")[1]||"",g=v.length,b=parseFloat(e.slice(n.index))+f;r=t[s].replace("%i"+f,b.toFixed(g))}}r=r.replace(/:/g,":"),a.push(r)}return a}},{key:"handleVals",value:function(t,e){var n=[];if("string"===typeof e){var a=("::"+e).split(":");n=this.replaceVals(a,"")}if("object"===(0,rt.Z)(t)&&"object"===(0,rt.Z)(e)&&e.length>0){var s,r=(0,nt.Z)(e);try{for(r.s();!(s=r.n()).done;){var i=s.value,o=i.split(":");if(o.length>2){var p=/\./.test(o[0])?o[0].split("."):["Readings",o[0],"Value"],c=this.getEl.apply(this,[t].concat((0,at.Z)(p)))||this.getEl(t,"Readings",o[0],"Value");if(c){var l=!1,u=parseFloat(o[1]);if(isNaN(u))RegExp(o[1]?o[1]:".").test(c)&&(l=!0);else{var h=/-?[0-9]/.exec(c);-1!=h.index&&parseFloat(c.slice(h.index))>=u&&(l=!0)}if(l){n=this.replaceVals(o,c);break}}}}}catch(d){r.e(d)}finally{r.f()}}return n}},{key:"handleTemplate",value:function(t){var e=this.getEl(t,"Options","setup","show"),n=this.getEl(t,"Options","setup","status","bar"),a=this.getEl(t,"Options","setup","status","error"),s=this.getEl(t,"Options","setup","info");if(e){var r=this.handleVals(t,e);t.Options.show="false"!==r[0],r[1]&&(t.Options.setup.size=r[1]),r[2]&&(t.Options.sortby=r[2])}if(n){var i=this.getEl(t,"Options","setup","status","min")||0,o=this.getEl(t,"Options","setup","status","max")||100,p=this.handleVals(t,n),c=100/(o-i),l=(p[0]||"0"-i)*c;t.Options.status.level=p[2]?100-l:l,t.Options.status.color=p[1]||"success"}if(a){var u=this.handleVals(t,a);u.length>0?(t.Options.status.level=u[0]||"100",t.Options.status.color=u[1]||"error",t.Options.status.error=u[2]||"Fehler",t.Options.status.isActive=!1):t.Options.status.isActive=!0}if(s){var h=this.handleVals(t,s.left1),d=this.handleVals(t,s.left2),m=this.handleVals(t,s.mid1),f=this.handleVals(t,s.mid2),v=this.handleVals(t,s.right1),g=this.handleVals(t,s.right2);t.Options.info.left1IconColor=h[2]||"",t.Options.info.left1Icon=h[1]||"",t.Options.info.left1Text=h[0]||"",t.Options.info.left2IconColor=d[2]||"",t.Options.info.left2Icon=d[1]||"",t.Options.info.left2Text=d[0]||"",t.Options.info.mid1IconColor=m[2]||"",t.Options.info.mid1Icon=m[1]||"",t.Options.info.mid1Text=m[0]||"",t.Options.info.mid2IconColor=f[2]||"",t.Options.info.mid2Icon=f[1]||"",t.Options.info.mid2Text=f[0]||"",t.Options.info.right1IconColor=v[2]||"",t.Options.info.right1Icon=v[1]||"",t.Options.info.right1Text=v[0]||"",t.Options.info.right2IconColor=g[2]||"",t.Options.info.right2Icon=g[1]||"",t.Options.info.right2Text=g[0]||""}}},{key:"handleData",value:function(t){var e=JSON.parse(t),n=null;if(!e[2].match("0){var i=this.handleData(r);if(i){var o,p=0,c=(0,nt.Z)(this.app.data.deviceList);try{for(c.s();!(o=c.n()).done;){var l=o.value,u=this.app.data.deviceList[p],h=Object.assign({},u);if(l.Name===i.Name&&("Readings"===i.devicePart&&this.getEl(h,"Readings",i.param,i.paramPart)&&(h.Readings[i.param][i.paramPart]=i.value),"Attributes"===i.devicePart&&this.getEl(h,"Attributes",i.param)&&(h.Attributes[i.param]=i.value),this.handleTemplate(h),this.app.data.deviceList.splice(p,1,h),this.app.data.deviceList.sort((function(t,e){return t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0}))),"Connected"in l)for(var d=0,m=0,f=Object.values(l.Connected);me.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0}))}d++}p++}}catch(b){c.e(b)}finally{c.f()}}}}}catch(b){s.e(b)}finally{s.f()}}},{key:"connOpen",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.app.session.connect=!0,this.app.session.restartCnt=0,this.log({lvl:2,msg:"Connection with FHEM is opened.",meta:this.app.connection}),t.next=5,this.request({},"csrf");case 5:this.app.session.csrf=t.sent,this.log({lvl:2,msg:"Crsf-Token received.",meta:{token:this.app.session.csrf}}),this.loadStructure();case 8:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"connClose",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.ready=!1,this.app.conn=null,this.app.session.restart||(n=0==this.app.session.restartCnt?1:3e3,this.app.session.restart=!0,setTimeout((function(){s.app.session.restart=!1,s.app.session.restartCnt++,s.connStart()}),n),a={info:"Connection ("+this.app.connection.type+") "+(e?"failed.":"was closed."),errCode:e||""},this.log({lvl:2,msg:"Connection with FHEM was closed. Try to Reconnect in "+n/1e3+" seconds...",meta:a}),this.loading=!1);case 5:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"connStart",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(){var e,n,a=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],n=this.createURL(e),"websocket"===this.app.connection.type?(this.app.conn=new WebSocket(n.replace(/^http/i,"ws")),this.app.conn.onopen=function(){return a.connOpen()},this.app.conn.onmessage=function(t){return a.doUpdate(t)},this.app.conn.onclose=function(){return a.connClose()},this.app.conn.onerror=function(t){return a.connClose(t)}):(this.app.conn=new XMLHttpRequest,this.app.conn.open("GET",n,!0),this.app.conn.onreadystatechange=function(){200===a.app.conn.status&&2===a.app.conn.readyState&&a.connOpen(),200===a.app.conn.status&&3===a.app.conn.readyState&&a.doUpdate()},this.app.conn.onerror=function(t){return a.connClose(t)},this.app.conn.send());case 3:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"setClock",value:function(){var t=new Date;this.app.appBar.clock=t.toLocaleString(this.app.options.lang,this.app.options.clockFormat),this.app.options.mobileHeader||(this.app.appBar.header=t.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}},{key:"init",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e,n){var a=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.log({lvl:2,msg:"Starting FHEMApp..."}),this.loading=!0,t.next=4,this.readConfig("./cfg/config.json");case 4:this.connStart(),e&&this.app.theme&&(-1!=this.app.theme.dark&&Object.assign(e.framework.theme,{dark:this.app.theme.dark}),this.app.theme.themes.light&&Object.assign(e.framework.theme.themes.light,this.app.theme.themes.light),this.app.theme.themes.dark&&Object.assign(e.framework.theme.themes.dark,this.app.theme.themes.dark)),n&&this.app.options.lang&&(n.locale=this.app.options.lang),this.setClock(),setInterval((function(){return a.setClock()}),this.app.options.clockInterval);case 9:case"end":return t.stop()}}),t,this)})));function e(e,n){return t.apply(this,arguments)}return e}()}]),n}(ut()),dt={install:function(t,e,n){t.prototype.$fhem=new ht,t.prototype.$fhem.init(e,n)}};a.Z.use(dt,K,et),a.Z.use(Q()),a.Z.component("apex-chart",Q()),a.Z.config.productionTip=!1,new a.Z({vuetify:K,router:q,i18n:et,render:function(t){return t(M)}}).$mount("#app")},8973:function(t,e,n){var a={"./de.json":9929,"./en.json":790};function s(t){var e=r(t);return n(e)}function r(t){if(!n.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}s.keys=function(){return Object.keys(a)},s.resolve=r,t.exports=s,s.id=8973},2862:function(t,e,n){"use strict";t.exports=n.p+"img/FHEM_Logo.a2a7fc8d.png"},4147:function(t){"use strict";t.exports={i8:"3.30.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"}},"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"}},"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 n(a){var s=e[a];if(void 0!==s)return s.exports;var r=e[a]={exports:{}};return t[a].call(r.exports,r,r.exports,n),r.exports}n.m=t,function(){var t=[];n.O=function(e,a,s,r){if(!a){var i=1/0;for(l=0;l=r)&&Object.keys(n.O).every((function(t){return n.O[t](a[p])}))?a.splice(p--,1):(o=!1,r0&&t[l-1][2]>r;l--)t[l]=t[l-1];t[l]=[a,s,r]}}(),function(){n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,{a:e}),e}}(),function(){n.d=function(t,e){for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}}(),function(){n.f={},n.e=function(t){return Promise.all(Object.keys(n.f).reduce((function(e,a){return n.f[a](t,e),e}),[]))}}(),function(){n.u=function(t){return"js/"+t+"-legacy."+{44:"3af77626",121:"62a3b348",154:"c725f673",285:"39686d97",288:"6d3eb988",320:"363319ed",322:"c29a322f",337:"ef87a395",387:"c8bf8023",396:"c0fe53a6",438:"e54dc5ad",475:"24b478c9",524:"5dc6a0fe",846:"2d01c4df",869:"8b8fa91e",884:"c1922847",947:"43621317"}[t]+".js"}}(),function(){n.miniCssF=function(t){return"css/"+t+"."+{44:"7086d1d2",154:"8ecd64f4",285:"b6c37c1b",288:"a57bcf5c",337:"b2abc4be",387:"5322d21c",396:"8ecd64f4",438:"85e1c6a8",475:"35328724",524:"8ecd64f4",846:"b79779ed",869:"5fde8d03",947:"85e1c6a8"}[t]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){var t={},e="fhemapp:";n.l=function(a,s,r,i){if(t[a])t[a].push(s);else{var o,p;if(void 0!==r)for(var c=document.getElementsByTagName("script"),l=0;l0?(this.type=this.types[this.msgList[0].lvl],this.message=this.msgList[0].msg,this.meta=this.msgList[0].meta,this.alert=!0):(this.alert=!1,this.type="info",this.message="",this.meta="")}},mounted:function(){var t=this;this.$fhem.on("message",(function(e){var n={lvl:5,msg:"no valid message received",meta:""};Object.assign(n,e),t.msgList.unshift(n)}))},methods:{clearMessage:function(){this.msgList.length>0&&this.msgList.splice(0,1)}}}),c=p,l=n(1001),u=n(3453),h=n.n(u),d=n(1234),m=n(3150),f=n(2102),v=n(6428),g=n(2877),b=(0,l.Z)(c,i,o,!1,null,null,null),y=b.exports;h()(b,{VAlert:d.Z,VBtn:m.Z,VCol:f.Z,VIcon:v.Z,VRow:g.Z});var k={components:{Broadcaster:y},data:function(){return{appBar:{color:"",drawer:null,clock:null,header:null},app:{options:{loading:!1,reloadBtn:!1,expandGroups:!1,expandRooms:!1},session:{connect:!1},data:{roomList:[],groupList:[]}},version:"v"+n(4147).i8,status:{color:"secondary",icon:"mdi-circle",text:"unbekannt",time:""}}},computed:{showRooms:function(){return this.app.data.roomList.length>0},showGroups:function(){return this.app.data.groupList.length>0}},watch:{"app.session.connect":function(t){this.status.color=t?"success":"error",this.status.text=t?"online":"offline",this.status.time=this.$fhem.getDateTime()}},mounted:function(){this.app.session=this.$fhem.app.session,this.app.options=this.$fhem.app.options,this.app.data=this.$fhem.app.data,this.appBar=this.$fhem.app.appBar},methods:{reload:function(){location.reload(!0)},goTo:function(t){var e=t||"/";this.$router.currentRoute.path!=e&&this.$router.push(e)}}},x=k,w=n(7524),O=n(426),C=n(5206),Z=n(5424),R=n(9846),_=n(1418),L=n(7047),j=n(6816),T=n(9443),S=n(7620),E=n(1960),I=n(459),V=n(7877),B=n(5132),D=n(1058),A=n(624),P=n(9762),F=n(9330),N=(0,l.Z)(x,s,r,!1,null,"4f254ced",null),M=N.exports;h()(N,{VApp:w.Z,VAppBar:O.Z,VAppBarNavIcon:C.Z,VBtn:m.Z,VChip:Z.Z,VContainer:R.Z,VDivider:_.Z,VIcon:v.Z,VImg:L.Z,VList:j.Z,VListGroup:T.Z,VListItem:S.Z,VListItemContent:E.km,VListItemIcon:I.Z,VListItemSubtitle:E.oZ,VListItemTitle:E.V9,VMain:V.Z,VNavigationDrawer:B.Z,VOverlay:D.Z,VProgressCircular:A.Z,VSpacer:P.Z,VTooltip:F.Z});n(1539),n(8783),n(3948);var H=n(8345);a.Z.use(H.Z);var $=[{path:"/",name:"Home",component:function(){return n.e(320).then(n.bind(n,4320))}},{path:"/system",name:"System",component:function(){return n.e(320).then(n.bind(n,4320))}},{path:"/dashboard",name:"Dashboard",component:function(){return n.e(320).then(n.bind(n,4320))}},{path:"/devices/:filter",name:"Devices",component:function(){return n.e(320).then(n.bind(n,4320))}},{path:"/settings",name:"Settings",component:function(){return n.e(884).then(n.bind(n,6884))}},{path:"/syslog",name:"Syslog",component:function(){return Promise.all([n.e(121),n.e(288),n.e(285),n.e(44)]).then(n.bind(n,4044))}}],U=new H.Z({mode:"hash",base:"",routes:$}),q=U,z=n(9132),G=n(9146),J=n(1846);a.Z.use(z.Z);var X={lang:{locales:{de:G.Z},current:"de"},theme:{dark:!0,themes:{dark:{primary:J.Z.grey.darken4,secondary:J.Z.grey.darken3,success:J.Z.green.accent2,accent:J.Z.green.accent2},light:{primary:J.Z.grey,secondary:J.Z.grey.lighten3,success:J.Z.green.accent3,accent:J.Z.green.accent3}}}},K=new z.Z(X),W=n(7166),Q=n.n(W),Y=(n(4747),n(4916),n(4723),n(7152));function tt(){var t=n(8973),e={};return t.keys().forEach((function(n){var a=n.match(/([A-Za-z0-9-_]+)\./i);if(a&&a.length>1){var s=a[1];e[s]=t(n)}})),e}a.Z.use(Y.Z);var et=new Y.Z({locale:"de",fallbackLocale:"en",messages:tt()}),nt=n(2032),at=n(8932),st=n(6198),rt=n(9726),it=n(6133),ot=n(2751),pt=n(796),ct=n(6035),lt=(n(5666),n(7042),n(3123),n(5306),n(7941),n(8309),n(1249),n(2707),n(9600),n(7601),n(6977),n(9714),n(2222),n(4603),n(8450),n(8386),n(2479),n(7187)),ut=n.n(lt),ht=function(t){(0,pt.Z)(n,t);var e=(0,ct.Z)(n);function n(){var t;return(0,it.Z)(this,n),t=e.call(this),t.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},templates:[],componentMap:[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"weather",component:"templ_weather"},{name:"sysmon",component:"templ_sysmon"},{name:"hmlan",component:"templ_hmlan"},{name:"sonos",component:"templ_sonos"},{name:"scenes",component:"templ_scenes"},{name:"cam",component:"templ_cam"},{name:"iframe",component:"templ_iframe"}],data:{roomList:[],groupList:[],deviceList:[],routeList:[],header:""},hasConnected:[]},t}return(0,ot.Z)(n,[{key:"loading",set:function(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)}},{key:"log",value:function(t){var e=["","mdi-alert-outline","mdi-connection","mdi-send-circle-outline","mdi-sync","mdi-hexagon-multiple-outline"],n=["","error","info","success","success","warning"],a=(new Date).toLocaleTimeString(this.app.options.lang),s=(new Date).getMilliseconds(),r={time:a+":"+("000"+s).slice(-3),msg:t.msg||"",lvl:t.lvl||5,meta:t.meta||null,icon:e[t.lvl||5],color:n[t.lvl||5]};this.app.options.logRecord&&r.lvl<=this.app.options.debugLevel&&(this.app.session.logList.unshift(r),this.app.session.logList.length>this.app.options.logBuffer&&(this.app.session.logList.length=this.app.options.logBuffer)),1==r.lvl&&(this.app.options.loadCount=0,this.app.options.loading=!1,this.emit("message",r))}},{key:"getDate",value:function(t){var e=t?parseInt(t):0;return function(t){return new Date(t.setDate(t.getDate()-e)).toISOString()}(new Date).split("T")[0]}},{key:"getDateTime",value:function(t){var e=t||(new Date).toISOString();return new Date(e.replace(" ","T")).toLocaleString(this.app.options.lang,{dateStyle:"short",timeStyle:"medium"}).replace(",","")}},{key:"createURL",value:function(t){var e=this.app.connection,n=e.location?e.location:"",a=e.port?":"+e.port.replace(":",""):"",s=e.path?"/"+e.path.replace("/",""):"",r="";return"object"==(0,rt.Z)(t)&&t.length>0&&t.forEach((function(t){t.param&&t.value&&(r+=r?"&":"?",r+=t.param+"="+encodeURIComponent(t.value))})),n+a+s+r}},{key:"getEl",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a0?s.push.apply(s,(0,at.Z)(e)):s.push(e)),"string"===typeof e&&s.push({param:"cmd",value:e}),r=this.createURL(s),this.log({lvl:3,msg:"Request: "+r}),t.next=9,fetch(r).then((function(t){var e=null;return"csrf"===n&&(e=t.headers.get("x-fhem-csrftoken")),"json"===n&&(e=t.json()),e||(e=t.text()),"object"===(0,rt.Z)(a)?Object.assign(a,{data:e}):e})).catch((function(t){return i.log({lvl:1,msg:"Request failed "+r,meta:t.message})}));case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})));function e(e,n,a){return t.apply(this,arguments)}return e}()},{key:"getJsonFile",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s,r=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=new Headers,n.append("pragma","no-cache"),n.append("cache-control","no-cache"),a={method:"GET",headers:n},t.next=6,fetch(e,a).then((function(t){return t.json()})).catch((function(t){return r.log({lvl:1,msg:"Read Json-Data from "+e+" failed.",meta:t})}));case 6:return s=t.sent,s&&this.log({lvl:5,msg:"Json-Data parsed from "+e,meta:s}),t.next=10,s;case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"readConfig",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.getJsonFile(e);case 2:if(n=t.sent,n){for(a=0,s=Object.keys(n);a0)){t.next=41;break}n=[],a=[],this.app.data.routeList.splice(0),s=(0,nt.Z)(e.Results),t.prev=8,s.s();case 10:if((r=s.n()).done){t.next=27;break}return i=r.value,t.next=14,this.createOptions(i);case 14:if(o=t.sent,!o.template){t.next=25;break}return t.next=18,this.getTemplate(o);case 18:p=t.sent,p&&this.app.templates.push(p),o.room&&this.createNaviItems(o,n,"room"),o.group&&this.createNaviItems(o,a,"group"),o.home&&this.createRoutes(o,"/"),o.dashboard&&this.createRoutes(o,"/dashboard"),o.system&&this.createRoutes(o,"/system");case 25:t.next=10;break;case 27:t.next=32;break;case 29:t.prev=29,t.t0=t["catch"](8),s.e(t.t0);case 32:return t.prev=32,s.f(),t.finish(32);case 35:n.sort((function(t,e){return t.title>e.title?1:e.title>t.title?-1:0})),a.sort((function(t,e){return t.title>e.title?1:e.title>t.title?-1:0})),this.app.data.roomList=Object.assign([],n),this.app.data.groupList=Object.assign([],a),this.app.session.ready=!0,this.loading=!1;case 41:case"end":return t.stop()}}),t,this,[[8,29,32,35]])})));function e(){return t.apply(this,arguments)}return e}()},{key:"createConnected",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s,r,i,o,p,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n={},a=this.app.hasConnected.indexOf(e.Name),-1!=a){t.next=30;break}if(this.app.hasConnected.push(e.Name),!("connected"in e.Options)){t.next=28;break}s=Object.keys(e.Options.connected),r=0,i=s;case 7:if(!(re.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0})),this.app.data.deviceList=Object.assign([],r),this.loading=!1),i++;case 39:t.next=15;break;case 41:t.next=46;break;case 43:t.prev=43,t.t0=t["catch"](13),o.e(t.t0);case 46:return t.prev=46,o.f(),t.finish(46);case 49:case"end":return t.stop()}}),t,this,[[13,43,46,49]])})));function e(e){return t.apply(this,arguments)}return e}()},{key:"checkUpdate",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(){var e,n,a,s,r,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.request([{param:"cmd",value:"update check"},{param:"XHR",value:"1"}]);case 2:if(e=t.sent,n=0,e){a=e.split("\n").splice(2),s=(0,nt.Z)(a);try{for(s.s();!(r=s.n()).done;)i=r.value,i.match("UPD")&&!i.match("excluded")&&n++}catch(o){s.e(o)}finally{s.f()}}return t.abrupt("return",n>0);case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"handleLogData",value:function(t){var e=t.split("\n");e.length>3&&e.splice(-3,3);var n,a=[],s=e.length>this.app.options.maxChartPoints?parseInt(e.length/this.app.options.maxChartPoints):1,r=s,i=0,o=1,p=(0,nt.Z)(e);try{for(p.s();!(n=p.n()).done;){var c=n.value,l=c.split(" "),u=Date.parse(l[0].replace("_","T")),h=parseFloat(l[1]);i+=h,(o>=r||o===e.length)&&(o===e.length&&(s-=r-o),a.push({timestamp:u,value:i/s}),r+=s,i=0),o++}}catch(d){p.e(d)}finally{p.f()}return this.log({lvl:5,msg:"handle Chartdata (Lines: "+e.length+")"}),a}},{key:"readLogData",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s,r,i,o,p,c,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=[],this.loading=!0,!(e.defs&&e.defs.length>0)){t.next=40;break}a=0,s=(0,nt.Z)(e.defs),t.prev=5,s.s();case 7:if((r=s.n()).done){t.next=32;break}return i=r.value,o=/\(.*\)/.exec(i),p=o?i.replace(o[0],"_").split(":"):i.split(":"),c="get ",c+=p[0]?p[0]:e.deviceName,c+=e.from?" - - "+e.from:"",c+=e.to?" "+e.to:"",c+=o?" "+o[0].replace(/\(|\)/g,""):" 4:"+p[1],t.next=18,this.request([{param:"cmd",value:c},{param:"XHR",value:"1"}],"text",{id:a});case 18:if(l=t.sent,!l){t.next=29;break}return t.t0=n,t.t1=l.id,t.t2=this,t.next=25,l.data;case 25:t.t3=t.sent,t.t4=t.t2.handleLogData.call(t.t2,t.t3),t.t5={id:t.t1,data:t.t4},t.t0.push.call(t.t0,t.t5);case 29:a++;case 30:t.next=7;break;case 32:t.next=37;break;case 34:t.prev=34,t.t6=t["catch"](5),s.e(t.t6);case 37:return t.prev=37,s.f(),t.finish(37);case 40:return this.loading=!1,t.abrupt("return",Object.assign(e,{data:n}));case 42:case"end":return t.stop()}}),t,this,[[5,34,37,40]])})));function e(e){return t.apply(this,arguments)}return e}()},{key:"replaceVals",value:function(t,e){for(var n=/-?[0-9]/.exec(e),a=[],s=2;s1?c+"Tage ":c>0?c+"Tag ":"";h+=l>0?l+"h ":"",h+=u>0?u+"min":"",r=t[s].replace("%a",h)}if(/%n/.test(t[s])&&n){/%n.[0-9]/.test(t[s])||(t[s]=t[s].replace("%n","%n.0"));var d=/%n../.exec(t[s]),m=d[0].replace("%n.","");r=t[s].replace(d[0],parseFloat(e.slice(n.index)).toFixed(m))}if(/%i/.test(t[s])&&n){var f=parseFloat(t[s].split("%i")[1]);if("isNaN"!=f){var v=f.toString().split(".")[1]||"",g=v.length,b=parseFloat(e.slice(n.index))+f;r=t[s].replace("%i"+f,b.toFixed(g))}}r=r.replace(/:/g,":"),a.push(r)}return a}},{key:"handleVals",value:function(t,e){var n=[];if("string"===typeof e){var a=("::"+e).split(":");n=this.replaceVals(a,"")}if("object"===(0,rt.Z)(t)&&"object"===(0,rt.Z)(e)&&e.length>0){var s,r=(0,nt.Z)(e);try{for(r.s();!(s=r.n()).done;){var i=s.value,o=i.split(":");if(o.length>2){var p=/\./.test(o[0])?o[0].split("."):["Readings",o[0],"Value"],c=this.getEl.apply(this,[t].concat((0,at.Z)(p)))||this.getEl(t,"Readings",o[0],"Value");if(c){var l=!1,u=parseFloat(o[1]);if(isNaN(u))RegExp(o[1]?o[1]:".").test(c)&&(l=!0);else{var h=/-?[0-9]/.exec(c);-1!=h.index&&parseFloat(c.slice(h.index))>=u&&(l=!0)}if(l){n=this.replaceVals(o,c);break}}}}}catch(d){r.e(d)}finally{r.f()}}return n}},{key:"handleTemplate",value:function(t){var e=this.getEl(t,"Options","setup","show"),n=this.getEl(t,"Options","setup","status","bar"),a=this.getEl(t,"Options","setup","status","error"),s=this.getEl(t,"Options","setup","info");if(e){var r=this.handleVals(t,e);t.Options.show="false"!==r[0],r[1]&&(t.Options.setup.size=r[1]),r[2]&&(t.Options.sortby=r[2])}if(n){var i=this.getEl(t,"Options","setup","status","min")||0,o=this.getEl(t,"Options","setup","status","max")||100,p=this.handleVals(t,n),c=100/(o-i),l=(p[0]||"0"-i)*c;t.Options.status.level=p[2]?100-l:l,t.Options.status.color=p[1]||"success"}if(a){var u=this.handleVals(t,a);u.length>0?(t.Options.status.level=u[0]||"100",t.Options.status.color=u[1]||"error",t.Options.status.error=u[2]||"Fehler",t.Options.status.isActive=!1):t.Options.status.isActive=!0}if(s){var h=this.handleVals(t,s.left1),d=this.handleVals(t,s.left2),m=this.handleVals(t,s.mid1),f=this.handleVals(t,s.mid2),v=this.handleVals(t,s.right1),g=this.handleVals(t,s.right2);t.Options.info.left1IconColor=h[2]||"",t.Options.info.left1Icon=h[1]||"",t.Options.info.left1Text=h[0]||"",t.Options.info.left2IconColor=d[2]||"",t.Options.info.left2Icon=d[1]||"",t.Options.info.left2Text=d[0]||"",t.Options.info.mid1IconColor=m[2]||"",t.Options.info.mid1Icon=m[1]||"",t.Options.info.mid1Text=m[0]||"",t.Options.info.mid2IconColor=f[2]||"",t.Options.info.mid2Icon=f[1]||"",t.Options.info.mid2Text=f[0]||"",t.Options.info.right1IconColor=v[2]||"",t.Options.info.right1Icon=v[1]||"",t.Options.info.right1Text=v[0]||"",t.Options.info.right2IconColor=g[2]||"",t.Options.info.right2Icon=g[1]||"",t.Options.info.right2Text=g[0]||""}}},{key:"handleData",value:function(t){var e=JSON.parse(t),n=null;if(!e[2].match("0){var i=this.handleData(r);if(i){var o,p=0,c=(0,nt.Z)(this.app.data.deviceList);try{for(c.s();!(o=c.n()).done;){var l=o.value,u=this.app.data.deviceList[p],h=Object.assign({},u);if(l.Name===i.Name&&("Readings"===i.devicePart&&this.getEl(h,"Readings",i.param,i.paramPart)&&(h.Readings[i.param][i.paramPart]=i.value),"Attributes"===i.devicePart&&this.getEl(h,"Attributes",i.param)&&(h.Attributes[i.param]=i.value),this.handleTemplate(h),this.app.data.deviceList.splice(p,1,h),this.app.data.deviceList.sort((function(t,e){return t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0}))),"Connected"in l)for(var d=0,m=0,f=Object.values(l.Connected);me.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0}))}d++}p++}}catch(b){c.e(b)}finally{c.f()}}}}}catch(b){s.e(b)}finally{s.f()}}},{key:"connOpen",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.app.session.connect=!0,this.app.session.restartCnt=0,this.log({lvl:2,msg:"Connection with FHEM is opened.",meta:this.app.connection}),t.next=5,this.request({},"csrf");case 5:this.app.session.csrf=t.sent,this.log({lvl:2,msg:"Crsf-Token received.",meta:{token:this.app.session.csrf}}),this.loadStructure();case 8:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"connClose",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e){var n,a,s=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:this.app.session.connect=!1,this.app.session.csrf=null,this.app.session.ready=!1,this.app.conn=null,this.app.session.restart||(n=0==this.app.session.restartCnt?1:3e3,this.app.session.restart=!0,setTimeout((function(){s.app.session.restart=!1,s.app.session.restartCnt++,s.connStart()}),n),a={info:"Connection ("+this.app.connection.type+") "+(e?"failed.":"was closed."),errCode:e||""},this.log({lvl:2,msg:"Connection with FHEM was closed. Try to Reconnect in "+n/1e3+" seconds...",meta:a}),this.loading=!1);case 5:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"connStart",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(){var e,n,a=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e=[{param:"inform",value:"type=status;filter=.*;fmt=JSON"},{param:"XHR",value:"1"}],n=this.createURL(e),"websocket"===this.app.connection.type?(this.app.conn=new WebSocket(n.replace(/^http/i,"ws")),this.app.conn.onopen=function(){return a.connOpen()},this.app.conn.onmessage=function(t){return a.doUpdate(t)},this.app.conn.onclose=function(){return a.connClose()},this.app.conn.onerror=function(t){return a.connClose(t)}):(this.app.conn=new XMLHttpRequest,this.app.conn.open("GET",n,!0),this.app.conn.onreadystatechange=function(){200===a.app.conn.status&&2===a.app.conn.readyState&&a.connOpen(),200===a.app.conn.status&&3===a.app.conn.readyState&&a.doUpdate()},this.app.conn.onerror=function(t){return a.connClose(t)},this.app.conn.send());case 3:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"setClock",value:function(){var t=new Date;this.app.appBar.clock=t.toLocaleString(this.app.options.lang,this.app.options.clockFormat),this.app.options.mobileHeader||(this.app.appBar.header=t.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}},{key:"init",value:function(){var t=(0,st.Z)(regeneratorRuntime.mark((function t(e,n){var a=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return this.log({lvl:2,msg:"Starting FHEMApp..."}),this.loading=!0,t.next=4,this.readConfig("./cfg/config.json");case 4:this.connStart(),e&&this.app.theme&&(-1!=this.app.theme.dark&&Object.assign(e.framework.theme,{dark:this.app.theme.dark}),this.app.theme.themes.light&&Object.assign(e.framework.theme.themes.light,this.app.theme.themes.light),this.app.theme.themes.dark&&Object.assign(e.framework.theme.themes.dark,this.app.theme.themes.dark)),n&&this.app.options.lang&&(n.locale=this.app.options.lang),this.setClock(),setInterval((function(){return a.setClock()}),this.app.options.clockInterval);case 9:case"end":return t.stop()}}),t,this)})));function e(e,n){return t.apply(this,arguments)}return e}()}]),n}(ut()),dt={install:function(t,e,n){t.prototype.$fhem=new ht,t.prototype.$fhem.init(e,n)}};a.Z.use(dt,K,et),a.Z.use(Q()),a.Z.component("apex-chart",Q()),a.Z.config.productionTip=!1,new a.Z({vuetify:K,router:q,i18n:et,render:function(t){return t(M)}}).$mount("#app")},8973:function(t,e,n){var a={"./de.json":9929,"./en.json":790};function s(t){var e=r(t);return n(e)}function r(t){if(!n.o(a,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return a[t]}s.keys=function(){return Object.keys(a)},s.resolve=r,t.exports=s,s.id=8973},2862:function(t,e,n){"use strict";t.exports=n.p+"img/FHEM_Logo.a2a7fc8d.png"},4147:function(t){"use strict";t.exports={i8:"3.30.3"}},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"}},"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"}},"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 n(a){var s=e[a];if(void 0!==s)return s.exports;var r=e[a]={exports:{}};return t[a].call(r.exports,r,r.exports,n),r.exports}n.m=t,function(){var t=[];n.O=function(e,a,s,r){if(!a){var i=1/0;for(l=0;l=r)&&Object.keys(n.O).every((function(t){return n.O[t](a[p])}))?a.splice(p--,1):(o=!1,r0&&t[l-1][2]>r;l--)t[l]=t[l-1];t[l]=[a,s,r]}}(),function(){n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,{a:e}),e}}(),function(){n.d=function(t,e){for(var a in e)n.o(e,a)&&!n.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})}}(),function(){n.f={},n.e=function(t){return Promise.all(Object.keys(n.f).reduce((function(e,a){return n.f[a](t,e),e}),[]))}}(),function(){n.u=function(t){return"js/"+t+"-legacy."+{44:"3af77626",121:"62a3b348",154:"c725f673",285:"39686d97",288:"6d3eb988",320:"be5fa758",322:"c29a322f",337:"ef87a395",387:"c8bf8023",396:"c0fe53a6",438:"e54dc5ad",475:"24b478c9",846:"2d01c4df",869:"8b8fa91e",884:"c1922847",947:"43621317",997:"64da21ee"}[t]+".js"}}(),function(){n.miniCssF=function(t){return"css/"+t+"."+{44:"7086d1d2",154:"8ecd64f4",285:"b6c37c1b",288:"a57bcf5c",337:"b2abc4be",387:"5322d21c",396:"8ecd64f4",438:"85e1c6a8",475:"35328724",846:"b79779ed",869:"5fde8d03",947:"85e1c6a8",997:"8ecd64f4"}[t]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}()}(),function(){n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(),function(){var t={},e="fhemapp:";n.l=function(a,s,r,i){if(t[a])t[a].push(s);else{var o,p;if(void 0!==r)for(var c=document.getElementsByTagName("script"),l=0;l({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)}}},p=l,c=s(1001),h=s(3453),d=s.n(h),u=s(1234),m=s(3150),f=s(2102),g=s(6428),v=s(2877),b=(0,c.Z)(p,i,r,!1,null,null,null),y=b.exports;d()(b,{VAlert:u.Z,VBtn:m.Z,VCol:f.Z,VIcon:g.Z,VRow:v.Z});var O={components:{Broadcaster:y},data:()=>({appBar:{color:"",drawer:null,clock:null,header:null},app:{options:{loading:!1,reloadBtn:!1,expandGroups:!1,expandRooms:!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)}}},w=O,C=s(7524),k=s(426),x=s(5206),_=s(5424),L=s(9846),R=s(1418),j=s(7047),T=s(6816),S=s(9443),Z=s(7620),E=s(1960),I=s(459),V=s(7877),B=s(5132),D=s(1058),P=s(624),A=s(9762),F=s(9330),N=(0,c.Z)(w,a,o,!1,null,"4f254ced",null),M=N.exports;d()(N,{VApp:C.Z,VAppBar:k.Z,VAppBarNavIcon:x.Z,VBtn:m.Z,VChip:_.Z,VContainer:L.Z,VDivider:R.Z,VIcon:g.Z,VImg:j.Z,VList:T.Z,VListGroup:S.Z,VListItem:Z.Z,VListItemContent:E.km,VListItemIcon:I.Z,VListItemSubtitle:E.oZ,VListItemTitle:E.V9,VMain:V.Z,VNavigationDrawer:B.Z,VOverlay:D.Z,VProgressCircular:P.Z,VSpacer:A.Z,VTooltip:F.Z});var H=s(8345);n.Z.use(H.Z);const $=[{path:"/",name:"Home",component:()=>s.e(320).then(s.bind(s,4320))},{path:"/system",name:"System",component:()=>s.e(320).then(s.bind(s,4320))},{path:"/dashboard",name:"Dashboard",component:()=>s.e(320).then(s.bind(s,4320))},{path:"/devices/:filter",name:"Devices",component:()=>s.e(320).then(s.bind(s,4320))},{path:"/settings",name:"Settings",component:()=>s.e(884).then(s.bind(s,6884))},{path:"/syslog",name:"Syslog",component:()=>Promise.all([s.e(121),s.e(288),s.e(285),s.e(44)]).then(s.bind(s,4044))}],U=new H.Z({mode:"hash",base:"",routes:$});var q=U,z=s(9132),G=s(9146),J=s(1846);n.Z.use(z.Z);const X={lang:{locales:{de:G.Z},current:"de"},theme:{dark:!0,themes:{dark:{primary:J.Z.grey.darken4,secondary:J.Z.grey.darken3,success:J.Z.green.accent2,accent:J.Z.green.accent2},light:{primary:J.Z.grey,secondary:J.Z.grey.lighten3,success:J.Z.green.accent3,accent:J.Z.green.accent3}}}};var K=new z.Z(X),W=s(7166),Q=s.n(W),Y=s(7152);function tt(){const t=s(8973),e={};return t.keys().forEach((s=>{const n=s.match(/([A-Za-z0-9-_]+)\./i);if(n&&n.length>1){const a=n[1];e[a]=t(s)}})),e}n.Z.use(Y.Z);var et=new Y.Z({locale:"de",fallbackLocale:"en",messages:tt()}),st=s(7187),nt=s.n(st);class at extends(nt()){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},templates:[],componentMap:[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"weather",component:"templ_weather"},{name:"sysmon",component:"templ_sysmon"},{name:"hmlan",component:"templ_hmlan"},{name:"sonos",component:"templ_sonos"},{name:"scenes",component:"templ_scenes"},{name:"cam",component:"templ_cam"},{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"],n=(new Date).toLocaleTimeString(this.app.options.lang),a=(new Date).getMilliseconds(),o={time:n+":"+("000"+a).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]}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:"",n=e.port?":"+e.port.replace(":",""):"",a=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+n+a+o}getEl(t,...e){return e.reduce(((t,e)=>t&&t[e]),t)}async request(t,e,s){let n=[];"csrf"!=e&&n.push({param:"fwcsrf",value:this.app.session.csrf}),"json"!==e&&"csrf"!==e||n.push({param:"XHR",value:"1"}),"object"===typeof t&&(t.length>0?n.push(...t):n.push(t)),"string"===typeof t&&n.push({param:"cmd",value:t});let a=this.createURL(n);return this.log({lvl:3,msg:"Request: "+a}),await fetch(a).then((t=>{let n=null;return"csrf"===e&&(n=t.headers.get("x-fhem-csrftoken")),"json"===e&&(n=t.json()),n||(n=t.text()),"object"===typeof s?Object.assign(s,{data:n}):n})).catch((t=>this.log({lvl:1,msg:"Request failed "+a,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},n=await fetch(t,s).then((t=>t.json())).catch((e=>this.log({lvl:1,msg:"Read Json-Data from "+t+" failed.",meta:e})));return n&&this.log({lvl:5,msg:"Json-Data parsed from "+t,meta:n}),await n}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 n=t[s].split(",");for(const a of n){let n=s+"="+a;-1==e.map((t=>t.title)).indexOf(a)&&e.push({title:a,route:n}),this.createRoutes(t,n)}}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 n of t.Results){let t=await this.createOptions(n);if(t.template){let n=await this.getTemplate(t);n&&this.app.templates.push(n),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 n of s){let s=await this.request({param:"cmd",value:"jsonlist2 "+t.Options.connected[n]},"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[n]=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=[],n=1;for(const s of t.Results){"PossibleSets"in s&&delete s.PossibleSets,"PossibleAttrs"in s&&delete s.PossibleAttrs;let a=await this.createOptions(s),o=this.getComponent(a.template);if(Object.assign(a,o),"templ_default"===a.component){let t=await this.getSetup(a.template);a.setup&&Object.assign(t,a.setup),a.setup=t}s.Options=a,s.Options.connected&&(s.Connected=await this.createConnected(s)),this.handleTemplate(s),e.push(s),n===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),n++}}}}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){let e=t.split("\n");e.length>3&&e.splice(-3,3);let s=[],n=e.length>this.app.options.maxChartPoints?parseInt(e.length/this.app.options.maxChartPoints):1,a=n,o=0,i=1;for(const r of e){let t=r.split(" "),l=Date.parse(t[0].replace("_","T")),p=parseFloat(t[1]);o+=p,(i>=a||i===e.length)&&(i===e.length&&(n-=a-i),s.push({timestamp:l,value:o/n}),a+=n,o=0),i++}return this.log({lvl:5,msg:"handle Chartdata (Lines: "+e.length+")"}),s}async readLogData(t){let e=[];if(this.loading=!0,t.defs&&t.defs.length>0){let s=0;for(const n of t.defs){let a=/\(.*\)/.exec(n),o=a?n.replace(a[0],"_").split(":"):n.split(":"),i="get ";i+=o[0]?o[0]:t.deviceName,i+=t.from?" - - "+t.from:"",i+=t.to?" "+t.to:"",i+=a?" "+a[0].replace(/\(|\)/g,""):" 4:"+o[1];let r=await this.request([{param:"cmd",value:i},{param:"XHR",value:"1"}],"text",{id:s});r&&e.push({id:r.id,data:this.handleLogData(await r.data)}),s++}}return this.loading=!1,Object.assign(t,{data:e})}replaceVals(t,e){let s=/-?[0-9]/.exec(e),n=[];for(var a=2;a1?r+"Tage ":r>0?r+"Tag ":"";c+=l>0?l+"h ":"",c+=p>0?p+"min":"",o=t[a].replace("%a",c)}if(/%n/.test(t[a])&&s){/%n.[0-9]/.test(t[a])||(t[a]=t[a].replace("%n","%n.0"));let n=/%n../.exec(t[a]),i=n[0].replace("%n.","");o=t[a].replace(n[0],parseFloat(e.slice(s.index)).toFixed(i))}if(/%i/.test(t[a])&&s){let n=parseFloat(t[a].split("%i")[1]);if("isNaN"!=n){let i=n.toString().split(".")[1]||"",r=i.length,l=parseFloat(e.slice(s.index))+n;o=t[a].replace("%i"+n,l.toFixed(r))}}o=o.replace(/:/g,":"),n.push(o)}return n}handleVals(t,e){let s=[];if("string"===typeof e){let t=("::"+e).split(":");s=this.replaceVals(t,"")}if("object"===typeof t&&"object"===typeof e&&e.length>0)for(const n of e){let e=n.split(":");if(e.length>2){let n=/\./.test(e[0])?e[0].split("."):["Readings",e[0],"Value"],a=this.getEl(t,...n)||this.getEl(t,"Readings",e[0],"Value");if(a){let t=!1,n=parseFloat(e[1]);if(isNaN(n))RegExp(e[1]?e[1]:".").test(a)&&(t=!0);else{let e=/-?[0-9]/.exec(a);-1!=e.index&&parseFloat(a.slice(e.index))>=n&&(t=!0)}if(t){s=this.replaceVals(e,a);break}}}}return s}handleTemplate(t){let e=this.getEl(t,"Options","setup","show"),s=this.getEl(t,"Options","setup","status","bar"),n=this.getEl(t,"Options","setup","status","error"),a=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,n=this.getEl(t,"Options","setup","status","max")||100,a=this.handleVals(t,s),o=100/(n-e),i=(a[0]||"0"-e)*o;t.Options.status.level=a[2]?100-i:i,t.Options.status.color=a[1]||"success"}if(n){let e=this.handleVals(t,n);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(a){let e=this.handleVals(t,a.left1),s=this.handleVals(t,a.left2),n=this.handleVals(t,a.mid1),o=this.handleVals(t,a.mid2),i=this.handleVals(t,a.right1),r=this.handleVals(t,a.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=n[2]||"",t.Options.info.mid1Icon=n[1]||"",t.Options.info.mid1Text=n[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 n=this.app.data.deviceList[e],a=Object.assign({},n);if(s.Name===t.Name&&("Readings"===t.devicePart&&this.getEl(a,"Readings",t.param,t.paramPart)&&(a.Readings[t.param][t.paramPart]=t.value),"Attributes"===t.devicePart&&this.getEl(a,"Attributes",t.param)&&(a.Attributes[t.param]=t.value),this.handleTemplate(a),this.app.data.deviceList.splice(e,1,a),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 n=0;for(const o of Object.values(s.Connected)){if(o.Name===t.Name){let o=Object.keys(s.Connected)[n];"Readings"===t.devicePart&&this.getEl(a.Connected[o],"Readings",t.param,t.paramPart)&&(a.Connected[o].Readings[t.param][t.paramPart]=t.value),"Attributes"===t.devicePart&&this.getEl(a.Connected[o],"Attributes",t.param)&&(a.Connected[o].Attributes[t.param]=t.value),this.handleTemplate(a),this.app.data.deviceList.splice(e,1,a),this.app.data.deviceList.sort(((t,e)=>t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0))}n++}}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.options.mobileHeader||(this.app.appBar.header=t.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}async init(t,e){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 ot={install(t,e,s){t.prototype.$fhem=new at,t.prototype.$fhem.init(e,s)}};n.Z.use(ot,K,et),n.Z.use(Q()),n.Z.component("apex-chart",Q()),n.Z.config.productionTip=!1,new n.Z({vuetify:K,router:q,i18n:et,render:t=>t(M)}).$mount("#app")},8973:function(t,e,s){var n={"./de.json":9929,"./en.json":790};function a(t){var e=o(t);return s(e)}function o(t){if(!s.o(n,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return n[t]}a.keys=function(){return Object.keys(n)},a.resolve=o,t.exports=a,a.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.30.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"}},"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"}},"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(n){var a=e[n];if(void 0!==a)return a.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,s),o.exports}s.m=t,function(){var t=[];s.O=function(e,n,a,o){if(!n){var i=1/0;for(c=0;c=o)&&Object.keys(s.O).every((function(t){return s.O[t](n[l])}))?n.splice(l--,1):(r=!1,o0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[n,a,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 n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}}(),function(){s.f={},s.e=function(t){return Promise.all(Object.keys(s.f).reduce((function(e,n){return s.f[n](t,e),e}),[]))}}(),function(){s.u=function(t){return"js/"+t+"."+{44:"1ae09cf8",121:"006dace8",154:"cb009208",285:"6fc47f33",288:"6d3eb988",320:"14e9d509",322:"a37a620a",337:"3c817406",387:"06272897",396:"02bb2eaa",438:"27924680",475:"e1a25454",524:"c1bbbde3",846:"510798d7",869:"df959138",884:"472374d2",947:"371294c0"}[t]+".js"}}(),function(){s.miniCssF=function(t){return"css/"+t+"."+{44:"7086d1d2",154:"8ecd64f4",285:"b6c37c1b",288:"a57bcf5c",337:"b2abc4be",387:"5322d21c",396:"8ecd64f4",438:"85e1c6a8",475:"35328724",524:"8ecd64f4",846:"b79779ed",869:"5fde8d03",947:"85e1c6a8"}[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(n,a,o,i){if(t[n])t[n].push(a);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)}}},p=l,c=s(1001),h=s(3453),d=s.n(h),u=s(1234),m=s(3150),f=s(2102),g=s(6428),v=s(2877),b=(0,c.Z)(p,i,r,!1,null,null,null),y=b.exports;d()(b,{VAlert:u.Z,VBtn:m.Z,VCol:f.Z,VIcon:g.Z,VRow:v.Z});var O={components:{Broadcaster:y},data:()=>({appBar:{color:"",drawer:null,clock:null,header:null},app:{options:{loading:!1,reloadBtn:!1,expandGroups:!1,expandRooms:!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)}}},w=O,C=s(7524),k=s(426),x=s(5206),_=s(5424),L=s(9846),R=s(1418),j=s(7047),T=s(6816),S=s(9443),Z=s(7620),E=s(1960),I=s(459),V=s(7877),B=s(5132),D=s(1058),P=s(624),A=s(9762),F=s(9330),N=(0,c.Z)(w,a,o,!1,null,"4f254ced",null),M=N.exports;d()(N,{VApp:C.Z,VAppBar:k.Z,VAppBarNavIcon:x.Z,VBtn:m.Z,VChip:_.Z,VContainer:L.Z,VDivider:R.Z,VIcon:g.Z,VImg:j.Z,VList:T.Z,VListGroup:S.Z,VListItem:Z.Z,VListItemContent:E.km,VListItemIcon:I.Z,VListItemSubtitle:E.oZ,VListItemTitle:E.V9,VMain:V.Z,VNavigationDrawer:B.Z,VOverlay:D.Z,VProgressCircular:P.Z,VSpacer:A.Z,VTooltip:F.Z});var H=s(8345);n.Z.use(H.Z);const $=[{path:"/",name:"Home",component:()=>s.e(320).then(s.bind(s,4320))},{path:"/system",name:"System",component:()=>s.e(320).then(s.bind(s,4320))},{path:"/dashboard",name:"Dashboard",component:()=>s.e(320).then(s.bind(s,4320))},{path:"/devices/:filter",name:"Devices",component:()=>s.e(320).then(s.bind(s,4320))},{path:"/settings",name:"Settings",component:()=>s.e(884).then(s.bind(s,6884))},{path:"/syslog",name:"Syslog",component:()=>Promise.all([s.e(121),s.e(288),s.e(285),s.e(44)]).then(s.bind(s,4044))}],U=new H.Z({mode:"hash",base:"",routes:$});var q=U,z=s(9132),G=s(9146),J=s(1846);n.Z.use(z.Z);const X={lang:{locales:{de:G.Z},current:"de"},theme:{dark:!0,themes:{dark:{primary:J.Z.grey.darken4,secondary:J.Z.grey.darken3,success:J.Z.green.accent2,accent:J.Z.green.accent2},light:{primary:J.Z.grey,secondary:J.Z.grey.lighten3,success:J.Z.green.accent3,accent:J.Z.green.accent3}}}};var K=new z.Z(X),W=s(7166),Q=s.n(W),Y=s(7152);function tt(){const t=s(8973),e={};return t.keys().forEach((s=>{const n=s.match(/([A-Za-z0-9-_]+)\./i);if(n&&n.length>1){const a=n[1];e[a]=t(s)}})),e}n.Z.use(Y.Z);var et=new Y.Z({locale:"de",fallbackLocale:"en",messages:tt()}),st=s(7187),nt=s.n(st);class at extends(nt()){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},templates:[],componentMap:[{name:"panel",component:"templ_panel"},{name:"chart",component:"templ_chart"},{name:"weather",component:"templ_weather"},{name:"sysmon",component:"templ_sysmon"},{name:"hmlan",component:"templ_hmlan"},{name:"sonos",component:"templ_sonos"},{name:"scenes",component:"templ_scenes"},{name:"cam",component:"templ_cam"},{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"],n=(new Date).toLocaleTimeString(this.app.options.lang),a=(new Date).getMilliseconds(),o={time:n+":"+("000"+a).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]}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:"",n=e.port?":"+e.port.replace(":",""):"",a=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+n+a+o}getEl(t,...e){return e.reduce(((t,e)=>t&&t[e]),t)}async request(t,e,s){let n=[];"csrf"!=e&&n.push({param:"fwcsrf",value:this.app.session.csrf}),"json"!==e&&"csrf"!==e||n.push({param:"XHR",value:"1"}),"object"===typeof t&&(t.length>0?n.push(...t):n.push(t)),"string"===typeof t&&n.push({param:"cmd",value:t});let a=this.createURL(n);return this.log({lvl:3,msg:"Request: "+a}),await fetch(a).then((t=>{let n=null;return"csrf"===e&&(n=t.headers.get("x-fhem-csrftoken")),"json"===e&&(n=t.json()),n||(n=t.text()),"object"===typeof s?Object.assign(s,{data:n}):n})).catch((t=>this.log({lvl:1,msg:"Request failed "+a,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},n=await fetch(t,s).then((t=>t.json())).catch((e=>this.log({lvl:1,msg:"Read Json-Data from "+t+" failed.",meta:e})));return n&&this.log({lvl:5,msg:"Json-Data parsed from "+t,meta:n}),await n}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 n=t[s].split(",");for(const a of n){let n=s+"="+a;-1==e.map((t=>t.title)).indexOf(a)&&e.push({title:a,route:n}),this.createRoutes(t,n)}}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 n of t.Results){let t=await this.createOptions(n);if(t.template){let n=await this.getTemplate(t);n&&this.app.templates.push(n),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 n of s){let s=await this.request({param:"cmd",value:"jsonlist2 "+t.Options.connected[n]},"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[n]=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=[],n=1;for(const s of t.Results){"PossibleSets"in s&&delete s.PossibleSets,"PossibleAttrs"in s&&delete s.PossibleAttrs;let a=await this.createOptions(s),o=this.getComponent(a.template);if(Object.assign(a,o),"templ_default"===a.component){let t=await this.getSetup(a.template);a.setup&&Object.assign(t,a.setup),a.setup=t}s.Options=a,s.Options.connected&&(s.Connected=await this.createConnected(s)),this.handleTemplate(s),e.push(s),n===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),n++}}}}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){let e=t.split("\n");e.length>3&&e.splice(-3,3);let s=[],n=e.length>this.app.options.maxChartPoints?parseInt(e.length/this.app.options.maxChartPoints):1,a=n,o=0,i=1;for(const r of e){let t=r.split(" "),l=Date.parse(t[0].replace("_","T")),p=parseFloat(t[1]);o+=p,(i>=a||i===e.length)&&(i===e.length&&(n-=a-i),s.push({timestamp:l,value:o/n}),a+=n,o=0),i++}return this.log({lvl:5,msg:"handle Chartdata (Lines: "+e.length+")"}),s}async readLogData(t){let e=[];if(this.loading=!0,t.defs&&t.defs.length>0){let s=0;for(const n of t.defs){let a=/\(.*\)/.exec(n),o=a?n.replace(a[0],"_").split(":"):n.split(":"),i="get ";i+=o[0]?o[0]:t.deviceName,i+=t.from?" - - "+t.from:"",i+=t.to?" "+t.to:"",i+=a?" "+a[0].replace(/\(|\)/g,""):" 4:"+o[1];let r=await this.request([{param:"cmd",value:i},{param:"XHR",value:"1"}],"text",{id:s});r&&e.push({id:r.id,data:this.handleLogData(await r.data)}),s++}}return this.loading=!1,Object.assign(t,{data:e})}replaceVals(t,e){let s=/-?[0-9]/.exec(e),n=[];for(var a=2;a1?r+"Tage ":r>0?r+"Tag ":"";c+=l>0?l+"h ":"",c+=p>0?p+"min":"",o=t[a].replace("%a",c)}if(/%n/.test(t[a])&&s){/%n.[0-9]/.test(t[a])||(t[a]=t[a].replace("%n","%n.0"));let n=/%n../.exec(t[a]),i=n[0].replace("%n.","");o=t[a].replace(n[0],parseFloat(e.slice(s.index)).toFixed(i))}if(/%i/.test(t[a])&&s){let n=parseFloat(t[a].split("%i")[1]);if("isNaN"!=n){let i=n.toString().split(".")[1]||"",r=i.length,l=parseFloat(e.slice(s.index))+n;o=t[a].replace("%i"+n,l.toFixed(r))}}o=o.replace(/:/g,":"),n.push(o)}return n}handleVals(t,e){let s=[];if("string"===typeof e){let t=("::"+e).split(":");s=this.replaceVals(t,"")}if("object"===typeof t&&"object"===typeof e&&e.length>0)for(const n of e){let e=n.split(":");if(e.length>2){let n=/\./.test(e[0])?e[0].split("."):["Readings",e[0],"Value"],a=this.getEl(t,...n)||this.getEl(t,"Readings",e[0],"Value");if(a){let t=!1,n=parseFloat(e[1]);if(isNaN(n))RegExp(e[1]?e[1]:".").test(a)&&(t=!0);else{let e=/-?[0-9]/.exec(a);-1!=e.index&&parseFloat(a.slice(e.index))>=n&&(t=!0)}if(t){s=this.replaceVals(e,a);break}}}}return s}handleTemplate(t){let e=this.getEl(t,"Options","setup","show"),s=this.getEl(t,"Options","setup","status","bar"),n=this.getEl(t,"Options","setup","status","error"),a=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,n=this.getEl(t,"Options","setup","status","max")||100,a=this.handleVals(t,s),o=100/(n-e),i=(a[0]||"0"-e)*o;t.Options.status.level=a[2]?100-i:i,t.Options.status.color=a[1]||"success"}if(n){let e=this.handleVals(t,n);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(a){let e=this.handleVals(t,a.left1),s=this.handleVals(t,a.left2),n=this.handleVals(t,a.mid1),o=this.handleVals(t,a.mid2),i=this.handleVals(t,a.right1),r=this.handleVals(t,a.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=n[2]||"",t.Options.info.mid1Icon=n[1]||"",t.Options.info.mid1Text=n[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 n=this.app.data.deviceList[e],a=Object.assign({},n);if(s.Name===t.Name&&("Readings"===t.devicePart&&this.getEl(a,"Readings",t.param,t.paramPart)&&(a.Readings[t.param][t.paramPart]=t.value),"Attributes"===t.devicePart&&this.getEl(a,"Attributes",t.param)&&(a.Attributes[t.param]=t.value),this.handleTemplate(a),this.app.data.deviceList.splice(e,1,a),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 n=0;for(const o of Object.values(s.Connected)){if(o.Name===t.Name){let o=Object.keys(s.Connected)[n];"Readings"===t.devicePart&&this.getEl(a.Connected[o],"Readings",t.param,t.paramPart)&&(a.Connected[o].Readings[t.param][t.paramPart]=t.value),"Attributes"===t.devicePart&&this.getEl(a.Connected[o],"Attributes",t.param)&&(a.Connected[o].Attributes[t.param]=t.value),this.handleTemplate(a),this.app.data.deviceList.splice(e,1,a),this.app.data.deviceList.sort(((t,e)=>t.Options.sortby>e.Options.sortby?1:e.Options.sortby>t.Options.sortby?-1:0))}n++}}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.options.mobileHeader||(this.app.appBar.header=t.toLocaleString(this.app.options.lang,{weekday:"long",year:"numeric",month:"long",day:"numeric"}))}async init(t,e){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 ot={install(t,e,s){t.prototype.$fhem=new at,t.prototype.$fhem.init(e,s)}};n.Z.use(ot,K,et),n.Z.use(Q()),n.Z.component("apex-chart",Q()),n.Z.config.productionTip=!1,new n.Z({vuetify:K,router:q,i18n:et,render:t=>t(M)}).$mount("#app")},8973:function(t,e,s){var n={"./de.json":9929,"./en.json":790};function a(t){var e=o(t);return s(e)}function o(t){if(!s.o(n,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return n[t]}a.keys=function(){return Object.keys(n)},a.resolve=o,t.exports=a,a.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.30.3"}},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"}},"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"}},"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(n){var a=e[n];if(void 0!==a)return a.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,s),o.exports}s.m=t,function(){var t=[];s.O=function(e,n,a,o){if(!n){var i=1/0;for(c=0;c=o)&&Object.keys(s.O).every((function(t){return s.O[t](n[l])}))?n.splice(l--,1):(r=!1,o0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[n,a,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 n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}}(),function(){s.f={},s.e=function(t){return Promise.all(Object.keys(s.f).reduce((function(e,n){return s.f[n](t,e),e}),[]))}}(),function(){s.u=function(t){return"js/"+t+"."+{44:"1ae09cf8",121:"006dace8",154:"cb009208",285:"6fc47f33",288:"6d3eb988",320:"2ba04f2e",322:"a37a620a",337:"3c817406",387:"06272897",396:"02bb2eaa",438:"27924680",475:"e1a25454",846:"510798d7",869:"df959138",884:"472374d2",947:"371294c0",997:"e21ab267"}[t]+".js"}}(),function(){s.miniCssF=function(t){return"css/"+t+"."+{44:"7086d1d2",154:"8ecd64f4",285:"b6c37c1b",288:"a57bcf5c",337:"b2abc4be",387:"5322d21c",396:"8ecd64f4",438:"85e1c6a8",475:"35328724",846:"b79779ed",869:"5fde8d03",947:"85e1c6a8",997:"8ecd64f4"}[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(n,a,o,i){if(t[n])t[n].push(a);else{var r,l;if(void 0!==o)for(var p=document.getElementsByTagName("script"),c=0;c