diff --git a/packages/modules/display_themes/cards/web/assets/ChargePointPlugBadge-DAQjO_iO.js b/packages/modules/display_themes/cards/web/assets/ChargePointPlugBadge-B7K7z1N_.js similarity index 98% rename from packages/modules/display_themes/cards/web/assets/ChargePointPlugBadge-DAQjO_iO.js rename to packages/modules/display_themes/cards/web/assets/ChargePointPlugBadge-B7K7z1N_.js index 9f666c4f0b..476e698327 100644 --- a/packages/modules/display_themes/cards/web/assets/ChargePointPlugBadge-DAQjO_iO.js +++ b/packages/modules/display_themes/cards/web/assets/ChargePointPlugBadge-B7K7z1N_.js @@ -1 +1 @@ -import{Q as p,o as n,e as c,i as m,F as P,A as C,z as _,j as x,l,n as S,p as w,s as k,x as u}from"./vendor-DnHbc_zZ.js";import{_ as y}from"./vendor-inkline-CinPe9R0.js";import{u as v}from"./index-D0wyw7xN.js";import{l as N,z as b,A as D,B as z,F as B}from"./vendor-fortawesome-DM89TELH.js";const d={props:{data:{required:!1,type:Array,default:void 0},socData:{required:!1,type:Array,default:void 0},width:{type:Number,default:250},height:{type:Number,default:70},gap:{type:Number,default:3},stroke:{type:Number,default:3},min:{type:Number,default:0},max:{type:Number,default:1},color:{type:String,default:"var(--color--primary)"},colorNegative:{type:String,default:void 0}},computed:{highestPoint(){return Math.max(1,this.max,...this.slicedData)},lowestPoint(){return Math.min(0,this.min,...this.slicedData)},maxPoints(){return Math.floor(this.width/(this.stroke+this.gap))},slicedData(){if(this.data)return this.data.slice(-this.maxPoints)},slicedSocData(){if(this.socData)return this.socData.slice(-this.maxPoints)},zeroHeight(){return this.height-(0-this.lowestPoint)/(this.highestPoint-this.lowestPoint)*this.height},coordinates(){if(this.data)return this.calculateCoordinates(this.slicedData,this.lowestPoint,this.highestPoint)},socCoordinates(){if(this.socData)return this.calculateCoordinates(this.slicedSocData,0,100)},bars(){if(this.coordinates){const t=[];return this.coordinates.forEach(s=>{const e=s.x,r=s.y,o=this.stroke,a=Math.min(r,this.zeroHeight),i=Math.abs(r-this.zeroHeight),h=r>this.zeroHeight;t.push({x:e,y:a,width:o,height:i,negative:h})}),t}},socPath(){if(this.socCoordinates&&this.socCoordinates.length>0){let s=this.socCoordinates.slice(0,1)[0],e=this.socCoordinates.slice(-1)[0];var t=`M 0,${this.height}`;return t+=` L 0,${s.y}`,this.socCoordinates.forEach(r=>{t+=` L ${r.x+this.stroke/2},${r.y}`}),t+=` L ${e.x+this.stroke},${e.y} L ${e.x+this.stroke},${this.height} Z`,t}}},methods:{calculateCoordinates(t,s,e){const r=[];return t.forEach((o,a)=>{const i=a*this.width/this.maxPoints+1,h=this.height-(o-s)/(e-s)*this.height;r.push({x:i,y:h})}),r}}},g=()=>{p(t=>({"3f7db06a":t.color,"1de516bf":t.colorNegative}))},f=d.setup;d.setup=f?(t,s)=>(g(),f(t,s)):g;const I=["viewBox"],q=["d"],M=["x","y","width","height"],A=["y1","x2","y2"];function E(t,s,e,r,o,a){return n(),c("svg",{class:"spark-line",viewBox:`0 0 ${e.width} ${e.height}`,width:"100%",preserveAspectRatio:"xMinYMin"},[e.socData?(n(),c("path",{key:0,class:"soc-path",d:a.socPath},null,8,q)):m("",!0),(n(!0),c(P,null,C(a.bars,i=>(n(),c("rect",{key:i.x,x:i.x,y:i.y,width:i.width,height:i.height,class:_(e.colorNegative&&i.negative?"negative":"")},null,10,M))),128)),x("line",{class:"zero-line",x1:0,y1:a.zeroHeight,x2:e.width,y2:a.zeroHeight},null,8,A)],8,I)}const R=y(d,[["render",E],["__scopeId","data-v-22cdf82b"]]);N.add(b,D,z);const H={name:"ChargePointStateBadge",components:{FontAwesomeIcon:B},props:{chargePointId:{required:!0,type:Array},showEnergyCharged:{required:!1,type:Boolean,default:!0}},data(){return{mqttStore:v()}},computed:{plugState(){var t=!1;return this.chargePointId.forEach(s=>{t|=this.mqttStore.getChargePointPlugState(s)}),t},chargeState(){var t=!1;return this.chargePointId.forEach(s=>{t|=this.mqttStore.getChargePointChargeState(s)}),t},stateIcon(){return this.plugState?this.chargeState?["fas","fa-plug-circle-bolt"]:["fas","fa-plug-circle-check"]:["fas","fa-plug-circle-xmark"]},stateClass(){return this.plugState?this.chargeState?"_color:success":"_color:warning":"_color:gray"}}},L={key:0,class:"_padding-left:1"};function V(t,s,e,r,o,a){const i=l("font-awesome-icon"),h=l("i-badge");return n(),S(h,{size:"lg"},{default:w(()=>[k(i,{"fixed-width":"",icon:a.stateIcon,class:_(a.stateClass)},null,8,["icon","class"]),a.plugState&&e.showEnergyCharged?(n(),c("span",L,u(o.mqttStore.getChargePointImportedSincePlugged(e.chargePointId).energy)+" / "+u(o.mqttStore.getChargePointImportedSincePlugged(e.chargePointId).range),1)):m("",!0)]),_:1})}const X=y(H,[["render",V]]);export{X as C,R as S}; +import{Q as p,o as n,e as c,i as m,F as P,A as C,z as _,j as x,l,n as S,p as w,s as k,x as u}from"./vendor-DnHbc_zZ.js";import{_ as y}from"./vendor-inkline-CinPe9R0.js";import{u as v}from"./index-DTagQ25V.js";import{l as N,z as b,A as D,B as z,F as B}from"./vendor-fortawesome-DM89TELH.js";const d={props:{data:{required:!1,type:Array,default:void 0},socData:{required:!1,type:Array,default:void 0},width:{type:Number,default:250},height:{type:Number,default:70},gap:{type:Number,default:3},stroke:{type:Number,default:3},min:{type:Number,default:0},max:{type:Number,default:1},color:{type:String,default:"var(--color--primary)"},colorNegative:{type:String,default:void 0}},computed:{highestPoint(){return Math.max(1,this.max,...this.slicedData)},lowestPoint(){return Math.min(0,this.min,...this.slicedData)},maxPoints(){return Math.floor(this.width/(this.stroke+this.gap))},slicedData(){if(this.data)return this.data.slice(-this.maxPoints)},slicedSocData(){if(this.socData)return this.socData.slice(-this.maxPoints)},zeroHeight(){return this.height-(0-this.lowestPoint)/(this.highestPoint-this.lowestPoint)*this.height},coordinates(){if(this.data)return this.calculateCoordinates(this.slicedData,this.lowestPoint,this.highestPoint)},socCoordinates(){if(this.socData)return this.calculateCoordinates(this.slicedSocData,0,100)},bars(){if(this.coordinates){const t=[];return this.coordinates.forEach(s=>{const e=s.x,r=s.y,o=this.stroke,a=Math.min(r,this.zeroHeight),i=Math.abs(r-this.zeroHeight),h=r>this.zeroHeight;t.push({x:e,y:a,width:o,height:i,negative:h})}),t}},socPath(){if(this.socCoordinates&&this.socCoordinates.length>0){let s=this.socCoordinates.slice(0,1)[0],e=this.socCoordinates.slice(-1)[0];var t=`M 0,${this.height}`;return t+=` L 0,${s.y}`,this.socCoordinates.forEach(r=>{t+=` L ${r.x+this.stroke/2},${r.y}`}),t+=` L ${e.x+this.stroke},${e.y} L ${e.x+this.stroke},${this.height} Z`,t}}},methods:{calculateCoordinates(t,s,e){const r=[];return t.forEach((o,a)=>{const i=a*this.width/this.maxPoints+1,h=this.height-(o-s)/(e-s)*this.height;r.push({x:i,y:h})}),r}}},g=()=>{p(t=>({"3f7db06a":t.color,"1de516bf":t.colorNegative}))},f=d.setup;d.setup=f?(t,s)=>(g(),f(t,s)):g;const I=["viewBox"],q=["d"],M=["x","y","width","height"],A=["y1","x2","y2"];function E(t,s,e,r,o,a){return n(),c("svg",{class:"spark-line",viewBox:`0 0 ${e.width} ${e.height}`,width:"100%",preserveAspectRatio:"xMinYMin"},[e.socData?(n(),c("path",{key:0,class:"soc-path",d:a.socPath},null,8,q)):m("",!0),(n(!0),c(P,null,C(a.bars,i=>(n(),c("rect",{key:i.x,x:i.x,y:i.y,width:i.width,height:i.height,class:_(e.colorNegative&&i.negative?"negative":"")},null,10,M))),128)),x("line",{class:"zero-line",x1:0,y1:a.zeroHeight,x2:e.width,y2:a.zeroHeight},null,8,A)],8,I)}const R=y(d,[["render",E],["__scopeId","data-v-22cdf82b"]]);N.add(b,D,z);const H={name:"ChargePointStateBadge",components:{FontAwesomeIcon:B},props:{chargePointId:{required:!0,type:Array},showEnergyCharged:{required:!1,type:Boolean,default:!0}},data(){return{mqttStore:v()}},computed:{plugState(){var t=!1;return this.chargePointId.forEach(s=>{t|=this.mqttStore.getChargePointPlugState(s)}),t},chargeState(){var t=!1;return this.chargePointId.forEach(s=>{t|=this.mqttStore.getChargePointChargeState(s)}),t},stateIcon(){return this.plugState?this.chargeState?["fas","fa-plug-circle-bolt"]:["fas","fa-plug-circle-check"]:["fas","fa-plug-circle-xmark"]},stateClass(){return this.plugState?this.chargeState?"_color:success":"_color:warning":"_color:gray"}}},L={key:0,class:"_padding-left:1"};function V(t,s,e,r,o,a){const i=l("font-awesome-icon"),h=l("i-badge");return n(),S(h,{size:"lg"},{default:w(()=>[k(i,{"fixed-width":"",icon:a.stateIcon,class:_(a.stateClass)},null,8,["icon","class"]),a.plugState&&e.showEnergyCharged?(n(),c("span",L,u(o.mqttStore.getChargePointImportedSincePlugged(e.chargePointId).energy)+" / "+u(o.mqttStore.getChargePointImportedSincePlugged(e.chargePointId).range),1)):m("",!0)]),_:1})}const X=y(H,[["render",V]]);export{X as C,R as S}; diff --git a/packages/modules/display_themes/cards/web/assets/ChargePointsView-BQVeqYDM.js b/packages/modules/display_themes/cards/web/assets/ChargePointsView-BZVPA9o4.js similarity index 99% rename from packages/modules/display_themes/cards/web/assets/ChargePointsView-BQVeqYDM.js rename to packages/modules/display_themes/cards/web/assets/ChargePointsView-BZVPA9o4.js index 328d98058a..e8e569912a 100644 --- a/packages/modules/display_themes/cards/web/assets/ChargePointsView-BQVeqYDM.js +++ b/packages/modules/display_themes/cards/web/assets/ChargePointsView-BZVPA9o4.js @@ -1 +1 @@ -import{u as B,C as ne,N as ie}from"./index-D0wyw7xN.js";import{D as z}from"./DashBoardCard-R8Ma9lyF.js";import{S as oe,C as W}from"./ChargePointPlugBadge-DAQjO_iO.js";import{l as N,b as le,c as ae,F as A,j as re,k as E,m as U,e as D,n as Z,o as R,p as j,q as O,r as J,s as K,t as G,u as H,v as ce,w as de,x as ge,y as he}from"./vendor-fortawesome-DM89TELH.js";import{_ as T}from"./vendor-inkline-CinPe9R0.js";import{l as g,o as d,n as u,p as i,s as n,z as q,e as S,k as r,F as x,x as s,i as m,A as L,I as se,j as ue,q as me}from"./vendor-DnHbc_zZ.js";N.add(le,ae);const Ce={name:"ChargePointLockButton",components:{FontAwesomeIcon:A},props:{chargePointId:{required:!0,type:Number},changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:B()}},computed:{locked(){return this.mqttStore.getChargePointManualLock(this.chargePointId)},stateIcon(){return this.locked?["fas","fa-lock"]:["fas","fa-lock-open"]},stateClass(){return this.locked?["_color:danger"]:"_color:success"}},methods:{toggleChargePointManualLock(){this.changesLocked||this.$root.sendTopicToBroker(`openWB/chargepoint/${this.chargePointId}/set/manual_lock`,!this.mqttStore.getValueBool(`openWB/chargepoint/${this.chargePointId}/set/manual_lock`))}}};function fe(o,t,l,_,e,c){const f=g("font-awesome-icon"),V=g("i-button");return d(),u(V,{size:"lg",disabled:l.changesLocked,outline:l.changesLocked},{default:i(()=>[n(f,{"fixed-width":"",icon:c.stateIcon,class:q(c.stateClass),onClick:t[0]||(t[0]=C=>c.toggleChargePointManualLock())},null,8,["icon","class"])]),_:1},8,["disabled","outline"])}const Q=T(Ce,[["render",fe]]);N.add(re);const _e={name:"ChargePointCodeButton",components:{FontAwesomeIcon:A,CodeInputModal:ne},props:{chargePointId:{type:Number,required:!0}},data(){return{mqttStore:B(),modalIdTagEntryVisible:!1,modalIdTagEntryColor:"warning",code:""}},computed:{tagState(){return this.mqttStore.getChargepointTagState(this.chargePointId)},tagButtonColor(){switch(this.tagState){case 2:return"success";case 1:return"warning";default:return""}},tagClass(){switch(this.tagState){case 2:return"_color:success-80";case 1:return"_color:warning-80";default:return""}}},methods:{toggleIdTagModal(){this.modalIdTagEntryVisible=!this.modalIdTagEntryVisible},sendIdTag(o){this.$root.sendTopicToBroker(`openWB/chargepoint/${this.chargePointId}/get/rfid`,o),this.modalIdTagEntryVisible=!1}}};function Pe(o,t,l,_,e,c){const f=g("FontAwesomeIcon"),V=g("i-button"),C=g("CodeInputModal");return d(),S(x,null,[n(V,{class:"_margin-right:1",size:"lg",color:c.tagButtonColor,disabled:c.tagState==2,onClick:t[0]||(t[0]=h=>c.toggleIdTagModal())},{default:i(()=>[n(f,{"fixed-width":"",icon:["fas","fa-calculator"],class:q(c.tagClass)},null,8,["class"])]),_:1},8,["color","disabled"]),n(C,{ref:"lockInput",modelValue:e.modalIdTagEntryVisible,"onUpdate:modelValue":t[1]||(t[1]=h=>e.modalIdTagEntryVisible=h),"min-length":4,"max-length":20,"onUpdate:inputValue":c.sendIdTag},{header:i(()=>[r(" Bitte einen ID-Tag eingeben. ")]),_:1},8,["modelValue","onUpdate:inputValue"])],64)}const X=T(_e,[["render",Pe]]);N.add(E,U,D,Z,R,j,O,J,K,G,H);const Se={name:"ChargePointCard",components:{DashBoardCard:z,SparkLine:oe,ChargePointPlugBadge:W,ChargePointLockButton:Q,ChargePointCodeButton:X,FontAwesomeIcon:A},props:{chargePointId:{type:Number,required:!0},changesLocked:{type:Boolean,required:!0}},emits:["vehicle-click","soc-click","charge-mode-click","toggle-charge-point-settings"],data(){return{mqttStore:B()}},methods:{handleVehicleClick(o){this.$emit("vehicle-click",o)},handleSocClick(o){this.$emit("soc-click",o)},handleChargeModeClick(o){this.$emit("charge-mode-click",o)},toggleChargePointSettings(o){this.$emit("toggle-charge-point-settings",o)}}},Ve={key:0};function be(o,t,l,_,e,c){const f=g("charge-point-plug-badge"),V=g("charge-point-code-button"),C=g("charge-point-lock-button"),h=g("i-column"),b=g("i-row"),k=g("spark-line"),I=g("font-awesome-icon"),P=g("i-badge"),w=g("i-button"),v=g("i-container"),p=g("dash-board-card");return d(),u(p,{color:"primary"},{headerLeft:i(()=>[r(s(e.mqttStore.getChargePointName(l.chargePointId)),1)]),headerRight:i(()=>[n(f,{"charge-point-id":[l.chargePointId]},null,8,["charge-point-id"])]),default:i(()=>[n(v,null,{default:i(()=>[n(b,null,{default:i(()=>[n(h,null,{default:i(()=>[n(b,null,{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0"},{default:i(()=>[e.mqttStore.getRfidEnabled?(d(),u(V,{key:0,"charge-point-id":l.chargePointId},null,8,["charge-point-id"])):m("",!0),n(C,{"charge-point-id":l.chargePointId,"changes-locked":l.changesLocked},null,8,["charge-point-id","changes-locked"])]),_:1}),n(h,{class:"_text-align:right _padding-left:0"},{default:i(()=>[r(s(e.mqttStore.getChargePointPower(l.chargePointId))+" "+s(e.mqttStore.getChargePointPhasesInUse(l.chargePointId))+" "+s(e.mqttStore.getChargePointSetCurrent(l.chargePointId)),1)]),_:1})]),_:1}),n(b,{class:"_padding-top:1"},{default:i(()=>[n(h,{class:"_padding-left:0"},{default:i(()=>[n(k,{color:"var(--color--primary)",data:e.mqttStore.getChargePointPowerChartData(l.chargePointId)},null,8,["data"])]),_:1})]),_:1})]),_:1}),n(h,{md:"6"},{default:i(()=>[n(b,{class:"_display:flex"},{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0 _flex-grow:1"},{default:i(()=>[n(P,{size:"lg",class:q(["_width:100%",l.changesLocked?"":"clickable"]),onClick:t[0]||(t[0]=y=>c.handleVehicleClick(l.chargePointId))},{default:i(()=>[n(I,{"fixed-width":"",icon:["fas","fa-car"]}),r(" "+s(e.mqttStore.getChargePointConnectedVehicleName(l.chargePointId)),1)]),_:1},8,["class"])]),_:1}),e.mqttStore.getVehicleSocConfigured(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))||e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))!=0?(d(),u(h,{key:0,class:"_flex-grow:0 _padding-right:0 _padding-left:1"},{default:i(()=>[n(w,{size:"sm",disabled:l.changesLocked,class:q(l.changesLocked?"":"clickable"),onClick:t[1]||(t[1]=y=>c.handleSocClick(l.chargePointId))},{default:i(()=>[e.mqttStore.getVehicleSocConfigured(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))?(d(),S("span",Ve,[n(I,{"fixed-width":"",icon:e.mqttStore.getVehicleSocIsManual(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))?["fas","fa-edit"]:["fas","fa-car-battery"]},null,8,["icon"]),r(" "+s(e.mqttStore.getChargePointConnectedVehicleSoc(l.chargePointId).soc)+"% ",1)])):m("",!0),e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))!=0?(d(),u(I,{key:1,"fixed-width":"",icon:e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>0?e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>1?["fas","times-circle"]:["fas","exclamation-triangle"]:[],class:q(e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>0?e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>1?"_color:danger":"_color:warning":"")},null,8,["icon","class"])):m("",!0)]),_:1},8,["disabled","class"])]),_:1})):m("",!0)]),_:1}),n(b,{class:"_padding-top:1 _display:flex"},{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0 _flex-grow:1"},{default:i(()=>[n(P,{size:"lg",class:q(["_width:100%",l.changesLocked?"":"clickable"]),color:e.mqttStore.getChargePointConnectedVehicleChargeMode(l.chargePointId).class,onClick:t[2]||(t[2]=y=>c.handleChargeModeClick(l.chargePointId))},{default:i(()=>[r(s(e.mqttStore.getChargePointConnectedVehicleChargeMode(l.chargePointId).label)+" ",1),n(I,{"fixed-width":"",icon:e.mqttStore.getChargePointConnectedVehiclePriority(l.chargePointId)?["fas","fa-star"]:["far","fa-star"],class:q(e.mqttStore.getChargePointConnectedVehiclePriority(l.chargePointId)?"_color:warning":"")},null,8,["icon","class"])]),_:1},8,["class","color"])]),_:1}),e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(l.chargePointId)?(d(),u(h,{key:0,class:"_flex-grow:0 _padding-right:0 _padding-left:1"},{default:i(()=>[n(P,{size:"lg"},{default:i(()=>[e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(l.chargePointId)?(d(),u(I,{key:0,"fixed-width":"",icon:e.mqttStore.getChargePointConnectedVehicleTimeChargingRunning(l.chargePointId)?["fas","fa-clock"]:["far","fa-clock"],class:q(e.mqttStore.getChargePointConnectedVehicleTimeChargingRunning(l.chargePointId)?"_color:success":"")},null,8,["icon","class"])):m("",!0)]),_:1})]),_:1})):m("",!0)]),_:1}),l.changesLocked?m("",!0):(d(),u(b,{key:0,class:"_padding-top:1"},{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0"},{default:i(()=>[n(w,{block:"",onClick:t[3]||(t[3]=y=>c.toggleChargePointSettings(l.chargePointId))},{default:i(()=>[n(I,{"fixed-width":"",icon:["fas","fa-wrench"]})]),_:1})]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})}const Ie=T(Se,[["render",be],["__scopeId","data-v-3c6489c4"]]);N.add(E,U,D,Z,R,j,O,J,K,G,H);const ve={name:"ChargePointCard",components:{DashBoardCard:z,ChargePointPlugBadge:W,ChargePointLockButton:Q,ChargePointCodeButton:X,FontAwesomeIcon:A},props:{chargePointId:{type:Number,required:!0},changesLocked:{type:Boolean,required:!0}},emits:["vehicle-click","soc-click","charge-mode-click","toggle-charge-point-settings","set-charge-point-connected-vehicle-charge-mode"],data(){return{mqttStore:B(),simpleChargeModes:["instant_charging","pv_charging","stop"]}},computed:{filteredChargeModes(){return this.mqttStore.getSimpleChargePointView?this.mqttStore.chargeModeList().filter(o=>this.simpleChargeModes.includes(o.id)):this.mqttStore.chargeModeList()}},methods:{handleVehicleClick(o){this.$emit("vehicle-click",o)},handleSocClick(o){this.$emit("soc-click",o)},handleChargeModeClick(o){this.$emit("charge-mode-click",o)},toggleChargePointSettings(o){this.$emit("toggle-charge-point-settings",o)},setChargePointConnectedVehicleChargeMode(o,t){this.$emit("set-charge-point-connected-vehicle-charge-mode",o,t)}}},ke={key:0};function pe(o,t,l,_,e,c){const f=g("charge-point-plug-badge"),V=g("charge-point-code-button"),C=g("charge-point-lock-button"),h=g("i-column"),b=g("i-row"),k=g("font-awesome-icon"),I=g("i-button"),P=g("i-button-group"),w=g("i-container"),v=g("dash-board-card");return d(),u(v,{color:"primary"},{headerLeft:i(()=>[r(s(e.mqttStore.getChargePointName(l.chargePointId)),1)]),headerRight:i(()=>[n(f,{"charge-point-id":[l.chargePointId]},null,8,["charge-point-id"])]),default:i(()=>[n(w,null,{default:i(()=>[n(b,null,{default:i(()=>[n(h,null,{default:i(()=>[n(b,null,{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0"},{default:i(()=>[e.mqttStore.getRfidEnabled?(d(),u(V,{key:0,"charge-point-id":l.chargePointId},null,8,["charge-point-id"])):m("",!0),n(C,{"charge-point-id":l.chargePointId,"changes-locked":l.changesLocked},null,8,["charge-point-id","changes-locked"])]),_:1}),n(h,{class:"_text-align:right _padding-left:0"},{default:i(()=>[r(s(e.mqttStore.getChargePointPower(l.chargePointId))+" "+s(e.mqttStore.getChargePointPhasesInUse(l.chargePointId))+" "+s(e.mqttStore.getChargePointSetCurrent(l.chargePointId)),1)]),_:1})]),_:1}),n(b,{class:"_padding-top:1"},{default:i(()=>[n(h,{class:"_padding-left:0 button-group-wrapper"},{default:i(()=>[n(P,{class:"button-group main-button-group"},{default:i(()=>[n(I,{class:q(["large-button _flex-grow:1",l.changesLocked?"":"clickable"]),disabled:l.changesLocked,onClick:t[0]||(t[0]=p=>c.handleVehicleClick(l.chargePointId))},{default:i(()=>[n(k,{"fixed-width":"",icon:["fas","fa-car"]}),r(" "+s(e.mqttStore.getChargePointConnectedVehicleName(l.chargePointId))+" ",1),n(k,{class:q(["_padding-left:1",e.mqttStore.getChargePointConnectedVehiclePriority(l.chargePointId)?"_color:warning":""]),"fixed-width":"",icon:e.mqttStore.getChargePointConnectedVehiclePriority(l.chargePointId)?["fas","fa-star"]:["far","fa-star"]},null,8,["icon","class"])]),_:1},8,["class","disabled"]),e.mqttStore.getVehicleSocConfigured(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))||e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))!=0?(d(),u(I,{key:0,class:q(["large-button _flex-grow:0",l.changesLocked?"":"clickable"]),disabled:l.changesLocked,onClick:t[1]||(t[1]=p=>c.handleSocClick(l.chargePointId))},{default:i(()=>[e.mqttStore.getVehicleSocConfigured(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))?(d(),S("span",ke,[n(k,{"fixed-width":"",icon:e.mqttStore.getVehicleSocIsManual(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))?["fas","fa-edit"]:["fas","fa-car-battery"]},null,8,["icon"]),r(" "+s(e.mqttStore.getChargePointConnectedVehicleSoc(l.chargePointId).soc)+"% ",1)])):m("",!0),e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))!=0?(d(),u(k,{key:1,"fixed-width":"",icon:e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>0?e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>1?["fas","times-circle"]:["fas","exclamation-triangle"]:[],class:q(e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>0?e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>1?"_color:danger":"_color:warning":"")},null,8,["icon","class"])):m("",!0)]),_:1},8,["disabled","class"])):m("",!0),n(I,{class:q(["large-button _flex-grow:0",l.changesLocked?"":"clickable"]),disabled:l.changesLocked,onClick:t[2]||(t[2]=p=>c.toggleChargePointSettings(l.chargePointId))},{default:i(()=>[n(k,{"fixed-width":"",icon:["fas","fa-wrench"]})]),_:1},8,["class","disabled"])]),_:1}),n(P,{class:"button-group _margin-top:1",disabled:l.changesLocked},{default:i(()=>[(d(!0),S(x,null,L(c.filteredChargeModes,p=>(d(),u(I,{key:p.id,outline:"",class:q(["large-button _flex-grow:1",l.changesLocked?"":"clickable"]),color:p.class!="dark"?p.class:"light",active:e.mqttStore.getChargePointConnectedVehicleChargeMode(l.chargePointId)!=null&&p.id==e.mqttStore.getChargePointConnectedVehicleChargeMode(l.chargePointId).mode,onClick:y=>c.setChargePointConnectedVehicleChargeMode(l.chargePointId,p.id)},{default:i(()=>[r(s(p.label),1)]),_:2},1032,["class","color","active","onClick"]))),128))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const qe=T(ve,[["render",pe],["__scopeId","data-v-5e676b1f"]]),we={name:"ExtendedNumberInput",inheritAttrs:!1,props:{modelValue:{type:Number,required:!0,default:NaN},unit:{type:String,default:""},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},labels:{type:Array,default:void 0}},emits:["update:modelValue"],data(){return{minimum:this.labels?0:this.min,maximum:this.labels?this.labels.length-1:this.max,stepSize:this.labels?1:this.step}},computed:{label(){var o;return this.labels&&this.inputValue!=null?this.inputValuec.label=C),plaintext:"",class:"_text-align:right",size:"lg"},{prepend:i(()=>[n(f,{onClick:c.decrement},{default:i(()=>[r(" - ")]),_:1},8,["onClick"])]),suffix:i(()=>[r(s(l.unit),1)]),append:i(()=>[n(f,{onClick:c.increment},{default:i(()=>[r(" + ")]),_:1},8,["onClick"])]),_:1},8,["modelValue"])}const Y=T(we,[["render",ye]]),xe={name:"ManualSocInput",components:{ExtendedNumberInput:Y,NumberPad:ie},props:{modelValue:{required:!0,type:Boolean,default:!1},vehicleId:{required:!0,type:Number,default:0}},emits:["update:modelValue"],data(){return{mqttStore:B(),newSoc:0}},methods:{enter(o){let t=this.newSoc*10+parseInt(o);t>=0&&t<=100&&(this.newSoc=t)},removeDigit(){this.newSoc=Math.trunc(this.newSoc/10)},clear(){this.newSoc=0},close(){this.$emit("update:modelValue",!1),this.newSoc=0},updateManualSoc(){this.$root.sendTopicToBroker(`openWB/vehicle/${this.vehicleId}/soc_module/calculated_soc_state/manual_soc`,this.newSoc),this.close()}}};function Me(o,t,l,_,e,c){const f=g("extended-number-input"),V=g("i-column"),C=g("i-row"),h=g("NumberPad"),b=g("i-container"),k=g("i-button"),I=g("i-modal");return d(),u(se,{to:"body"},[n(I,{"model-value":l.modelValue,size:"sm","onUpdate:modelValue":t[6]||(t[6]=P=>o.$emit("update:modelValue",P))},{header:i(()=>[r(' SoC für Fahrzeug "'+s(e.mqttStore.getVehicleName(l.vehicleId))+'" ',1)]),footer:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(V,null,{default:i(()=>[n(k,{color:"danger",onClick:t[4]||(t[4]=P=>c.close())},{default:i(()=>[r(" Zurück ")]),_:1})]),_:1}),n(V,{class:"_text-align:right"},{default:i(()=>[n(k,{color:"success",onClick:t[5]||(t[5]=P=>c.updateManualSoc())},{default:i(()=>[r(" OK ")]),_:1})]),_:1})]),_:1})]),_:1})]),default:i(()=>[n(b,null,{default:i(()=>[n(C,{center:"",class:"_padding-bottom:1"},{default:i(()=>[n(V,null,{default:i(()=>[n(f,{modelValue:e.newSoc,"onUpdate:modelValue":t[0]||(t[0]=P=>e.newSoc=P),unit:"%",min:0,max:100,step:1,size:"lg",class:"_text-align:center"},null,8,["modelValue"])]),_:1})]),_:1}),n(h,{"onKey:digit":t[1]||(t[1]=P=>c.enter(P)),"onKey:clear":t[2]||(t[2]=P=>c.clear()),"onKey:delete":t[3]||(t[3]=P=>c.removeDigit())})]),_:1})]),_:1},8,["model-value"])])}const Te=T(xe,[["render",Me]]);N.add(ce,de,ge,he);const Le={name:"ChargePointsView",components:{ChargePointCard:Ie,SimpleChargePointCard:qe,ExtendedNumberInput:Y,ManualSocInput:Te,FontAwesomeIcon:A},props:{changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:B(),modalChargeModeSettingVisible:!1,modalVehicleSelectVisible:!1,modalChargePointSettingsVisible:!1,modalChargePointId:0,modalVehicleId:0,modalActiveTab:"tab-general",modalManualSocInputVisible:!1,simpleChargeModes:["instant_charging","pv_charging","stop"]}},computed:{vehicleList(){let o=this.mqttStore.getVehicleList;var t=[];return Object.keys(o).forEach(l=>{let _=parseInt(l.match(/(?:\/)([0-9]+)(?=\/)*/g)[0].replace(/[^0-9]+/g,""));t.push({id:_,name:o[l]})}),t},filteredChargeModes(){return this.mqttStore.getSimpleChargePointView?this.mqttStore.chargeModeList().filter(o=>this.simpleChargeModes.includes(o.id)):this.mqttStore.chargeModeList()}},watch:{changesLocked(o,t){t!==!0&&o===!0&&(this.modalChargeModeSettingVisible=!1,this.modalVehicleSelectVisible=!1,this.modalChargePointSettingsVisible=!1,this.modalManualSocInputVisible=!1)}},methods:{toggleChargePointSettings(o){switch(this.mqttStore.getChargePointConnectedVehicleChargeMode(o).mode){case"pv_charging":this.modalActiveTab="tab-pv-charging";break;case"scheduled_charging":this.modalActiveTab="tab-scheduled-charging";break;default:this.modalActiveTab="tab-instant-charging"}this.modalChargePointId=o,this.modalChargePointSettingsVisible=!0},handleChargeModeClick(o){this.changesLocked||(this.modalChargePointId=o,this.modalChargeModeSettingVisible=!0)},handleVehicleClick(o){this.changesLocked||(this.modalChargePointId=o,this.modalVehicleSelectVisible=!0)},handleSocClick(o){let t=this.mqttStore.getChargePointConnectedVehicleId(o);if(this.mqttStore.getVehicleSocIsManual(t)){this.modalVehicleId=t,this.modalManualSocInputVisible=!0;return}this.$root.sendTopicToBroker(`openWB/set/vehicle/${t}/get/force_soc_update`,1)},setChargePointConnectedVehicle(o,t){t.id!=this.mqttStore.getChargePointConnectedVehicleId(o)&&this.$root.sendTopicToBroker(`openWB/chargepoint/${o}/config/ev`,t.id),this.modalVehicleSelectVisible&&(this.modalVehicleSelectVisible=!1)},setChargePointConnectedVehicleChargeMode(o,t){if(t.id!=this.mqttStore.getChargePointConnectedVehicleChargeMode(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/selected`,t)}},setChargePointConnectedVehiclePriority(o,t){if(t!=this.mqttStore.getChargePointConnectedVehiclePriority(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/prio`,t)}},setChargePointConnectedVehicleTimeChargingActive(o,t){if(t!=this.mqttStore.getChargePointConnectedVehicleTimeChargingActive(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/time_charging/active`,t)}},setChargePointConnectedVehicleInstantChargingCurrent(o,t){if(t&&t!=this.mqttStore.getChargePointConnectedVehicleInstantChargingCurrent(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/instant_charging/current`,parseFloat(t))}},setChargePointConnectedVehicleInstantChargingLimit(o,t){if(t&&t!=this.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(o).selected){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/instant_charging/limit/selected`,t)}},setChargePointConnectedVehicleInstantChargingLimitSoc(o,t){if(t&&t!=this.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(o).soc){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/instant_charging/limit/soc`,parseInt(t))}},setChargePointConnectedVehicleInstantChargingLimitAmount(o,t){if(t&&t!=this.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(o).amount){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/instant_charging/limit/amount`,t)}},setChargePointConnectedVehiclePvChargingFeedInLimit(o,t){if(t!=this.mqttStore.getChargePointConnectedVehiclePvChargingFeedInLimit(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/pv_charging/feed_in_limit`,t)}},setChargePointConnectedVehiclePvChargingMinCurrent(o,t){let l=this.mqttStore.getChargePointConnectedVehiclePvChargingMinCurrent(o),_=parseInt(t);if(_!=l&&!isNaN(_)){var e=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${e}/chargemode/pv_charging/min_current`,_)}},setChargePointConnectedVehiclePvChargingMinSoc(o,t){let l=this.mqttStore.getChargePointConnectedVehiclePvChargingMinSoc(o),_=parseInt(t);if(_!=l&&!isNaN(_)){var e=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${e}/chargemode/pv_charging/min_soc`,_)}},setChargePointConnectedVehiclePvChargingMinSocCurrent(o,t){let l=this.mqttStore.getChargePointConnectedVehiclePvChargingMinSocCurrent(o),_=parseInt(t);if(_!=l&&!isNaN(_)){var e=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${e}/chargemode/pv_charging/min_soc_current`,_)}},setChargePointConnectedVehiclePvChargingMaxSoc(o,t){let l=this.mqttStore.getChargePointConnectedVehiclePvChargingMaxSoc(o),_=parseInt(t);if(_!=l&&!isNaN(_)){var e=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${e}/chargemode/pv_charging/max_soc`,_)}},setChargePointConnectedVehicleScheduledChargingPlanActive(o,t){this.$root.sendTopicToBroker(`${o}/active`,t)},setChargePointConnectedVehicleTimeChargingPlanActive(o,t){this.$root.sendTopicToBroker(`${o}/active`,t)}}},Be={class:"charge-points-card-wrapper"},Ne={key:0},Ae={key:1},Fe={key:2},ze={key:3},We={key:4},Ee={key:0},Ue={key:1},De={key:0},Ze={key:1},Re={key:2},je={key:3},Oe={key:4};function Je(o,t,l,_,e,c){const f=g("i-button"),V=g("i-button-group"),C=g("i-form-group"),h=g("i-form-label"),b=g("i-form"),k=g("i-modal"),I=g("i-tab-title"),P=g("extended-number-input"),w=g("i-tab"),v=g("font-awesome-icon"),p=g("i-alert"),y=g("i-row"),F=g("i-container"),$=g("i-tabs"),ee=g("manual-soc-input");return d(),S(x,null,[ue("div",Be,[(d(!0),S(x,null,L(e.mqttStore.getChargePointIds,a=>(d(),u(me(e.mqttStore.getSimpleChargePointView?"SimpleChargePointCard":"ChargePointCard"),{key:a,"charge-point-id":a,"changes-locked":l.changesLocked,onVehicleClick:c.handleVehicleClick,onSocClick:c.handleSocClick,onChargeModeClick:c.handleChargeModeClick,onToggleChargePointSettings:c.toggleChargePointSettings,onSetChargePointConnectedVehicleChargeMode:c.setChargePointConnectedVehicleChargeMode},null,40,["charge-point-id","changes-locked","onVehicleClick","onSocClick","onChargeModeClick","onToggleChargePointSettings","onSetChargePointConnectedVehicleChargeMode"]))),128))]),n(k,{modelValue:e.modalChargeModeSettingVisible,"onUpdate:modelValue":t[2]||(t[2]=a=>e.modalChargeModeSettingVisible=a),size:"lg"},{header:i(()=>[r(' Lademodus für "'+s(e.mqttStore.getChargePointConnectedVehicleName(e.modalChargePointId))+'" auswählen ',1)]),default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(V,{block:"",vertical:""},{default:i(()=>[(d(!0),S(x,null,L(c.filteredChargeModes,a=>(d(),u(f,{key:a.id,size:"lg",class:"large-button",outline:"",color:a.class!="dark"?a.class:"light",active:e.mqttStore.getChargePointConnectedVehicleChargeMode(e.modalChargePointId)!=null&&a.id==e.mqttStore.getChargePointConnectedVehicleChargeMode(e.modalChargePointId).mode,onClick:M=>c.setChargePointConnectedVehicleChargeMode(e.modalChargePointId,a.id)},{default:i(()=>[r(s(a.label),1)]),_:2},1032,["color","active","onClick"]))),128))]),_:1})]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Priorität")]),_:1}),n(V,{block:""},{default:i(()=>[n(f,{size:"lg",class:"large-button",color:e.mqttStore.getChargePointConnectedVehiclePriority(e.modalChargePointId)!==!0?"danger":"",onClick:t[0]||(t[0]=a=>c.setChargePointConnectedVehiclePriority(e.modalChargePointId,!1))},{default:i(()=>[r(" Nein ")]),_:1},8,["color"]),n(f,{color:e.mqttStore.getChargePointConnectedVehiclePriority(e.modalChargePointId)===!0?"success":"",onClick:t[1]||(t[1]=a=>c.setChargePointConnectedVehiclePriority(e.modalChargePointId,!0))},{default:i(()=>[r(" Ja ")]),_:1},8,["color"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),n(k,{modelValue:e.modalVehicleSelectVisible,"onUpdate:modelValue":t[3]||(t[3]=a=>e.modalVehicleSelectVisible=a),class:"modal-vehicle-select",size:"lg"},{header:i(()=>[r(' Fahrzeug an "'+s(e.mqttStore.getChargePointName(e.modalChargePointId))+'" auswählen ',1)]),default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(V,{vertical:"",block:""},{default:i(()=>[(d(!0),S(x,null,L(c.vehicleList,a=>(d(),u(f,{key:a.id,size:"lg",class:"large-button",active:e.mqttStore.getChargePointConnectedVehicleId(e.modalChargePointId)==a.id,color:e.mqttStore.getChargePointConnectedVehicleId(e.modalChargePointId)==a.id?"primary":"",onClick:M=>c.setChargePointConnectedVehicle(e.modalChargePointId,a)},{default:i(()=>[r(s(a.name),1)]),_:2},1032,["active","color","onClick"]))),128))]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),n(k,{modelValue:e.modalChargePointSettingsVisible,"onUpdate:modelValue":t[19]||(t[19]=a=>e.modalChargePointSettingsVisible=a),size:"lg"},{header:i(()=>[r(' Einstellungen für Fahrzeug "'+s(e.mqttStore.getChargePointConnectedVehicleName(e.modalChargePointId))+'" ',1)]),default:i(()=>[n($,{modelValue:e.modalActiveTab,"onUpdate:modelValue":t[18]||(t[18]=a=>e.modalActiveTab=a),stretch:""},{header:i(()=>[n(I,{for:"tab-instant-charging"},{default:i(()=>[r(" Sofort ")]),_:1}),n(I,{for:"tab-pv-charging"},{default:i(()=>[r(" PV ")]),_:1}),e.mqttStore.getSimpleChargePointView?m("",!0):(d(),u(I,{key:0,for:"tab-scheduled-charging"},{default:i(()=>[r(" Zielladen ")]),_:1})),e.mqttStore.getSimpleChargePointView?m("",!0):(d(),u(I,{key:1,for:"tab-time-charging"},{default:i(()=>[r(" Zeitladen ")]),_:1}))]),default:i(()=>[n(w,{name:"tab-instant-charging"},{default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Stromstärke")]),_:1}),n(P,{unit:"A",min:6,max:32,"model-value":e.mqttStore.getChargePointConnectedVehicleInstantChargingCurrent(e.modalChargePointId),"onUpdate:modelValue":t[4]||(t[4]=a=>c.setChargePointConnectedVehicleInstantChargingCurrent(e.modalChargePointId,a))},null,8,["model-value"])]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Begrenzung")]),_:1}),n(V,{block:""},{default:i(()=>[n(f,{color:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="none"?"primary":"",active:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="none",onClick:t[5]||(t[5]=a=>c.setChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId,"none"))},{default:i(()=>[r(" Keine ")]),_:1},8,["color","active"]),n(f,{color:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="soc"?"primary":"",active:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="soc",onClick:t[6]||(t[6]=a=>c.setChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId,"soc"))},{default:i(()=>[r(" EV-SoC ")]),_:1},8,["color","active"]),n(f,{color:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="amount"?"primary":"",active:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="amount",onClick:t[7]||(t[7]=a=>c.setChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId,"amount"))},{default:i(()=>[r(" Energie ")]),_:1},8,["color","active"])]),_:1})]),_:1}),e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="soc"?(d(),u(C,{key:0},{default:i(()=>[n(h,null,{default:i(()=>[r("Max. SoC")]),_:1}),n(P,{unit:"%",min:5,max:100,step:5,"model-value":e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).soc,"onUpdate:modelValue":t[8]||(t[8]=a=>c.setChargePointConnectedVehicleInstantChargingLimitSoc(e.modalChargePointId,a))},null,8,["model-value"])]),_:1})):m("",!0),e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="amount"?(d(),u(C,{key:1},{default:i(()=>[n(h,null,{default:i(()=>[r("Max. Energie")]),_:1}),n(P,{unit:"kWh",min:1,max:100,"model-value":e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).amount/1e3,"onUpdate:modelValue":t[9]||(t[9]=a=>c.setChargePointConnectedVehicleInstantChargingLimitAmount(e.modalChargePointId,a*1e3))},null,8,["model-value"])]),_:1})):m("",!0)]),_:1})]),_:1}),n(w,{name:"tab-pv-charging"},{default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Einspeisegrenze beachten")]),_:1}),n(V,{block:""},{default:i(()=>[n(f,{color:e.mqttStore.getChargePointConnectedVehiclePvChargingFeedInLimit(e.modalChargePointId)!==!0?"danger":"",onClick:t[10]||(t[10]=a=>c.setChargePointConnectedVehiclePvChargingFeedInLimit(e.modalChargePointId,!1))},{default:i(()=>[r(" Nein ")]),_:1},8,["color"]),n(f,{color:e.mqttStore.getChargePointConnectedVehiclePvChargingFeedInLimit(e.modalChargePointId)===!0?"success":"",onClick:t[11]||(t[11]=a=>c.setChargePointConnectedVehiclePvChargingFeedInLimit(e.modalChargePointId,!0))},{default:i(()=>[r(" Ja ")]),_:1},8,["color"])]),_:1})]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Minimaler Dauerstrom")]),_:1}),n(P,{unit:"A",labels:[{label:"Aus",value:0},{label:6,value:6},{label:7,value:7},{label:8,value:8},{label:9,value:9},{label:10,value:10},{label:11,value:11},{label:12,value:12},{label:13,value:13},{label:14,value:14},{label:15,value:15},{label:16,value:16}],"model-value":e.mqttStore.getChargePointConnectedVehiclePvChargingMinCurrent(e.modalChargePointId),"onUpdate:modelValue":t[12]||(t[12]=a=>c.setChargePointConnectedVehiclePvChargingMinCurrent(e.modalChargePointId,a))},null,8,["model-value"])]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Mindest-SoC")]),_:1}),n(P,{unit:"%",labels:[{label:"Aus",value:0},{label:5,value:5},{label:10,value:10},{label:15,value:15},{label:20,value:20},{label:25,value:25},{label:30,value:30},{label:35,value:35},{label:40,value:40},{label:45,value:45},{label:50,value:50},{label:55,value:55},{label:60,value:60},{label:65,value:65},{label:70,value:70},{label:75,value:75},{label:80,value:80},{label:85,value:85},{label:90,value:90},{label:95,value:95}],"model-value":e.mqttStore.getChargePointConnectedVehiclePvChargingMinSoc(e.modalChargePointId),"onUpdate:modelValue":t[13]||(t[13]=a=>c.setChargePointConnectedVehiclePvChargingMinSoc(e.modalChargePointId,a))},null,8,["model-value"])]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Mindest-SoC Strom")]),_:1}),n(P,{min:6,max:32,unit:"A","model-value":e.mqttStore.getChargePointConnectedVehiclePvChargingMinSocCurrent(e.modalChargePointId),"onUpdate:modelValue":t[14]||(t[14]=a=>c.setChargePointConnectedVehiclePvChargingMinSocCurrent(e.modalChargePointId,a))},null,8,["model-value"])]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("SoC-Limit")]),_:1}),n(P,{unit:"%",labels:[{label:5,value:5},{label:10,value:10},{label:15,value:15},{label:20,value:20},{label:25,value:25},{label:30,value:30},{label:35,value:35},{label:40,value:40},{label:45,value:45},{label:50,value:50},{label:55,value:55},{label:60,value:60},{label:65,value:65},{label:70,value:70},{label:75,value:75},{label:80,value:80},{label:85,value:85},{label:90,value:90},{label:95,value:95},{label:100,value:100},{label:"Aus",value:101}],"model-value":e.mqttStore.getChargePointConnectedVehiclePvChargingMaxSoc(e.modalChargePointId),"onUpdate:modelValue":t[15]||(t[15]=a=>c.setChargePointConnectedVehiclePvChargingMaxSoc(e.modalChargePointId,a))},null,8,["model-value"])]),_:1})]),_:1})]),_:1}),e.mqttStore.getSimpleChargePointView?m("",!0):(d(),u(w,{key:0,name:"tab-scheduled-charging"},{default:i(()=>[Object.keys(e.mqttStore.getChargePointConnectedVehicleScheduledChargingPlans(e.modalChargePointId)).length===0?(d(),u(p,{key:0},{icon:i(()=>[n(v,{"fixed-width":"",icon:["fas","fa-info-circle"]})]),default:i(()=>[r(" Es wurden noch keine Zeitpläne für das Zielladen eingerichtet. ")]),_:1})):(d(),u(b,{key:1},{default:i(()=>[(d(!0),S(x,null,L(e.mqttStore.getChargePointConnectedVehicleScheduledChargingPlans(e.modalChargePointId),(a,M)=>(d(),u(C,{key:M},{default:i(()=>[n(F,null,{default:i(()=>[n(y,null,{default:i(()=>[n(h,null,{default:i(()=>[r(s(a.name),1)]),_:2},1024)]),_:2},1024),n(y,null,{default:i(()=>[n(f,{size:"lg",block:"",color:a.active?"success":"danger",onClick:te=>c.setChargePointConnectedVehicleScheduledChargingPlanActive(M,!a.active)},{default:i(()=>[a.frequency.selected=="once"?(d(),S("span",Ne,[n(v,{"fixed-width":"",icon:["fas","calendar-day"]}),r(" "+s(e.mqttStore.formatDate(a.frequency.once)),1)])):m("",!0),a.frequency.selected=="daily"?(d(),S("span",Ae,[n(v,{"fixed-width":"",icon:["fas","calendar-week"]}),r(" täglich ")])):m("",!0),a.frequency.selected=="weekly"?(d(),S("span",Fe,[n(v,{"fixed-width":"",icon:["fas","calendar-alt"]}),r(" "+s(e.mqttStore.formatWeeklyScheduleDays(a.frequency.weekly)),1)])):m("",!0),n(v,{"fixed-width":"",icon:["fas","clock"]}),r(" "+s(a.time)+" ",1),a.limit.selected=="soc"?(d(),S("span",ze,[n(v,{"fixed-width":"",icon:["fas","car-battery"]}),r(" "+s(a.limit.soc_scheduled)+" % ",1)])):m("",!0),a.limit.selected=="amount"?(d(),S("span",We,[n(v,{"fixed-width":"",icon:["fas","bolt"]}),r(" "+s(a.limit.amount/1e3)+" kWh ",1)])):m("",!0)]),_:2},1032,["color","onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1}))]),_:1})),e.mqttStore.getSimpleChargePointView?m("",!0):(d(),u(w,{key:1,name:"tab-time-charging"},{default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Zeitladen aktivieren")]),_:1}),n(V,{block:""},{default:i(()=>[n(f,{color:e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId)!==!0?"danger":"",onClick:t[16]||(t[16]=a=>c.setChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId,!1))},{default:i(()=>[r(" Nein ")]),_:1},8,["color"]),n(f,{color:e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId)===!0?"success":"",onClick:t[17]||(t[17]=a=>c.setChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId,!0))},{default:i(()=>[r(" Ja ")]),_:1},8,["color"])]),_:1})]),_:1}),e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId)===!0?(d(),S("div",Ee,[Object.keys(e.mqttStore.getChargePointConnectedVehicleTimeChargingPlans(e.modalChargePointId)).length===0?(d(),u(p,{key:0,color:"warning",class:"_margin-top:2"},{icon:i(()=>[n(v,{"fixed-width":"",icon:["fas","fa-circle-info"]})]),default:i(()=>[r(" Es wurden noch keine Zeitpläne für das Zeitladen eingerichtet. ")]),_:1})):(d(),S("div",Ue,[(d(!0),S(x,null,L(e.mqttStore.getChargePointConnectedVehicleTimeChargingPlans(e.modalChargePointId),(a,M)=>(d(),u(C,{key:M},{default:i(()=>[n(F,null,{default:i(()=>[n(y,null,{default:i(()=>[n(h,null,{default:i(()=>[r(s(a.name),1)]),_:2},1024)]),_:2},1024),n(y,null,{default:i(()=>[n(f,{size:"lg",block:"",color:a.active?"success":"danger",onClick:te=>c.setChargePointConnectedVehicleTimeChargingPlanActive(M,!a.active)},{default:i(()=>[a.frequency.selected=="once"?(d(),S("span",De,[n(v,{"fixed-width":"",icon:["fas","calendar-day"]}),r(" "+s(e.mqttStore.formatDateRange(a.frequency.once)),1)])):m("",!0),a.frequency.selected=="daily"?(d(),S("span",Ze,[n(v,{"fixed-width":"",icon:["fas","calendar-week"]}),r(" täglich ")])):m("",!0),a.frequency.selected=="weekly"?(d(),S("span",Re,[n(v,{"fixed-width":"",icon:["fas","calendar-alt"]}),r(" "+s(e.mqttStore.formatWeeklyScheduleDays(a.frequency.weekly)),1)])):m("",!0),n(v,{"fixed-width":"",icon:["fas","clock"]}),r(" "+s(a.time.join("-"))+" ",1),a.limit.selected=="soc"?(d(),S("span",je,[n(v,{"fixed-width":"",icon:["fas","car-battery"]}),r(" "+s(a.limit.soc)+" % ",1)])):m("",!0),a.limit.selected=="amount"?(d(),S("span",Oe,[n(v,{"fixed-width":"",icon:["fas","bolt"]}),r(" "+s(a.limit.amount/1e3)+" kWh ",1)])):m("",!0)]),_:2},1032,["color","onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]))])):m("",!0)]),_:1})]),_:1}))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"]),n(ee,{modelValue:e.modalManualSocInputVisible,"onUpdate:modelValue":t[20]||(t[20]=a=>e.modalManualSocInputVisible=a),"vehicle-id":e.modalVehicleId},null,8,["modelValue","vehicle-id"])],64)}const $e=T(Le,[["render",Je],["__scopeId","data-v-76699ceb"]]);export{$e as default}; +import{u as B,C as ne,N as ie}from"./index-DTagQ25V.js";import{D as z}from"./DashBoardCard-R8Ma9lyF.js";import{S as oe,C as W}from"./ChargePointPlugBadge-B7K7z1N_.js";import{l as N,b as le,c as ae,F as A,j as re,k as E,m as U,e as D,n as Z,o as R,p as j,q as O,r as J,s as K,t as G,u as H,v as ce,w as de,x as ge,y as he}from"./vendor-fortawesome-DM89TELH.js";import{_ as T}from"./vendor-inkline-CinPe9R0.js";import{l as g,o as d,n as u,p as i,s as n,z as q,e as S,k as r,F as x,x as s,i as m,A as L,I as se,j as ue,q as me}from"./vendor-DnHbc_zZ.js";N.add(le,ae);const Ce={name:"ChargePointLockButton",components:{FontAwesomeIcon:A},props:{chargePointId:{required:!0,type:Number},changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:B()}},computed:{locked(){return this.mqttStore.getChargePointManualLock(this.chargePointId)},stateIcon(){return this.locked?["fas","fa-lock"]:["fas","fa-lock-open"]},stateClass(){return this.locked?["_color:danger"]:"_color:success"}},methods:{toggleChargePointManualLock(){this.changesLocked||this.$root.sendTopicToBroker(`openWB/chargepoint/${this.chargePointId}/set/manual_lock`,!this.mqttStore.getValueBool(`openWB/chargepoint/${this.chargePointId}/set/manual_lock`))}}};function fe(o,t,l,_,e,c){const f=g("font-awesome-icon"),V=g("i-button");return d(),u(V,{size:"lg",disabled:l.changesLocked,outline:l.changesLocked},{default:i(()=>[n(f,{"fixed-width":"",icon:c.stateIcon,class:q(c.stateClass),onClick:t[0]||(t[0]=C=>c.toggleChargePointManualLock())},null,8,["icon","class"])]),_:1},8,["disabled","outline"])}const Q=T(Ce,[["render",fe]]);N.add(re);const _e={name:"ChargePointCodeButton",components:{FontAwesomeIcon:A,CodeInputModal:ne},props:{chargePointId:{type:Number,required:!0}},data(){return{mqttStore:B(),modalIdTagEntryVisible:!1,modalIdTagEntryColor:"warning",code:""}},computed:{tagState(){return this.mqttStore.getChargepointTagState(this.chargePointId)},tagButtonColor(){switch(this.tagState){case 2:return"success";case 1:return"warning";default:return""}},tagClass(){switch(this.tagState){case 2:return"_color:success-80";case 1:return"_color:warning-80";default:return""}}},methods:{toggleIdTagModal(){this.modalIdTagEntryVisible=!this.modalIdTagEntryVisible},sendIdTag(o){this.$root.sendTopicToBroker(`openWB/chargepoint/${this.chargePointId}/get/rfid`,o),this.modalIdTagEntryVisible=!1}}};function Pe(o,t,l,_,e,c){const f=g("FontAwesomeIcon"),V=g("i-button"),C=g("CodeInputModal");return d(),S(x,null,[n(V,{class:"_margin-right:1",size:"lg",color:c.tagButtonColor,disabled:c.tagState==2,onClick:t[0]||(t[0]=h=>c.toggleIdTagModal())},{default:i(()=>[n(f,{"fixed-width":"",icon:["fas","fa-calculator"],class:q(c.tagClass)},null,8,["class"])]),_:1},8,["color","disabled"]),n(C,{ref:"lockInput",modelValue:e.modalIdTagEntryVisible,"onUpdate:modelValue":t[1]||(t[1]=h=>e.modalIdTagEntryVisible=h),"min-length":4,"max-length":20,"onUpdate:inputValue":c.sendIdTag},{header:i(()=>[r(" Bitte einen ID-Tag eingeben. ")]),_:1},8,["modelValue","onUpdate:inputValue"])],64)}const X=T(_e,[["render",Pe]]);N.add(E,U,D,Z,R,j,O,J,K,G,H);const Se={name:"ChargePointCard",components:{DashBoardCard:z,SparkLine:oe,ChargePointPlugBadge:W,ChargePointLockButton:Q,ChargePointCodeButton:X,FontAwesomeIcon:A},props:{chargePointId:{type:Number,required:!0},changesLocked:{type:Boolean,required:!0}},emits:["vehicle-click","soc-click","charge-mode-click","toggle-charge-point-settings"],data(){return{mqttStore:B()}},methods:{handleVehicleClick(o){this.$emit("vehicle-click",o)},handleSocClick(o){this.$emit("soc-click",o)},handleChargeModeClick(o){this.$emit("charge-mode-click",o)},toggleChargePointSettings(o){this.$emit("toggle-charge-point-settings",o)}}},Ve={key:0};function be(o,t,l,_,e,c){const f=g("charge-point-plug-badge"),V=g("charge-point-code-button"),C=g("charge-point-lock-button"),h=g("i-column"),b=g("i-row"),k=g("spark-line"),I=g("font-awesome-icon"),P=g("i-badge"),w=g("i-button"),v=g("i-container"),p=g("dash-board-card");return d(),u(p,{color:"primary"},{headerLeft:i(()=>[r(s(e.mqttStore.getChargePointName(l.chargePointId)),1)]),headerRight:i(()=>[n(f,{"charge-point-id":[l.chargePointId]},null,8,["charge-point-id"])]),default:i(()=>[n(v,null,{default:i(()=>[n(b,null,{default:i(()=>[n(h,null,{default:i(()=>[n(b,null,{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0"},{default:i(()=>[e.mqttStore.getRfidEnabled?(d(),u(V,{key:0,"charge-point-id":l.chargePointId},null,8,["charge-point-id"])):m("",!0),n(C,{"charge-point-id":l.chargePointId,"changes-locked":l.changesLocked},null,8,["charge-point-id","changes-locked"])]),_:1}),n(h,{class:"_text-align:right _padding-left:0"},{default:i(()=>[r(s(e.mqttStore.getChargePointPower(l.chargePointId))+" "+s(e.mqttStore.getChargePointPhasesInUse(l.chargePointId))+" "+s(e.mqttStore.getChargePointSetCurrent(l.chargePointId)),1)]),_:1})]),_:1}),n(b,{class:"_padding-top:1"},{default:i(()=>[n(h,{class:"_padding-left:0"},{default:i(()=>[n(k,{color:"var(--color--primary)",data:e.mqttStore.getChargePointPowerChartData(l.chargePointId)},null,8,["data"])]),_:1})]),_:1})]),_:1}),n(h,{md:"6"},{default:i(()=>[n(b,{class:"_display:flex"},{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0 _flex-grow:1"},{default:i(()=>[n(P,{size:"lg",class:q(["_width:100%",l.changesLocked?"":"clickable"]),onClick:t[0]||(t[0]=y=>c.handleVehicleClick(l.chargePointId))},{default:i(()=>[n(I,{"fixed-width":"",icon:["fas","fa-car"]}),r(" "+s(e.mqttStore.getChargePointConnectedVehicleName(l.chargePointId)),1)]),_:1},8,["class"])]),_:1}),e.mqttStore.getVehicleSocConfigured(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))||e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))!=0?(d(),u(h,{key:0,class:"_flex-grow:0 _padding-right:0 _padding-left:1"},{default:i(()=>[n(w,{size:"sm",disabled:l.changesLocked,class:q(l.changesLocked?"":"clickable"),onClick:t[1]||(t[1]=y=>c.handleSocClick(l.chargePointId))},{default:i(()=>[e.mqttStore.getVehicleSocConfigured(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))?(d(),S("span",Ve,[n(I,{"fixed-width":"",icon:e.mqttStore.getVehicleSocIsManual(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))?["fas","fa-edit"]:["fas","fa-car-battery"]},null,8,["icon"]),r(" "+s(e.mqttStore.getChargePointConnectedVehicleSoc(l.chargePointId).soc)+"% ",1)])):m("",!0),e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))!=0?(d(),u(I,{key:1,"fixed-width":"",icon:e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>0?e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>1?["fas","times-circle"]:["fas","exclamation-triangle"]:[],class:q(e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>0?e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>1?"_color:danger":"_color:warning":"")},null,8,["icon","class"])):m("",!0)]),_:1},8,["disabled","class"])]),_:1})):m("",!0)]),_:1}),n(b,{class:"_padding-top:1 _display:flex"},{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0 _flex-grow:1"},{default:i(()=>[n(P,{size:"lg",class:q(["_width:100%",l.changesLocked?"":"clickable"]),color:e.mqttStore.getChargePointConnectedVehicleChargeMode(l.chargePointId).class,onClick:t[2]||(t[2]=y=>c.handleChargeModeClick(l.chargePointId))},{default:i(()=>[r(s(e.mqttStore.getChargePointConnectedVehicleChargeMode(l.chargePointId).label)+" ",1),n(I,{"fixed-width":"",icon:e.mqttStore.getChargePointConnectedVehiclePriority(l.chargePointId)?["fas","fa-star"]:["far","fa-star"],class:q(e.mqttStore.getChargePointConnectedVehiclePriority(l.chargePointId)?"_color:warning":"")},null,8,["icon","class"])]),_:1},8,["class","color"])]),_:1}),e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(l.chargePointId)?(d(),u(h,{key:0,class:"_flex-grow:0 _padding-right:0 _padding-left:1"},{default:i(()=>[n(P,{size:"lg"},{default:i(()=>[e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(l.chargePointId)?(d(),u(I,{key:0,"fixed-width":"",icon:e.mqttStore.getChargePointConnectedVehicleTimeChargingRunning(l.chargePointId)?["fas","fa-clock"]:["far","fa-clock"],class:q(e.mqttStore.getChargePointConnectedVehicleTimeChargingRunning(l.chargePointId)?"_color:success":"")},null,8,["icon","class"])):m("",!0)]),_:1})]),_:1})):m("",!0)]),_:1}),l.changesLocked?m("",!0):(d(),u(b,{key:0,class:"_padding-top:1"},{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0"},{default:i(()=>[n(w,{block:"",onClick:t[3]||(t[3]=y=>c.toggleChargePointSettings(l.chargePointId))},{default:i(()=>[n(I,{"fixed-width":"",icon:["fas","fa-wrench"]})]),_:1})]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1})}const Ie=T(Se,[["render",be],["__scopeId","data-v-3c6489c4"]]);N.add(E,U,D,Z,R,j,O,J,K,G,H);const ve={name:"ChargePointCard",components:{DashBoardCard:z,ChargePointPlugBadge:W,ChargePointLockButton:Q,ChargePointCodeButton:X,FontAwesomeIcon:A},props:{chargePointId:{type:Number,required:!0},changesLocked:{type:Boolean,required:!0}},emits:["vehicle-click","soc-click","charge-mode-click","toggle-charge-point-settings","set-charge-point-connected-vehicle-charge-mode"],data(){return{mqttStore:B(),simpleChargeModes:["instant_charging","pv_charging","stop"]}},computed:{filteredChargeModes(){return this.mqttStore.getSimpleChargePointView?this.mqttStore.chargeModeList().filter(o=>this.simpleChargeModes.includes(o.id)):this.mqttStore.chargeModeList()}},methods:{handleVehicleClick(o){this.$emit("vehicle-click",o)},handleSocClick(o){this.$emit("soc-click",o)},handleChargeModeClick(o){this.$emit("charge-mode-click",o)},toggleChargePointSettings(o){this.$emit("toggle-charge-point-settings",o)},setChargePointConnectedVehicleChargeMode(o,t){this.$emit("set-charge-point-connected-vehicle-charge-mode",o,t)}}},ke={key:0};function pe(o,t,l,_,e,c){const f=g("charge-point-plug-badge"),V=g("charge-point-code-button"),C=g("charge-point-lock-button"),h=g("i-column"),b=g("i-row"),k=g("font-awesome-icon"),I=g("i-button"),P=g("i-button-group"),w=g("i-container"),v=g("dash-board-card");return d(),u(v,{color:"primary"},{headerLeft:i(()=>[r(s(e.mqttStore.getChargePointName(l.chargePointId)),1)]),headerRight:i(()=>[n(f,{"charge-point-id":[l.chargePointId]},null,8,["charge-point-id"])]),default:i(()=>[n(w,null,{default:i(()=>[n(b,null,{default:i(()=>[n(h,null,{default:i(()=>[n(b,null,{default:i(()=>[n(h,{class:"_padding-left:0 _padding-right:0"},{default:i(()=>[e.mqttStore.getRfidEnabled?(d(),u(V,{key:0,"charge-point-id":l.chargePointId},null,8,["charge-point-id"])):m("",!0),n(C,{"charge-point-id":l.chargePointId,"changes-locked":l.changesLocked},null,8,["charge-point-id","changes-locked"])]),_:1}),n(h,{class:"_text-align:right _padding-left:0"},{default:i(()=>[r(s(e.mqttStore.getChargePointPower(l.chargePointId))+" "+s(e.mqttStore.getChargePointPhasesInUse(l.chargePointId))+" "+s(e.mqttStore.getChargePointSetCurrent(l.chargePointId)),1)]),_:1})]),_:1}),n(b,{class:"_padding-top:1"},{default:i(()=>[n(h,{class:"_padding-left:0 button-group-wrapper"},{default:i(()=>[n(P,{class:"button-group main-button-group"},{default:i(()=>[n(I,{class:q(["large-button _flex-grow:1",l.changesLocked?"":"clickable"]),disabled:l.changesLocked,onClick:t[0]||(t[0]=p=>c.handleVehicleClick(l.chargePointId))},{default:i(()=>[n(k,{"fixed-width":"",icon:["fas","fa-car"]}),r(" "+s(e.mqttStore.getChargePointConnectedVehicleName(l.chargePointId))+" ",1),n(k,{class:q(["_padding-left:1",e.mqttStore.getChargePointConnectedVehiclePriority(l.chargePointId)?"_color:warning":""]),"fixed-width":"",icon:e.mqttStore.getChargePointConnectedVehiclePriority(l.chargePointId)?["fas","fa-star"]:["far","fa-star"]},null,8,["icon","class"])]),_:1},8,["class","disabled"]),e.mqttStore.getVehicleSocConfigured(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))||e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))!=0?(d(),u(I,{key:0,class:q(["large-button _flex-grow:0",l.changesLocked?"":"clickable"]),disabled:l.changesLocked,onClick:t[1]||(t[1]=p=>c.handleSocClick(l.chargePointId))},{default:i(()=>[e.mqttStore.getVehicleSocConfigured(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))?(d(),S("span",ke,[n(k,{"fixed-width":"",icon:e.mqttStore.getVehicleSocIsManual(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))?["fas","fa-edit"]:["fas","fa-car-battery"]},null,8,["icon"]),r(" "+s(e.mqttStore.getChargePointConnectedVehicleSoc(l.chargePointId).soc)+"% ",1)])):m("",!0),e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))!=0?(d(),u(k,{key:1,"fixed-width":"",icon:e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>0?e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>1?["fas","times-circle"]:["fas","exclamation-triangle"]:[],class:q(e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>0?e.mqttStore.getVehicleFaultState(e.mqttStore.getChargePointConnectedVehicleId(l.chargePointId))>1?"_color:danger":"_color:warning":"")},null,8,["icon","class"])):m("",!0)]),_:1},8,["disabled","class"])):m("",!0),n(I,{class:q(["large-button _flex-grow:0",l.changesLocked?"":"clickable"]),disabled:l.changesLocked,onClick:t[2]||(t[2]=p=>c.toggleChargePointSettings(l.chargePointId))},{default:i(()=>[n(k,{"fixed-width":"",icon:["fas","fa-wrench"]})]),_:1},8,["class","disabled"])]),_:1}),n(P,{class:"button-group _margin-top:1",disabled:l.changesLocked},{default:i(()=>[(d(!0),S(x,null,L(c.filteredChargeModes,p=>(d(),u(I,{key:p.id,outline:"",class:q(["large-button _flex-grow:1",l.changesLocked?"":"clickable"]),color:p.class!="dark"?p.class:"light",active:e.mqttStore.getChargePointConnectedVehicleChargeMode(l.chargePointId)!=null&&p.id==e.mqttStore.getChargePointConnectedVehicleChargeMode(l.chargePointId).mode,onClick:y=>c.setChargePointConnectedVehicleChargeMode(l.chargePointId,p.id)},{default:i(()=>[r(s(p.label),1)]),_:2},1032,["class","color","active","onClick"]))),128))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}const qe=T(ve,[["render",pe],["__scopeId","data-v-5e676b1f"]]),we={name:"ExtendedNumberInput",inheritAttrs:!1,props:{modelValue:{type:Number,required:!0,default:NaN},unit:{type:String,default:""},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},labels:{type:Array,default:void 0}},emits:["update:modelValue"],data(){return{minimum:this.labels?0:this.min,maximum:this.labels?this.labels.length-1:this.max,stepSize:this.labels?1:this.step}},computed:{label(){var o;return this.labels&&this.inputValue!=null?this.inputValuec.label=C),plaintext:"",class:"_text-align:right",size:"lg"},{prepend:i(()=>[n(f,{onClick:c.decrement},{default:i(()=>[r(" - ")]),_:1},8,["onClick"])]),suffix:i(()=>[r(s(l.unit),1)]),append:i(()=>[n(f,{onClick:c.increment},{default:i(()=>[r(" + ")]),_:1},8,["onClick"])]),_:1},8,["modelValue"])}const Y=T(we,[["render",ye]]),xe={name:"ManualSocInput",components:{ExtendedNumberInput:Y,NumberPad:ie},props:{modelValue:{required:!0,type:Boolean,default:!1},vehicleId:{required:!0,type:Number,default:0}},emits:["update:modelValue"],data(){return{mqttStore:B(),newSoc:0}},methods:{enter(o){let t=this.newSoc*10+parseInt(o);t>=0&&t<=100&&(this.newSoc=t)},removeDigit(){this.newSoc=Math.trunc(this.newSoc/10)},clear(){this.newSoc=0},close(){this.$emit("update:modelValue",!1),this.newSoc=0},updateManualSoc(){this.$root.sendTopicToBroker(`openWB/vehicle/${this.vehicleId}/soc_module/calculated_soc_state/manual_soc`,this.newSoc),this.close()}}};function Me(o,t,l,_,e,c){const f=g("extended-number-input"),V=g("i-column"),C=g("i-row"),h=g("NumberPad"),b=g("i-container"),k=g("i-button"),I=g("i-modal");return d(),u(se,{to:"body"},[n(I,{"model-value":l.modelValue,size:"sm","onUpdate:modelValue":t[6]||(t[6]=P=>o.$emit("update:modelValue",P))},{header:i(()=>[r(' SoC für Fahrzeug "'+s(e.mqttStore.getVehicleName(l.vehicleId))+'" ',1)]),footer:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(V,null,{default:i(()=>[n(k,{color:"danger",onClick:t[4]||(t[4]=P=>c.close())},{default:i(()=>[r(" Zurück ")]),_:1})]),_:1}),n(V,{class:"_text-align:right"},{default:i(()=>[n(k,{color:"success",onClick:t[5]||(t[5]=P=>c.updateManualSoc())},{default:i(()=>[r(" OK ")]),_:1})]),_:1})]),_:1})]),_:1})]),default:i(()=>[n(b,null,{default:i(()=>[n(C,{center:"",class:"_padding-bottom:1"},{default:i(()=>[n(V,null,{default:i(()=>[n(f,{modelValue:e.newSoc,"onUpdate:modelValue":t[0]||(t[0]=P=>e.newSoc=P),unit:"%",min:0,max:100,step:1,size:"lg",class:"_text-align:center"},null,8,["modelValue"])]),_:1})]),_:1}),n(h,{"onKey:digit":t[1]||(t[1]=P=>c.enter(P)),"onKey:clear":t[2]||(t[2]=P=>c.clear()),"onKey:delete":t[3]||(t[3]=P=>c.removeDigit())})]),_:1})]),_:1},8,["model-value"])])}const Te=T(xe,[["render",Me]]);N.add(ce,de,ge,he);const Le={name:"ChargePointsView",components:{ChargePointCard:Ie,SimpleChargePointCard:qe,ExtendedNumberInput:Y,ManualSocInput:Te,FontAwesomeIcon:A},props:{changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:B(),modalChargeModeSettingVisible:!1,modalVehicleSelectVisible:!1,modalChargePointSettingsVisible:!1,modalChargePointId:0,modalVehicleId:0,modalActiveTab:"tab-general",modalManualSocInputVisible:!1,simpleChargeModes:["instant_charging","pv_charging","stop"]}},computed:{vehicleList(){let o=this.mqttStore.getVehicleList;var t=[];return Object.keys(o).forEach(l=>{let _=parseInt(l.match(/(?:\/)([0-9]+)(?=\/)*/g)[0].replace(/[^0-9]+/g,""));t.push({id:_,name:o[l]})}),t},filteredChargeModes(){return this.mqttStore.getSimpleChargePointView?this.mqttStore.chargeModeList().filter(o=>this.simpleChargeModes.includes(o.id)):this.mqttStore.chargeModeList()}},watch:{changesLocked(o,t){t!==!0&&o===!0&&(this.modalChargeModeSettingVisible=!1,this.modalVehicleSelectVisible=!1,this.modalChargePointSettingsVisible=!1,this.modalManualSocInputVisible=!1)}},methods:{toggleChargePointSettings(o){switch(this.mqttStore.getChargePointConnectedVehicleChargeMode(o).mode){case"pv_charging":this.modalActiveTab="tab-pv-charging";break;case"scheduled_charging":this.modalActiveTab="tab-scheduled-charging";break;default:this.modalActiveTab="tab-instant-charging"}this.modalChargePointId=o,this.modalChargePointSettingsVisible=!0},handleChargeModeClick(o){this.changesLocked||(this.modalChargePointId=o,this.modalChargeModeSettingVisible=!0)},handleVehicleClick(o){this.changesLocked||(this.modalChargePointId=o,this.modalVehicleSelectVisible=!0)},handleSocClick(o){let t=this.mqttStore.getChargePointConnectedVehicleId(o);if(this.mqttStore.getVehicleSocIsManual(t)){this.modalVehicleId=t,this.modalManualSocInputVisible=!0;return}this.$root.sendTopicToBroker(`openWB/set/vehicle/${t}/get/force_soc_update`,1)},setChargePointConnectedVehicle(o,t){t.id!=this.mqttStore.getChargePointConnectedVehicleId(o)&&this.$root.sendTopicToBroker(`openWB/chargepoint/${o}/config/ev`,t.id),this.modalVehicleSelectVisible&&(this.modalVehicleSelectVisible=!1)},setChargePointConnectedVehicleChargeMode(o,t){if(t.id!=this.mqttStore.getChargePointConnectedVehicleChargeMode(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/selected`,t)}},setChargePointConnectedVehiclePriority(o,t){if(t!=this.mqttStore.getChargePointConnectedVehiclePriority(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/prio`,t)}},setChargePointConnectedVehicleTimeChargingActive(o,t){if(t!=this.mqttStore.getChargePointConnectedVehicleTimeChargingActive(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/time_charging/active`,t)}},setChargePointConnectedVehicleInstantChargingCurrent(o,t){if(t&&t!=this.mqttStore.getChargePointConnectedVehicleInstantChargingCurrent(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/instant_charging/current`,parseFloat(t))}},setChargePointConnectedVehicleInstantChargingLimit(o,t){if(t&&t!=this.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(o).selected){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/instant_charging/limit/selected`,t)}},setChargePointConnectedVehicleInstantChargingLimitSoc(o,t){if(t&&t!=this.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(o).soc){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/instant_charging/limit/soc`,parseInt(t))}},setChargePointConnectedVehicleInstantChargingLimitAmount(o,t){if(t&&t!=this.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(o).amount){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/instant_charging/limit/amount`,t)}},setChargePointConnectedVehiclePvChargingFeedInLimit(o,t){if(t!=this.mqttStore.getChargePointConnectedVehiclePvChargingFeedInLimit(o)){var l=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${l}/chargemode/pv_charging/feed_in_limit`,t)}},setChargePointConnectedVehiclePvChargingMinCurrent(o,t){let l=this.mqttStore.getChargePointConnectedVehiclePvChargingMinCurrent(o),_=parseInt(t);if(_!=l&&!isNaN(_)){var e=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${e}/chargemode/pv_charging/min_current`,_)}},setChargePointConnectedVehiclePvChargingMinSoc(o,t){let l=this.mqttStore.getChargePointConnectedVehiclePvChargingMinSoc(o),_=parseInt(t);if(_!=l&&!isNaN(_)){var e=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${e}/chargemode/pv_charging/min_soc`,_)}},setChargePointConnectedVehiclePvChargingMinSocCurrent(o,t){let l=this.mqttStore.getChargePointConnectedVehiclePvChargingMinSocCurrent(o),_=parseInt(t);if(_!=l&&!isNaN(_)){var e=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${e}/chargemode/pv_charging/min_soc_current`,_)}},setChargePointConnectedVehiclePvChargingMaxSoc(o,t){let l=this.mqttStore.getChargePointConnectedVehiclePvChargingMaxSoc(o),_=parseInt(t);if(_!=l&&!isNaN(_)){var e=this.mqttStore.getChargePointConnectedVehicleChargeTemplateIndex(o);this.$root.sendTopicToBroker(`openWB/vehicle/template/charge_template/${e}/chargemode/pv_charging/max_soc`,_)}},setChargePointConnectedVehicleScheduledChargingPlanActive(o,t){this.$root.sendTopicToBroker(`${o}/active`,t)},setChargePointConnectedVehicleTimeChargingPlanActive(o,t){this.$root.sendTopicToBroker(`${o}/active`,t)}}},Be={class:"charge-points-card-wrapper"},Ne={key:0},Ae={key:1},Fe={key:2},ze={key:3},We={key:4},Ee={key:0},Ue={key:1},De={key:0},Ze={key:1},Re={key:2},je={key:3},Oe={key:4};function Je(o,t,l,_,e,c){const f=g("i-button"),V=g("i-button-group"),C=g("i-form-group"),h=g("i-form-label"),b=g("i-form"),k=g("i-modal"),I=g("i-tab-title"),P=g("extended-number-input"),w=g("i-tab"),v=g("font-awesome-icon"),p=g("i-alert"),y=g("i-row"),F=g("i-container"),$=g("i-tabs"),ee=g("manual-soc-input");return d(),S(x,null,[ue("div",Be,[(d(!0),S(x,null,L(e.mqttStore.getChargePointIds,a=>(d(),u(me(e.mqttStore.getSimpleChargePointView?"SimpleChargePointCard":"ChargePointCard"),{key:a,"charge-point-id":a,"changes-locked":l.changesLocked,onVehicleClick:c.handleVehicleClick,onSocClick:c.handleSocClick,onChargeModeClick:c.handleChargeModeClick,onToggleChargePointSettings:c.toggleChargePointSettings,onSetChargePointConnectedVehicleChargeMode:c.setChargePointConnectedVehicleChargeMode},null,40,["charge-point-id","changes-locked","onVehicleClick","onSocClick","onChargeModeClick","onToggleChargePointSettings","onSetChargePointConnectedVehicleChargeMode"]))),128))]),n(k,{modelValue:e.modalChargeModeSettingVisible,"onUpdate:modelValue":t[2]||(t[2]=a=>e.modalChargeModeSettingVisible=a),size:"lg"},{header:i(()=>[r(' Lademodus für "'+s(e.mqttStore.getChargePointConnectedVehicleName(e.modalChargePointId))+'" auswählen ',1)]),default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(V,{block:"",vertical:""},{default:i(()=>[(d(!0),S(x,null,L(c.filteredChargeModes,a=>(d(),u(f,{key:a.id,size:"lg",class:"large-button",outline:"",color:a.class!="dark"?a.class:"light",active:e.mqttStore.getChargePointConnectedVehicleChargeMode(e.modalChargePointId)!=null&&a.id==e.mqttStore.getChargePointConnectedVehicleChargeMode(e.modalChargePointId).mode,onClick:M=>c.setChargePointConnectedVehicleChargeMode(e.modalChargePointId,a.id)},{default:i(()=>[r(s(a.label),1)]),_:2},1032,["color","active","onClick"]))),128))]),_:1})]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Priorität")]),_:1}),n(V,{block:""},{default:i(()=>[n(f,{size:"lg",class:"large-button",color:e.mqttStore.getChargePointConnectedVehiclePriority(e.modalChargePointId)!==!0?"danger":"",onClick:t[0]||(t[0]=a=>c.setChargePointConnectedVehiclePriority(e.modalChargePointId,!1))},{default:i(()=>[r(" Nein ")]),_:1},8,["color"]),n(f,{color:e.mqttStore.getChargePointConnectedVehiclePriority(e.modalChargePointId)===!0?"success":"",onClick:t[1]||(t[1]=a=>c.setChargePointConnectedVehiclePriority(e.modalChargePointId,!0))},{default:i(()=>[r(" Ja ")]),_:1},8,["color"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),n(k,{modelValue:e.modalVehicleSelectVisible,"onUpdate:modelValue":t[3]||(t[3]=a=>e.modalVehicleSelectVisible=a),class:"modal-vehicle-select",size:"lg"},{header:i(()=>[r(' Fahrzeug an "'+s(e.mqttStore.getChargePointName(e.modalChargePointId))+'" auswählen ',1)]),default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(V,{vertical:"",block:""},{default:i(()=>[(d(!0),S(x,null,L(c.vehicleList,a=>(d(),u(f,{key:a.id,size:"lg",class:"large-button",active:e.mqttStore.getChargePointConnectedVehicleId(e.modalChargePointId)==a.id,color:e.mqttStore.getChargePointConnectedVehicleId(e.modalChargePointId)==a.id?"primary":"",onClick:M=>c.setChargePointConnectedVehicle(e.modalChargePointId,a)},{default:i(()=>[r(s(a.name),1)]),_:2},1032,["active","color","onClick"]))),128))]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),n(k,{modelValue:e.modalChargePointSettingsVisible,"onUpdate:modelValue":t[19]||(t[19]=a=>e.modalChargePointSettingsVisible=a),size:"lg"},{header:i(()=>[r(' Einstellungen für Fahrzeug "'+s(e.mqttStore.getChargePointConnectedVehicleName(e.modalChargePointId))+'" ',1)]),default:i(()=>[n($,{modelValue:e.modalActiveTab,"onUpdate:modelValue":t[18]||(t[18]=a=>e.modalActiveTab=a),stretch:""},{header:i(()=>[n(I,{for:"tab-instant-charging"},{default:i(()=>[r(" Sofort ")]),_:1}),n(I,{for:"tab-pv-charging"},{default:i(()=>[r(" PV ")]),_:1}),e.mqttStore.getSimpleChargePointView?m("",!0):(d(),u(I,{key:0,for:"tab-scheduled-charging"},{default:i(()=>[r(" Zielladen ")]),_:1})),e.mqttStore.getSimpleChargePointView?m("",!0):(d(),u(I,{key:1,for:"tab-time-charging"},{default:i(()=>[r(" Zeitladen ")]),_:1}))]),default:i(()=>[n(w,{name:"tab-instant-charging"},{default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Stromstärke")]),_:1}),n(P,{unit:"A",min:6,max:32,"model-value":e.mqttStore.getChargePointConnectedVehicleInstantChargingCurrent(e.modalChargePointId),"onUpdate:modelValue":t[4]||(t[4]=a=>c.setChargePointConnectedVehicleInstantChargingCurrent(e.modalChargePointId,a))},null,8,["model-value"])]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Begrenzung")]),_:1}),n(V,{block:""},{default:i(()=>[n(f,{color:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="none"?"primary":"",active:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="none",onClick:t[5]||(t[5]=a=>c.setChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId,"none"))},{default:i(()=>[r(" Keine ")]),_:1},8,["color","active"]),n(f,{color:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="soc"?"primary":"",active:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="soc",onClick:t[6]||(t[6]=a=>c.setChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId,"soc"))},{default:i(()=>[r(" EV-SoC ")]),_:1},8,["color","active"]),n(f,{color:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="amount"?"primary":"",active:e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="amount",onClick:t[7]||(t[7]=a=>c.setChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId,"amount"))},{default:i(()=>[r(" Energie ")]),_:1},8,["color","active"])]),_:1})]),_:1}),e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="soc"?(d(),u(C,{key:0},{default:i(()=>[n(h,null,{default:i(()=>[r("Max. SoC")]),_:1}),n(P,{unit:"%",min:5,max:100,step:5,"model-value":e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).soc,"onUpdate:modelValue":t[8]||(t[8]=a=>c.setChargePointConnectedVehicleInstantChargingLimitSoc(e.modalChargePointId,a))},null,8,["model-value"])]),_:1})):m("",!0),e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).selected=="amount"?(d(),u(C,{key:1},{default:i(()=>[n(h,null,{default:i(()=>[r("Max. Energie")]),_:1}),n(P,{unit:"kWh",min:1,max:100,"model-value":e.mqttStore.getChargePointConnectedVehicleInstantChargingLimit(e.modalChargePointId).amount/1e3,"onUpdate:modelValue":t[9]||(t[9]=a=>c.setChargePointConnectedVehicleInstantChargingLimitAmount(e.modalChargePointId,a*1e3))},null,8,["model-value"])]),_:1})):m("",!0)]),_:1})]),_:1}),n(w,{name:"tab-pv-charging"},{default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Einspeisegrenze beachten")]),_:1}),n(V,{block:""},{default:i(()=>[n(f,{color:e.mqttStore.getChargePointConnectedVehiclePvChargingFeedInLimit(e.modalChargePointId)!==!0?"danger":"",onClick:t[10]||(t[10]=a=>c.setChargePointConnectedVehiclePvChargingFeedInLimit(e.modalChargePointId,!1))},{default:i(()=>[r(" Nein ")]),_:1},8,["color"]),n(f,{color:e.mqttStore.getChargePointConnectedVehiclePvChargingFeedInLimit(e.modalChargePointId)===!0?"success":"",onClick:t[11]||(t[11]=a=>c.setChargePointConnectedVehiclePvChargingFeedInLimit(e.modalChargePointId,!0))},{default:i(()=>[r(" Ja ")]),_:1},8,["color"])]),_:1})]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Minimaler Dauerstrom")]),_:1}),n(P,{unit:"A",labels:[{label:"Aus",value:0},{label:6,value:6},{label:7,value:7},{label:8,value:8},{label:9,value:9},{label:10,value:10},{label:11,value:11},{label:12,value:12},{label:13,value:13},{label:14,value:14},{label:15,value:15},{label:16,value:16}],"model-value":e.mqttStore.getChargePointConnectedVehiclePvChargingMinCurrent(e.modalChargePointId),"onUpdate:modelValue":t[12]||(t[12]=a=>c.setChargePointConnectedVehiclePvChargingMinCurrent(e.modalChargePointId,a))},null,8,["model-value"])]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Mindest-SoC")]),_:1}),n(P,{unit:"%",labels:[{label:"Aus",value:0},{label:5,value:5},{label:10,value:10},{label:15,value:15},{label:20,value:20},{label:25,value:25},{label:30,value:30},{label:35,value:35},{label:40,value:40},{label:45,value:45},{label:50,value:50},{label:55,value:55},{label:60,value:60},{label:65,value:65},{label:70,value:70},{label:75,value:75},{label:80,value:80},{label:85,value:85},{label:90,value:90},{label:95,value:95}],"model-value":e.mqttStore.getChargePointConnectedVehiclePvChargingMinSoc(e.modalChargePointId),"onUpdate:modelValue":t[13]||(t[13]=a=>c.setChargePointConnectedVehiclePvChargingMinSoc(e.modalChargePointId,a))},null,8,["model-value"])]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Mindest-SoC Strom")]),_:1}),n(P,{min:6,max:32,unit:"A","model-value":e.mqttStore.getChargePointConnectedVehiclePvChargingMinSocCurrent(e.modalChargePointId),"onUpdate:modelValue":t[14]||(t[14]=a=>c.setChargePointConnectedVehiclePvChargingMinSocCurrent(e.modalChargePointId,a))},null,8,["model-value"])]),_:1}),n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("SoC-Limit")]),_:1}),n(P,{unit:"%",labels:[{label:5,value:5},{label:10,value:10},{label:15,value:15},{label:20,value:20},{label:25,value:25},{label:30,value:30},{label:35,value:35},{label:40,value:40},{label:45,value:45},{label:50,value:50},{label:55,value:55},{label:60,value:60},{label:65,value:65},{label:70,value:70},{label:75,value:75},{label:80,value:80},{label:85,value:85},{label:90,value:90},{label:95,value:95},{label:100,value:100},{label:"Aus",value:101}],"model-value":e.mqttStore.getChargePointConnectedVehiclePvChargingMaxSoc(e.modalChargePointId),"onUpdate:modelValue":t[15]||(t[15]=a=>c.setChargePointConnectedVehiclePvChargingMaxSoc(e.modalChargePointId,a))},null,8,["model-value"])]),_:1})]),_:1})]),_:1}),e.mqttStore.getSimpleChargePointView?m("",!0):(d(),u(w,{key:0,name:"tab-scheduled-charging"},{default:i(()=>[Object.keys(e.mqttStore.getChargePointConnectedVehicleScheduledChargingPlans(e.modalChargePointId)).length===0?(d(),u(p,{key:0},{icon:i(()=>[n(v,{"fixed-width":"",icon:["fas","fa-info-circle"]})]),default:i(()=>[r(" Es wurden noch keine Zeitpläne für das Zielladen eingerichtet. ")]),_:1})):(d(),u(b,{key:1},{default:i(()=>[(d(!0),S(x,null,L(e.mqttStore.getChargePointConnectedVehicleScheduledChargingPlans(e.modalChargePointId),(a,M)=>(d(),u(C,{key:M},{default:i(()=>[n(F,null,{default:i(()=>[n(y,null,{default:i(()=>[n(h,null,{default:i(()=>[r(s(a.name),1)]),_:2},1024)]),_:2},1024),n(y,null,{default:i(()=>[n(f,{size:"lg",block:"",color:a.active?"success":"danger",onClick:te=>c.setChargePointConnectedVehicleScheduledChargingPlanActive(M,!a.active)},{default:i(()=>[a.frequency.selected=="once"?(d(),S("span",Ne,[n(v,{"fixed-width":"",icon:["fas","calendar-day"]}),r(" "+s(e.mqttStore.formatDate(a.frequency.once)),1)])):m("",!0),a.frequency.selected=="daily"?(d(),S("span",Ae,[n(v,{"fixed-width":"",icon:["fas","calendar-week"]}),r(" täglich ")])):m("",!0),a.frequency.selected=="weekly"?(d(),S("span",Fe,[n(v,{"fixed-width":"",icon:["fas","calendar-alt"]}),r(" "+s(e.mqttStore.formatWeeklyScheduleDays(a.frequency.weekly)),1)])):m("",!0),n(v,{"fixed-width":"",icon:["fas","clock"]}),r(" "+s(a.time)+" ",1),a.limit.selected=="soc"?(d(),S("span",ze,[n(v,{"fixed-width":"",icon:["fas","car-battery"]}),r(" "+s(a.limit.soc_scheduled)+" % ",1)])):m("",!0),a.limit.selected=="amount"?(d(),S("span",We,[n(v,{"fixed-width":"",icon:["fas","bolt"]}),r(" "+s(a.limit.amount/1e3)+" kWh ",1)])):m("",!0)]),_:2},1032,["color","onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1}))]),_:1})),e.mqttStore.getSimpleChargePointView?m("",!0):(d(),u(w,{key:1,name:"tab-time-charging"},{default:i(()=>[n(b,null,{default:i(()=>[n(C,null,{default:i(()=>[n(h,null,{default:i(()=>[r("Zeitladen aktivieren")]),_:1}),n(V,{block:""},{default:i(()=>[n(f,{color:e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId)!==!0?"danger":"",onClick:t[16]||(t[16]=a=>c.setChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId,!1))},{default:i(()=>[r(" Nein ")]),_:1},8,["color"]),n(f,{color:e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId)===!0?"success":"",onClick:t[17]||(t[17]=a=>c.setChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId,!0))},{default:i(()=>[r(" Ja ")]),_:1},8,["color"])]),_:1})]),_:1}),e.mqttStore.getChargePointConnectedVehicleTimeChargingActive(e.modalChargePointId)===!0?(d(),S("div",Ee,[Object.keys(e.mqttStore.getChargePointConnectedVehicleTimeChargingPlans(e.modalChargePointId)).length===0?(d(),u(p,{key:0,color:"warning",class:"_margin-top:2"},{icon:i(()=>[n(v,{"fixed-width":"",icon:["fas","fa-circle-info"]})]),default:i(()=>[r(" Es wurden noch keine Zeitpläne für das Zeitladen eingerichtet. ")]),_:1})):(d(),S("div",Ue,[(d(!0),S(x,null,L(e.mqttStore.getChargePointConnectedVehicleTimeChargingPlans(e.modalChargePointId),(a,M)=>(d(),u(C,{key:M},{default:i(()=>[n(F,null,{default:i(()=>[n(y,null,{default:i(()=>[n(h,null,{default:i(()=>[r(s(a.name),1)]),_:2},1024)]),_:2},1024),n(y,null,{default:i(()=>[n(f,{size:"lg",block:"",color:a.active?"success":"danger",onClick:te=>c.setChargePointConnectedVehicleTimeChargingPlanActive(M,!a.active)},{default:i(()=>[a.frequency.selected=="once"?(d(),S("span",De,[n(v,{"fixed-width":"",icon:["fas","calendar-day"]}),r(" "+s(e.mqttStore.formatDateRange(a.frequency.once)),1)])):m("",!0),a.frequency.selected=="daily"?(d(),S("span",Ze,[n(v,{"fixed-width":"",icon:["fas","calendar-week"]}),r(" täglich ")])):m("",!0),a.frequency.selected=="weekly"?(d(),S("span",Re,[n(v,{"fixed-width":"",icon:["fas","calendar-alt"]}),r(" "+s(e.mqttStore.formatWeeklyScheduleDays(a.frequency.weekly)),1)])):m("",!0),n(v,{"fixed-width":"",icon:["fas","clock"]}),r(" "+s(a.time.join("-"))+" ",1),a.limit.selected=="soc"?(d(),S("span",je,[n(v,{"fixed-width":"",icon:["fas","car-battery"]}),r(" "+s(a.limit.soc)+" % ",1)])):m("",!0),a.limit.selected=="amount"?(d(),S("span",Oe,[n(v,{"fixed-width":"",icon:["fas","bolt"]}),r(" "+s(a.limit.amount/1e3)+" kWh ",1)])):m("",!0)]),_:2},1032,["color","onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]))])):m("",!0)]),_:1})]),_:1}))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"]),n(ee,{modelValue:e.modalManualSocInputVisible,"onUpdate:modelValue":t[20]||(t[20]=a=>e.modalManualSocInputVisible=a),"vehicle-id":e.modalVehicleId},null,8,["modelValue","vehicle-id"])],64)}const $e=T(Le,[["render",Je],["__scopeId","data-v-76699ceb"]]);export{$e as default}; diff --git a/packages/modules/display_themes/cards/web/assets/DashBoardView-ClYkWmHj.js b/packages/modules/display_themes/cards/web/assets/DashBoardView-DEUu_ZQW.js similarity index 97% rename from packages/modules/display_themes/cards/web/assets/DashBoardView-ClYkWmHj.js rename to packages/modules/display_themes/cards/web/assets/DashBoardView-DEUu_ZQW.js index 4bb2b9cd2b..576a691b9a 100644 --- a/packages/modules/display_themes/cards/web/assets/DashBoardView-ClYkWmHj.js +++ b/packages/modules/display_themes/cards/web/assets/DashBoardView-DEUu_ZQW.js @@ -1 +1 @@ -import{u as p}from"./index-D0wyw7xN.js";import{D as S}from"./DashBoardCard-R8Ma9lyF.js";import{S as q,C as k}from"./ChargePointPlugBadge-DAQjO_iO.js";import{l as P,d as v,F as w,e as x,g as B,h as D,i as I}from"./vendor-fortawesome-DM89TELH.js";import{_ as g}from"./vendor-inkline-CinPe9R0.js";import{l as e,o as c,n as d,p as o,s,k as i,x as m,i as _,e as H}from"./vendor-DnHbc_zZ.js";P.add(v);const L={name:"GridCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w},props:{},data(){return{mqttStore:p()}}};function E(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("spark-line"),n=e("dash-board-card");return c(),d(n,{color:"danger"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-gauge-high"]}),i(" EVU ")]),headerRight:o(()=>[i(m(t.mqttStore.getGridPower()),1)]),default:o(()=>[s(a,{color:"var(--color--danger)","color-negative":"var(--color--success)",data:t.mqttStore.getGridPowerChartData},null,8,["data"])]),_:1})}const V=g(L,[["render",E]]);P.add(x);const G={name:"BatteryCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w},props:{},data(){return{mqttStore:p()}}};function R(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("spark-line"),n=e("dash-board-card");return t.mqttStore.getBatteryConfigured?(c(),d(n,{key:0,color:"warning"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-car-battery"]}),i(" Speicher ")]),headerRight:o(()=>[i(m(t.mqttStore.getBatterySoc())+" / "+m(t.mqttStore.getBatteryPower()),1)]),default:o(()=>[s(a,{color:"var(--color--warning)",data:t.mqttStore.getBatteryPowerChartData,"soc-data":t.mqttStore.getBatterySocChartData},null,8,["data","soc-data"])]),_:1})):_("",!0)}const $=g(G,[["render",R]]);P.add(B);const N={name:"InverterCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w},props:{},data(){return{mqttStore:p()}}};function F(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("spark-line"),n=e("dash-board-card");return t.mqttStore.getPvConfigured?(c(),d(n,{key:0,color:"success"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-solar-panel"]}),i(" PV ")]),headerRight:o(()=>[i(m(t.mqttStore.getPvPower()),1)]),default:o(()=>[s(a,{color:"var(--color--success)",data:t.mqttStore.getPvPowerChartData,inverted:!0},null,8,["data"])]),_:1})):_("",!0)}const A=g(N,[["render",F]]);P.add(D);const M={name:"HomeCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w},props:{},data(){return{mqttStore:p()}}};function T(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("spark-line"),n=e("dash-board-card");return c(),d(n,{color:"light"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-home"]}),i(" Hausverbrauch ")]),headerRight:o(()=>[i(m(t.mqttStore.getHomePower()),1)]),default:o(()=>[s(a,{color:"var(--color--light)",data:t.mqttStore.getHomePowerChartData},null,8,["data"])]),_:1})}const U=g(M,[["render",T]]);P.add(I);const j={name:"ChargePointsCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w,ChargePointPlugBadge:k},props:{},data(){return{mqttStore:p()}}};function z(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("charge-point-plug-badge"),n=e("spark-line"),y=e("dash-board-card");return t.mqttStore.getChargePointIds.length>0?(c(),d(y,{key:0,color:"primary"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-charging-station"]}),i(" "+m(t.mqttStore.getChargePointIds.length==1?t.mqttStore.getChargePointName(t.mqttStore.getChargePointIds[0]):"Ladepunkte"),1)]),headerRight:o(()=>[i(m(t.mqttStore.getChargePointIds.length==1?t.mqttStore.getChargePointPower(t.mqttStore.getChargePointIds[0]):t.mqttStore.getChargePointSumPower())+" ",1),s(a,{"charge-point-id":t.mqttStore.getChargePointIds,"show-energy-charged":!1},null,8,["charge-point-id"])]),default:o(()=>[s(n,{color:"var(--color--primary)",data:t.mqttStore.getChargePointIds.length==1?t.mqttStore.getChargePointPowerChartData(t.mqttStore.getChargePointIds[0]):t.mqttStore.getChargePointSumPowerChartData},null,8,["data"])]),_:1})):_("",!0)}const J=g(j,[["render",z]]),K={name:"DashboardView",components:{GridCard:V,HomeCard:U,BatteryCard:$,InverterCard:A,ChargePointsCard:J},props:{changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:p()}}},O={class:"dash-board-card-wrapper"};function Q(h,l,f,u,t,C){const r=e("grid-card"),a=e("home-card"),n=e("battery-card"),y=e("inverter-card"),b=e("charge-points-card");return c(),H("div",O,[t.mqttStore.getGridCardEnabled?(c(),d(r,{key:0})):_("",!0),t.mqttStore.getHomeCardEnabled?(c(),d(a,{key:1})):_("",!0),t.mqttStore.getBatteryCardEnabled?(c(),d(n,{key:2})):_("",!0),t.mqttStore.getPvCardEnabled?(c(),d(y,{key:3})):_("",!0),t.mqttStore.getChargePointsCardEnabled?(c(),d(b,{key:4})):_("",!0)])}const ot=g(K,[["render",Q],["__scopeId","data-v-2085947b"]]);export{ot as default}; +import{u as p}from"./index-DTagQ25V.js";import{D as S}from"./DashBoardCard-R8Ma9lyF.js";import{S as q,C as k}from"./ChargePointPlugBadge-B7K7z1N_.js";import{l as P,d as v,F as w,e as x,g as B,h as D,i as I}from"./vendor-fortawesome-DM89TELH.js";import{_ as g}from"./vendor-inkline-CinPe9R0.js";import{l as e,o as c,n as d,p as o,s,k as i,x as m,i as _,e as H}from"./vendor-DnHbc_zZ.js";P.add(v);const L={name:"GridCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w},props:{},data(){return{mqttStore:p()}}};function E(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("spark-line"),n=e("dash-board-card");return c(),d(n,{color:"danger"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-gauge-high"]}),i(" EVU ")]),headerRight:o(()=>[i(m(t.mqttStore.getGridPower()),1)]),default:o(()=>[s(a,{color:"var(--color--danger)","color-negative":"var(--color--success)",data:t.mqttStore.getGridPowerChartData},null,8,["data"])]),_:1})}const V=g(L,[["render",E]]);P.add(x);const G={name:"BatteryCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w},props:{},data(){return{mqttStore:p()}}};function R(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("spark-line"),n=e("dash-board-card");return t.mqttStore.getBatteryConfigured?(c(),d(n,{key:0,color:"warning"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-car-battery"]}),i(" Speicher ")]),headerRight:o(()=>[i(m(t.mqttStore.getBatterySoc())+" / "+m(t.mqttStore.getBatteryPower()),1)]),default:o(()=>[s(a,{color:"var(--color--warning)",data:t.mqttStore.getBatteryPowerChartData,"soc-data":t.mqttStore.getBatterySocChartData},null,8,["data","soc-data"])]),_:1})):_("",!0)}const $=g(G,[["render",R]]);P.add(B);const N={name:"InverterCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w},props:{},data(){return{mqttStore:p()}}};function F(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("spark-line"),n=e("dash-board-card");return t.mqttStore.getPvConfigured?(c(),d(n,{key:0,color:"success"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-solar-panel"]}),i(" PV ")]),headerRight:o(()=>[i(m(t.mqttStore.getPvPower()),1)]),default:o(()=>[s(a,{color:"var(--color--success)",data:t.mqttStore.getPvPowerChartData,inverted:!0},null,8,["data"])]),_:1})):_("",!0)}const A=g(N,[["render",F]]);P.add(D);const M={name:"HomeCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w},props:{},data(){return{mqttStore:p()}}};function T(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("spark-line"),n=e("dash-board-card");return c(),d(n,{color:"light"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-home"]}),i(" Hausverbrauch ")]),headerRight:o(()=>[i(m(t.mqttStore.getHomePower()),1)]),default:o(()=>[s(a,{color:"var(--color--light)",data:t.mqttStore.getHomePowerChartData},null,8,["data"])]),_:1})}const U=g(M,[["render",T]]);P.add(I);const j={name:"ChargePointsCard",components:{DashBoardCard:S,SparkLine:q,FontAwesomeIcon:w,ChargePointPlugBadge:k},props:{},data(){return{mqttStore:p()}}};function z(h,l,f,u,t,C){const r=e("font-awesome-icon"),a=e("charge-point-plug-badge"),n=e("spark-line"),y=e("dash-board-card");return t.mqttStore.getChargePointIds.length>0?(c(),d(y,{key:0,color:"primary"},{headerLeft:o(()=>[s(r,{"fixed-width":"",icon:["fas","fa-charging-station"]}),i(" "+m(t.mqttStore.getChargePointIds.length==1?t.mqttStore.getChargePointName(t.mqttStore.getChargePointIds[0]):"Ladepunkte"),1)]),headerRight:o(()=>[i(m(t.mqttStore.getChargePointIds.length==1?t.mqttStore.getChargePointPower(t.mqttStore.getChargePointIds[0]):t.mqttStore.getChargePointSumPower())+" ",1),s(a,{"charge-point-id":t.mqttStore.getChargePointIds,"show-energy-charged":!1},null,8,["charge-point-id"])]),default:o(()=>[s(n,{color:"var(--color--primary)",data:t.mqttStore.getChargePointIds.length==1?t.mqttStore.getChargePointPowerChartData(t.mqttStore.getChargePointIds[0]):t.mqttStore.getChargePointSumPowerChartData},null,8,["data"])]),_:1})):_("",!0)}const J=g(j,[["render",z]]),K={name:"DashboardView",components:{GridCard:V,HomeCard:U,BatteryCard:$,InverterCard:A,ChargePointsCard:J},props:{changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:p()}}},O={class:"dash-board-card-wrapper"};function Q(h,l,f,u,t,C){const r=e("grid-card"),a=e("home-card"),n=e("battery-card"),y=e("inverter-card"),b=e("charge-points-card");return c(),H("div",O,[t.mqttStore.getGridCardEnabled?(c(),d(r,{key:0})):_("",!0),t.mqttStore.getHomeCardEnabled?(c(),d(a,{key:1})):_("",!0),t.mqttStore.getBatteryCardEnabled?(c(),d(n,{key:2})):_("",!0),t.mqttStore.getPvCardEnabled?(c(),d(y,{key:3})):_("",!0),t.mqttStore.getChargePointsCardEnabled?(c(),d(b,{key:4})):_("",!0)])}const ot=g(K,[["render",Q],["__scopeId","data-v-2085947b"]]);export{ot as default}; diff --git a/packages/modules/display_themes/cards/web/assets/EnergyFlowView-DEwG1TbM.js b/packages/modules/display_themes/cards/web/assets/EnergyFlowView-C2EKjwZe.js similarity index 99% rename from packages/modules/display_themes/cards/web/assets/EnergyFlowView-DEwG1TbM.js rename to packages/modules/display_themes/cards/web/assets/EnergyFlowView-C2EKjwZe.js index c19385a057..079d7140a4 100644 --- a/packages/modules/display_themes/cards/web/assets/EnergyFlowView-DEwG1TbM.js +++ b/packages/modules/display_themes/cards/web/assets/EnergyFlowView-C2EKjwZe.js @@ -1 +1 @@ -import{u as y}from"./index-D0wyw7xN.js";import{D as V}from"./DashBoardCard-R8Ma9lyF.js";import{l as v,o,n as x,p as d,k as m,s as R,j as n,e as c,F as C,A as S,z as g,i as u,x as w,Q as p}from"./vendor-DnHbc_zZ.js";import{_ as f}from"./vendor-inkline-CinPe9R0.js";import"./vendor-fortawesome-DM89TELH.js";const P={name:"DashboardFlowCard",components:{DashBoardCard:V},props:{changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:y(),svgSize:{xMin:0,xMax:150,yMin:0,yMax:105,circleRadius:10,strokeWidth:.5,textSize:5,numRows:4,numColumns:3}}},computed:{svgViewBox(){return`${this.svgSize.xMin} ${this.svgSize.yMin} ${this.svgSize.xMax} ${this.svgSize.yMax}`},svgFontSize(){return`${this.svgSize.textSize}px`},svgRectWidth(){return(this.svgSize.xMax-this.svgSize.xMin-this.svgSize.strokeWidth-this.svgSize.numColumns)/this.svgSize.numColumns},svgStrokeWidth(){return this.svgSize.strokeWidth},svgIconWidth(){return this.svgSize.circleRadius},svgIconHeight(){return this.svgSize.circleRadius},gridPower(){return this.mqttStore.getGridPower("object")},pvPower(){return this.mqttStore.getPvPower("object")},homePower(){return this.mqttStore.getHomePower("object")},batteryPower(){return this.mqttStore.getBatteryPower("object")},batterySoc(){return this.mqttStore.getBatterySoc("object").value/100},connectedChargePoints(){return this.mqttStore.getChargePointIds},chargePointSumPower(){return this.mqttStore.getChargePointSumPower("object")},chargePoint1Power(){return this.connectedChargePoints.length>0?this.mqttStore.getChargePointPower(this.connectedChargePoints[0],"object")||{textValue:"Loading..."}:{textValue:"N/A"}},chargePoint2Power(){return this.connectedChargePoints.length>1?this.mqttStore.getChargePointPower(this.connectedChargePoints[1],"object")||{textValue:"Loading..."}:{textValue:"N/A"}},chargePoint3Power(){return this.connectedChargePoints.length>2?this.mqttStore.getChargePointPower(this.connectedChargePoints[2],"object")||{textValue:"Loading..."}:{textValue:"N/A"}},chargePoint1Name(){return this.mqttStore.getChargePointName(this.connectedChargePoints[0])},chargePoint2Name(){return this.mqttStore.getChargePointName(this.connectedChargePoints[1])},chargePoint3Name(){return this.mqttStore.getChargePointName(this.connectedChargePoints[2])},chargePoint1VehicleConnected(){return this.mqttStore.getChargePointPlugState(this.connectedChargePoints[0])},chargePoint2VehicleConnected(){return this.mqttStore.getChargePointPlugState(this.connectedChargePoints[1])},chargePoint3VehicleConnected(){return this.mqttStore.getChargePointPlugState(this.connectedChargePoints[2])},chargePoint1ConnectedVehicleName(){return this.mqttStore.getChargePointConnectedVehicleName(this.connectedChargePoints[0])},chargePoint2ConnectedVehicleName(){return this.mqttStore.getChargePointConnectedVehicleName(this.connectedChargePoints[1])},chargePoint3ConnectedVehicleName(){return this.mqttStore.getChargePointConnectedVehicleName(this.connectedChargePoints[2])},chargePoint1ConnectedVehicleChargeMode(){return this.mqttStore.getChargePointConnectedVehicleChargeMode(this.connectedChargePoints[0])},chargePoint2ConnectedVehicleChargeMode(){return this.mqttStore.getChargePointConnectedVehicleChargeMode(this.connectedChargePoints[1])},chargePoint3ConnectedVehicleChargeMode(){return this.mqttStore.getChargePointConnectedVehicleChargeMode(this.connectedChargePoints[2])},chargePoint1ConnectedVehicleSoc(){return this.mqttStore.getChargePointConnectedVehicleSoc(this.connectedChargePoints[0]).soc/100},chargePoint2ConnectedVehicleSoc(){return this.mqttStore.getChargePointConnectedVehicleSoc(this.connectedChargePoints[1]).soc/100},chargePoint3ConnectedVehicleSoc(){return this.mqttStore.getChargePointConnectedVehicleSoc(this.connectedChargePoints[2]).soc/100},gridConsumption(){return this.gridPower.value>0},gridFeedIn(){return this.gridPower.value<0},homeConsumption(){return this.homePower.value>0},homeProduction(){return this.homePower.value<0},pvProduction(){return this.pvPower.value>0},batteryDischarging(){return this.batteryPower.value<0},batteryCharging(){return this.batteryPower.value>0},chargePointSumCharging(){return this.chargePointSumPower.value>0},chargePointSumDischarging(){return this.chargePointSumPower.value<0},chargePoint1Charging(){return this.chargePoint1Power.value>0},chargePoint1Discharging(){return this.chargePoint1Power.value<0},chargePoint2Charging(){return this.chargePoint2Power.value>0},chargePoint2Discharging(){return this.chargePoint2Power.value<0},chargePoint3Charging(){return this.chargePoint3Power.value>0},chargePoint3Discharging(){return this.chargePoint3Power.value<0},svgComponents(){var e=[];return this.mqttStore.getThemeConfiguration.enable_dashboard_card_grid&&e.push({id:"grid",class:{base:"grid",valueLabel:this.gridFeedIn?"fill-success":this.gridConsumption?"fill-danger":"",animated:this.gridConsumption,animatedReverse:this.gridFeedIn},position:{row:0,column:0},label:["EVU",this.gridPower.textValue],icon:"icons/owbGrid.svg"}),this.mqttStore.getThemeConfiguration.enable_dashboard_card_home_consumption&&e.push({id:"home",class:{base:"home",valueLabel:"",animated:this.homeProduction,animatedReverse:this.homeConsumption},position:{row:0,column:2},label:["Haus",this.homePower.textValue],icon:"icons/owbHouse.svg"}),this.mqttStore.getPvConfigured&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_inverter_sum&&e.push({id:"pv",class:{base:"pv",valueLabel:this.pvProduction?"fill-success":"",animated:this.pvProduction,animatedReverse:!1},position:{row:1,column:0},label:["PV",this.pvPower.textValue],icon:"icons/owbPV.svg"}),this.mqttStore.getBatteryConfigured&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_battery_sum&&e.push({id:"battery",class:{base:"battery",valueLabel:"",animated:this.batteryDischarging,animatedReverse:this.batteryCharging},position:{row:1,column:2},label:["Speicher",this.batteryPower.textValue],soc:this.batterySoc,icon:"icons/owbBattery.svg"}),this.connectedChargePoints.length>0&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_charge_point_sum&&(this.connectedChargePoints.length<=3?(e.push({id:"charge-point-1",class:{base:"charge-point",valueLabel:"",animated:this.chargePoint1Discharging,animatedReverse:this.chargePoint1Charging},position:{row:2,column:this.connectedChargePoints.length>1?0:1},label:[this.chargePoint1Name,this.chargePoint1Power.textValue],icon:"icons/owbChargePoint.svg"}),this.chargePoint1VehicleConnected&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles&&e.push({id:"vehicle-1",class:{base:"vehicle",valueLabel:"fill-"+this.chargePoint1ConnectedVehicleChargeMode.class},position:{row:3,column:this.connectedChargePoints.length>1?0:1},label:[this.chargePoint1ConnectedVehicleName||"---",this.chargePoint1ConnectedVehicleChargeMode.label||"---"],soc:this.chargePoint1ConnectedVehicleSoc,icon:"icons/owbVehicle.svg"}),this.connectedChargePoints.length>1&&(e.push({id:"charge-point-2",class:{base:"charge-point",valueLabel:"",animated:this.chargePoint2Discharging,animatedReverse:this.chargePoint2Charging},position:{row:2,column:this.connectedChargePoints.length>2?1:2},label:[this.chargePoint2Name,this.chargePoint2Power.textValue],icon:"icons/owbChargePoint.svg"}),this.chargePoint2VehicleConnected&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles&&e.push({id:"vehicle-2",class:{base:"vehicle",valueLabel:"fill-"+this.chargePoint2ConnectedVehicleChargeMode.class},position:{row:3,column:this.connectedChargePoints.length>2?1:2},label:[this.chargePoint2ConnectedVehicleName||"---",this.chargePoint2ConnectedVehicleChargeMode.label||"---"],soc:this.chargePoint2ConnectedVehicleSoc,icon:"icons/owbVehicle.svg"}),this.connectedChargePoints.length>2&&(e.push({id:"charge-point-3",class:{base:"charge-point",valueLabel:"",animated:this.chargePoint3Discharging,animatedReverse:this.chargePoint3Charging},position:{row:2,column:2},label:[this.chargePoint3Name,this.chargePoint3Power.textValue],icon:"icons/owbChargePoint.svg"}),this.chargePoint3VehicleConnected&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles&&e.push({id:"vehicle-3",class:{base:"vehicle",valueLabel:"fill-"+this.chargePoint3ConnectedVehicleChargeMode.class},position:{row:3,column:2},label:[this.chargePoint3ConnectedVehicleName||"---",this.chargePoint3ConnectedVehicleChargeMode.label||"---"],soc:this.chargePoint3ConnectedVehicleSoc,icon:"icons/owbVehicle.svg"})))):e.push({id:"charge-point-sum",class:{base:"charge-point",valueLabel:"",animated:this.chargePointSumDischarging,animatedReverse:this.chargePointSumCharging},position:{row:2,column:1},label:["Ladepunkte",this.chargePointSumPower.textValue],icon:"icons/owbChargePoint.svg"})),(!this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles||this.connectedChargePoints.length===0||this.connectedChargePoints.length>3)&&this.setSvgNumRows(3),e}},methods:{setSvgNumRows(e){this.svgSize.numRows=e},calcRowY(e){let r=this.svgSize.yMin+this.svgSize.strokeWidth+this.svgSize.circleRadius,a=this.svgSize.yMax-this.svgSize.strokeWidth-this.svgSize.circleRadius-r;return e*(a/(this.svgSize.numRows-1))+r},calcColumnX(e){let r=this.svgSize.xMin+this.svgSize.strokeWidth+this.svgRectWidth/2,a=this.svgSize.xMax-this.svgSize.strokeWidth-this.svgRectWidth/2-r;return e*(a/(this.svgSize.numColumns-1))+r},calcFlowLineAnchorX(e){let r=this.calcColumnX(e);return e<(this.svgSize.numColumns-1)/2?r+this.svgRectWidth/2-this.svgSize.circleRadius:e>(this.svgSize.numColumns-1)/2?r-this.svgRectWidth/2+this.svgSize.circleRadius:r},calcSvgElementBoundingBox(e){let r=document.getElementById(e);if(r==null)return{x:0,y:0,width:0,height:0};let h=r.getBBox();return{x:h.x,y:h.y,width:h.width,height:h.height}},beginAnimation(e){var r;this.$refs[e]!=null&&((r=this.$refs[e][0])==null||r.beginElement())}}},b=()=>{p(e=>({"2d21ce23":e.svgStrokeWidth,"0cb0615b":e.svgFontSize}))},_=P.setup;P.setup=_?(e,r)=>(b(),_(e,r)):b;const q={class:"svg-container"},M=["viewBox"],W={id:"layer1",style:{display:"inline"}},k=["d"],N={id:"layer2",style:{display:"inline"}},B=["cx","cy","r"],L=["transform","onClick"],F=["id"],D=["x","y","width","height"],j=["id"],I=["x","y","width","height","rx","ry"],E=["x","y","width","height","rx","ry"],T=["clip-path"],A=["id","x","y"],X=["values"],H=["id","x","y"],Y=["transform"],G=["r"],Q=["r","clip-path"],U=["href","x","y","height","width"];function J(e,r,h,a,t,s){const l=v("i-container"),z=v("dash-board-card");return o(),x(z,{color:"primary"},{headerLeft:d(()=>[m(" Übersicht - Energiefluss ")]),default:d(()=>[R(l,null,{default:d(()=>[n("div",q,[(o(),c("svg",{viewBox:s.svgViewBox,version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg"},[n("g",W,[(o(!0),c(C,null,S(s.svgComponents,i=>(o(),c("path",{key:i.id,class:g([i.class.base,{animated:i.class.animated},{animatedReverse:i.class.animatedReverse}]),d:i.class.base!=="vehicle"?`M ${s.calcFlowLineAnchorX(i.position.column)}, ${s.calcRowY(i.position.row)} ${s.calcColumnX(1)}, ${s.calcRowY(1)}`:""},null,10,k))),128))]),n("g",N,[n("circle",{id:"center",cx:s.calcColumnX(1),cy:s.calcRowY(1),r:t.svgSize.circleRadius/3},null,8,B),(o(!0),c(C,null,S(s.svgComponents,i=>(o(),c("g",{key:i.id,class:g(i.class.base),transform:`translate(${s.calcColumnX(i.position.column)}, ${s.calcRowY(i.position.row)})`,onClick:$=>s.beginAnimation(`animate-label-${i.id}`)},[n("defs",null,[i.soc?(o(),c("clipPath",{key:0,id:`clip-soc-${i.id}`},[n("rect",{x:-t.svgSize.circleRadius-t.svgSize.strokeWidth,y:(t.svgSize.circleRadius+t.svgSize.strokeWidth)*(1-2*i.soc),width:(t.svgSize.circleRadius+t.svgSize.strokeWidth)*2,height:(t.svgSize.circleRadius+t.svgSize.strokeWidth)*2*i.soc},null,8,D)],8,F)):u("",!0),n("clipPath",{id:`clip-label-${i.id}`},[n("rect",{x:-s.svgRectWidth/2,y:-t.svgSize.circleRadius,width:s.svgRectWidth,height:t.svgSize.circleRadius*2,rx:t.svgSize.circleRadius,ry:t.svgSize.circleRadius},null,8,I)],8,j)]),n("rect",{x:-s.svgRectWidth/2,y:-t.svgSize.circleRadius,width:s.svgRectWidth,height:t.svgSize.circleRadius*2,rx:t.svgSize.circleRadius,ry:t.svgSize.circleRadius},null,8,E),n("text",{"clip-path":`url(#clip-label-${i.id})`},[n("tspan",{id:`label-${i.id}`,"text-anchor":"start",x:-s.svgRectWidth/2+2*t.svgSize.circleRadius+t.svgSize.strokeWidth,y:-t.svgSize.textSize/2},[s.calcSvgElementBoundingBox(`label-${i.id}`).width>s.svgRectWidth-2*t.svgSize.circleRadius-2*t.svgSize.strokeWidth?(o(),c("animate",{key:0,ref_for:!0,ref:`animate-label-${i.id}`,xmlns:"http://www.w3.org/2000/svg",attributeName:"x",dur:"5s",values:"0; "+(-s.calcSvgElementBoundingBox(`label-${i.id}`).width+s.svgRectWidth-2.5*t.svgSize.circleRadius-2*t.svgSize.strokeWidth)+"; 0;",repeatCount:"0",begin:"2s",additive:"sum"},null,8,X)):u("",!0),m(" "+w(i.label[0]),1)],8,A),n("tspan",{id:`value-${i.id}`,class:g(i.class.valueLabel),"text-anchor":"end",x:2*t.svgSize.circleRadius+t.svgSize.strokeWidth,y:t.svgSize.textSize},w(i.label[1]),11,H)],8,T),n("g",{transform:`translate(${t.svgSize.circleRadius-s.svgRectWidth/2}, 0)`},[n("circle",{cx:"0",cy:"0",r:t.svgSize.circleRadius,class:g({soc:i.soc})},null,10,G),i.soc?(o(),c("circle",{key:0,cx:"0",cy:"0",r:t.svgSize.circleRadius,"clip-path":`url(#clip-soc-${i.id})`},null,8,Q)):u("",!0),n("image",{href:i.icon,x:-s.svgIconWidth/2,y:-s.svgIconHeight/2,height:s.svgIconHeight,width:s.svgIconWidth},null,8,U)],8,Y)],10,L))),128))])],8,M))])]),_:1})]),_:1})}const K=f(P,[["render",J],["__scopeId","data-v-9e868ed0"]]),O={name:"EnergyFlowView",components:{FlowCard:K},props:{changesLocked:{required:!1,type:Boolean,default:!1}}};function Z(e,r,h,a,t,s){const l=v("FlowCard");return o(),x(l)}const ne=f(O,[["render",Z]]);export{ne as default}; +import{u as y}from"./index-DTagQ25V.js";import{D as V}from"./DashBoardCard-R8Ma9lyF.js";import{l as v,o,n as x,p as d,k as m,s as R,j as n,e as c,F as C,A as S,z as g,i as u,x as w,Q as p}from"./vendor-DnHbc_zZ.js";import{_ as f}from"./vendor-inkline-CinPe9R0.js";import"./vendor-fortawesome-DM89TELH.js";const P={name:"DashboardFlowCard",components:{DashBoardCard:V},props:{changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:y(),svgSize:{xMin:0,xMax:150,yMin:0,yMax:105,circleRadius:10,strokeWidth:.5,textSize:5,numRows:4,numColumns:3}}},computed:{svgViewBox(){return`${this.svgSize.xMin} ${this.svgSize.yMin} ${this.svgSize.xMax} ${this.svgSize.yMax}`},svgFontSize(){return`${this.svgSize.textSize}px`},svgRectWidth(){return(this.svgSize.xMax-this.svgSize.xMin-this.svgSize.strokeWidth-this.svgSize.numColumns)/this.svgSize.numColumns},svgStrokeWidth(){return this.svgSize.strokeWidth},svgIconWidth(){return this.svgSize.circleRadius},svgIconHeight(){return this.svgSize.circleRadius},gridPower(){return this.mqttStore.getGridPower("object")},pvPower(){return this.mqttStore.getPvPower("object")},homePower(){return this.mqttStore.getHomePower("object")},batteryPower(){return this.mqttStore.getBatteryPower("object")},batterySoc(){return this.mqttStore.getBatterySoc("object").value/100},connectedChargePoints(){return this.mqttStore.getChargePointIds},chargePointSumPower(){return this.mqttStore.getChargePointSumPower("object")},chargePoint1Power(){return this.connectedChargePoints.length>0?this.mqttStore.getChargePointPower(this.connectedChargePoints[0],"object")||{textValue:"Loading..."}:{textValue:"N/A"}},chargePoint2Power(){return this.connectedChargePoints.length>1?this.mqttStore.getChargePointPower(this.connectedChargePoints[1],"object")||{textValue:"Loading..."}:{textValue:"N/A"}},chargePoint3Power(){return this.connectedChargePoints.length>2?this.mqttStore.getChargePointPower(this.connectedChargePoints[2],"object")||{textValue:"Loading..."}:{textValue:"N/A"}},chargePoint1Name(){return this.mqttStore.getChargePointName(this.connectedChargePoints[0])},chargePoint2Name(){return this.mqttStore.getChargePointName(this.connectedChargePoints[1])},chargePoint3Name(){return this.mqttStore.getChargePointName(this.connectedChargePoints[2])},chargePoint1VehicleConnected(){return this.mqttStore.getChargePointPlugState(this.connectedChargePoints[0])},chargePoint2VehicleConnected(){return this.mqttStore.getChargePointPlugState(this.connectedChargePoints[1])},chargePoint3VehicleConnected(){return this.mqttStore.getChargePointPlugState(this.connectedChargePoints[2])},chargePoint1ConnectedVehicleName(){return this.mqttStore.getChargePointConnectedVehicleName(this.connectedChargePoints[0])},chargePoint2ConnectedVehicleName(){return this.mqttStore.getChargePointConnectedVehicleName(this.connectedChargePoints[1])},chargePoint3ConnectedVehicleName(){return this.mqttStore.getChargePointConnectedVehicleName(this.connectedChargePoints[2])},chargePoint1ConnectedVehicleChargeMode(){return this.mqttStore.getChargePointConnectedVehicleChargeMode(this.connectedChargePoints[0])},chargePoint2ConnectedVehicleChargeMode(){return this.mqttStore.getChargePointConnectedVehicleChargeMode(this.connectedChargePoints[1])},chargePoint3ConnectedVehicleChargeMode(){return this.mqttStore.getChargePointConnectedVehicleChargeMode(this.connectedChargePoints[2])},chargePoint1ConnectedVehicleSoc(){return this.mqttStore.getChargePointConnectedVehicleSoc(this.connectedChargePoints[0]).soc/100},chargePoint2ConnectedVehicleSoc(){return this.mqttStore.getChargePointConnectedVehicleSoc(this.connectedChargePoints[1]).soc/100},chargePoint3ConnectedVehicleSoc(){return this.mqttStore.getChargePointConnectedVehicleSoc(this.connectedChargePoints[2]).soc/100},gridConsumption(){return this.gridPower.value>0},gridFeedIn(){return this.gridPower.value<0},homeConsumption(){return this.homePower.value>0},homeProduction(){return this.homePower.value<0},pvProduction(){return this.pvPower.value>0},batteryDischarging(){return this.batteryPower.value<0},batteryCharging(){return this.batteryPower.value>0},chargePointSumCharging(){return this.chargePointSumPower.value>0},chargePointSumDischarging(){return this.chargePointSumPower.value<0},chargePoint1Charging(){return this.chargePoint1Power.value>0},chargePoint1Discharging(){return this.chargePoint1Power.value<0},chargePoint2Charging(){return this.chargePoint2Power.value>0},chargePoint2Discharging(){return this.chargePoint2Power.value<0},chargePoint3Charging(){return this.chargePoint3Power.value>0},chargePoint3Discharging(){return this.chargePoint3Power.value<0},svgComponents(){var e=[];return this.mqttStore.getThemeConfiguration.enable_dashboard_card_grid&&e.push({id:"grid",class:{base:"grid",valueLabel:this.gridFeedIn?"fill-success":this.gridConsumption?"fill-danger":"",animated:this.gridConsumption,animatedReverse:this.gridFeedIn},position:{row:0,column:0},label:["EVU",this.gridPower.textValue],icon:"icons/owbGrid.svg"}),this.mqttStore.getThemeConfiguration.enable_dashboard_card_home_consumption&&e.push({id:"home",class:{base:"home",valueLabel:"",animated:this.homeProduction,animatedReverse:this.homeConsumption},position:{row:0,column:2},label:["Haus",this.homePower.textValue],icon:"icons/owbHouse.svg"}),this.mqttStore.getPvConfigured&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_inverter_sum&&e.push({id:"pv",class:{base:"pv",valueLabel:this.pvProduction?"fill-success":"",animated:this.pvProduction,animatedReverse:!1},position:{row:1,column:0},label:["PV",this.pvPower.textValue],icon:"icons/owbPV.svg"}),this.mqttStore.getBatteryConfigured&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_battery_sum&&e.push({id:"battery",class:{base:"battery",valueLabel:"",animated:this.batteryDischarging,animatedReverse:this.batteryCharging},position:{row:1,column:2},label:["Speicher",this.batteryPower.textValue],soc:this.batterySoc,icon:"icons/owbBattery.svg"}),this.connectedChargePoints.length>0&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_charge_point_sum&&(this.connectedChargePoints.length<=3?(e.push({id:"charge-point-1",class:{base:"charge-point",valueLabel:"",animated:this.chargePoint1Discharging,animatedReverse:this.chargePoint1Charging},position:{row:2,column:this.connectedChargePoints.length>1?0:1},label:[this.chargePoint1Name,this.chargePoint1Power.textValue],icon:"icons/owbChargePoint.svg"}),this.chargePoint1VehicleConnected&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles&&e.push({id:"vehicle-1",class:{base:"vehicle",valueLabel:"fill-"+this.chargePoint1ConnectedVehicleChargeMode.class},position:{row:3,column:this.connectedChargePoints.length>1?0:1},label:[this.chargePoint1ConnectedVehicleName||"---",this.chargePoint1ConnectedVehicleChargeMode.label||"---"],soc:this.chargePoint1ConnectedVehicleSoc,icon:"icons/owbVehicle.svg"}),this.connectedChargePoints.length>1&&(e.push({id:"charge-point-2",class:{base:"charge-point",valueLabel:"",animated:this.chargePoint2Discharging,animatedReverse:this.chargePoint2Charging},position:{row:2,column:this.connectedChargePoints.length>2?1:2},label:[this.chargePoint2Name,this.chargePoint2Power.textValue],icon:"icons/owbChargePoint.svg"}),this.chargePoint2VehicleConnected&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles&&e.push({id:"vehicle-2",class:{base:"vehicle",valueLabel:"fill-"+this.chargePoint2ConnectedVehicleChargeMode.class},position:{row:3,column:this.connectedChargePoints.length>2?1:2},label:[this.chargePoint2ConnectedVehicleName||"---",this.chargePoint2ConnectedVehicleChargeMode.label||"---"],soc:this.chargePoint2ConnectedVehicleSoc,icon:"icons/owbVehicle.svg"}),this.connectedChargePoints.length>2&&(e.push({id:"charge-point-3",class:{base:"charge-point",valueLabel:"",animated:this.chargePoint3Discharging,animatedReverse:this.chargePoint3Charging},position:{row:2,column:2},label:[this.chargePoint3Name,this.chargePoint3Power.textValue],icon:"icons/owbChargePoint.svg"}),this.chargePoint3VehicleConnected&&this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles&&e.push({id:"vehicle-3",class:{base:"vehicle",valueLabel:"fill-"+this.chargePoint3ConnectedVehicleChargeMode.class},position:{row:3,column:2},label:[this.chargePoint3ConnectedVehicleName||"---",this.chargePoint3ConnectedVehicleChargeMode.label||"---"],soc:this.chargePoint3ConnectedVehicleSoc,icon:"icons/owbVehicle.svg"})))):e.push({id:"charge-point-sum",class:{base:"charge-point",valueLabel:"",animated:this.chargePointSumDischarging,animatedReverse:this.chargePointSumCharging},position:{row:2,column:1},label:["Ladepunkte",this.chargePointSumPower.textValue],icon:"icons/owbChargePoint.svg"})),(!this.mqttStore.getThemeConfiguration.enable_dashboard_card_vehicles||this.connectedChargePoints.length===0||this.connectedChargePoints.length>3)&&this.setSvgNumRows(3),e}},methods:{setSvgNumRows(e){this.svgSize.numRows=e},calcRowY(e){let r=this.svgSize.yMin+this.svgSize.strokeWidth+this.svgSize.circleRadius,a=this.svgSize.yMax-this.svgSize.strokeWidth-this.svgSize.circleRadius-r;return e*(a/(this.svgSize.numRows-1))+r},calcColumnX(e){let r=this.svgSize.xMin+this.svgSize.strokeWidth+this.svgRectWidth/2,a=this.svgSize.xMax-this.svgSize.strokeWidth-this.svgRectWidth/2-r;return e*(a/(this.svgSize.numColumns-1))+r},calcFlowLineAnchorX(e){let r=this.calcColumnX(e);return e<(this.svgSize.numColumns-1)/2?r+this.svgRectWidth/2-this.svgSize.circleRadius:e>(this.svgSize.numColumns-1)/2?r-this.svgRectWidth/2+this.svgSize.circleRadius:r},calcSvgElementBoundingBox(e){let r=document.getElementById(e);if(r==null)return{x:0,y:0,width:0,height:0};let h=r.getBBox();return{x:h.x,y:h.y,width:h.width,height:h.height}},beginAnimation(e){var r;this.$refs[e]!=null&&((r=this.$refs[e][0])==null||r.beginElement())}}},b=()=>{p(e=>({"2d21ce23":e.svgStrokeWidth,"0cb0615b":e.svgFontSize}))},_=P.setup;P.setup=_?(e,r)=>(b(),_(e,r)):b;const q={class:"svg-container"},M=["viewBox"],W={id:"layer1",style:{display:"inline"}},k=["d"],N={id:"layer2",style:{display:"inline"}},B=["cx","cy","r"],L=["transform","onClick"],F=["id"],D=["x","y","width","height"],j=["id"],I=["x","y","width","height","rx","ry"],E=["x","y","width","height","rx","ry"],T=["clip-path"],A=["id","x","y"],X=["values"],H=["id","x","y"],Y=["transform"],G=["r"],Q=["r","clip-path"],U=["href","x","y","height","width"];function J(e,r,h,a,t,s){const l=v("i-container"),z=v("dash-board-card");return o(),x(z,{color:"primary"},{headerLeft:d(()=>[m(" Übersicht - Energiefluss ")]),default:d(()=>[R(l,null,{default:d(()=>[n("div",q,[(o(),c("svg",{viewBox:s.svgViewBox,version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg"},[n("g",W,[(o(!0),c(C,null,S(s.svgComponents,i=>(o(),c("path",{key:i.id,class:g([i.class.base,{animated:i.class.animated},{animatedReverse:i.class.animatedReverse}]),d:i.class.base!=="vehicle"?`M ${s.calcFlowLineAnchorX(i.position.column)}, ${s.calcRowY(i.position.row)} ${s.calcColumnX(1)}, ${s.calcRowY(1)}`:""},null,10,k))),128))]),n("g",N,[n("circle",{id:"center",cx:s.calcColumnX(1),cy:s.calcRowY(1),r:t.svgSize.circleRadius/3},null,8,B),(o(!0),c(C,null,S(s.svgComponents,i=>(o(),c("g",{key:i.id,class:g(i.class.base),transform:`translate(${s.calcColumnX(i.position.column)}, ${s.calcRowY(i.position.row)})`,onClick:$=>s.beginAnimation(`animate-label-${i.id}`)},[n("defs",null,[i.soc?(o(),c("clipPath",{key:0,id:`clip-soc-${i.id}`},[n("rect",{x:-t.svgSize.circleRadius-t.svgSize.strokeWidth,y:(t.svgSize.circleRadius+t.svgSize.strokeWidth)*(1-2*i.soc),width:(t.svgSize.circleRadius+t.svgSize.strokeWidth)*2,height:(t.svgSize.circleRadius+t.svgSize.strokeWidth)*2*i.soc},null,8,D)],8,F)):u("",!0),n("clipPath",{id:`clip-label-${i.id}`},[n("rect",{x:-s.svgRectWidth/2,y:-t.svgSize.circleRadius,width:s.svgRectWidth,height:t.svgSize.circleRadius*2,rx:t.svgSize.circleRadius,ry:t.svgSize.circleRadius},null,8,I)],8,j)]),n("rect",{x:-s.svgRectWidth/2,y:-t.svgSize.circleRadius,width:s.svgRectWidth,height:t.svgSize.circleRadius*2,rx:t.svgSize.circleRadius,ry:t.svgSize.circleRadius},null,8,E),n("text",{"clip-path":`url(#clip-label-${i.id})`},[n("tspan",{id:`label-${i.id}`,"text-anchor":"start",x:-s.svgRectWidth/2+2*t.svgSize.circleRadius+t.svgSize.strokeWidth,y:-t.svgSize.textSize/2},[s.calcSvgElementBoundingBox(`label-${i.id}`).width>s.svgRectWidth-2*t.svgSize.circleRadius-2*t.svgSize.strokeWidth?(o(),c("animate",{key:0,ref_for:!0,ref:`animate-label-${i.id}`,xmlns:"http://www.w3.org/2000/svg",attributeName:"x",dur:"5s",values:"0; "+(-s.calcSvgElementBoundingBox(`label-${i.id}`).width+s.svgRectWidth-2.5*t.svgSize.circleRadius-2*t.svgSize.strokeWidth)+"; 0;",repeatCount:"0",begin:"2s",additive:"sum"},null,8,X)):u("",!0),m(" "+w(i.label[0]),1)],8,A),n("tspan",{id:`value-${i.id}`,class:g(i.class.valueLabel),"text-anchor":"end",x:2*t.svgSize.circleRadius+t.svgSize.strokeWidth,y:t.svgSize.textSize},w(i.label[1]),11,H)],8,T),n("g",{transform:`translate(${t.svgSize.circleRadius-s.svgRectWidth/2}, 0)`},[n("circle",{cx:"0",cy:"0",r:t.svgSize.circleRadius,class:g({soc:i.soc})},null,10,G),i.soc?(o(),c("circle",{key:0,cx:"0",cy:"0",r:t.svgSize.circleRadius,"clip-path":`url(#clip-soc-${i.id})`},null,8,Q)):u("",!0),n("image",{href:i.icon,x:-s.svgIconWidth/2,y:-s.svgIconHeight/2,height:s.svgIconHeight,width:s.svgIconWidth},null,8,U)],8,Y)],10,L))),128))])],8,M))])]),_:1})]),_:1})}const K=f(P,[["render",J],["__scopeId","data-v-9e868ed0"]]),O={name:"EnergyFlowView",components:{FlowCard:K},props:{changesLocked:{required:!1,type:Boolean,default:!1}}};function Z(e,r,h,a,t,s){const l=v("FlowCard");return o(),x(l)}const ne=f(O,[["render",Z]]);export{ne as default}; diff --git a/packages/modules/display_themes/cards/web/assets/StatusView-BaXuMl-p.js b/packages/modules/display_themes/cards/web/assets/StatusView-BaXuMl-p.js new file mode 100644 index 0000000000..a1a19af5e3 --- /dev/null +++ b/packages/modules/display_themes/cards/web/assets/StatusView-BaXuMl-p.js @@ -0,0 +1 @@ +import{u as S}from"./index-DTagQ25V.js";import{l as y,C as x,F as k,D as V}from"./vendor-fortawesome-DM89TELH.js";import{_ as h}from"./vendor-inkline-CinPe9R0.js";import{l as o,o as m,n as _,p as e,k as s,s as t,I as M,j as A,i as C}from"./vendor-DnHbc_zZ.js";import{D as I}from"./DashBoardCard-R8Ma9lyF.js";y.add(x);const P={name:"ReloadButton",components:{FontAwesomeIcon:k},props:{},data(){return{}},methods:{reloadDisplay(){location.reload()}}};function F(w,l,f,b,d,c){const u=o("FontAwesomeIcon"),n=o("i-button");return m(),_(n,{color:"success",size:"lg",onClick:l[0]||(l[0]=a=>c.reloadDisplay())},{default:e(()=>[s(" Display neu laden "),t(u,{"fixed-width":"",icon:["fas","fa-undo"]})]),_:1})}const z=h(P,[["render",F]]);y.add(x);const D={name:"RebootButton",components:{FontAwesomeIcon:k},props:{},data(){return{mqttStore:S(),showModal:!1}},methods:{toggleModal(){this.showModal=!this.showModal},cancel(){this.toggleModal()},confirm(){this.toggleModal(),console.log("reboot requested"),this.mqttStore.settings.parentChargePoint1!==void 0?(console.log("rebooting secondary charge point:",this.mqttStore.settings.parentChargePoint1),this.$root.sendSystemCommand("chargepointReboot",{chargePoint:this.mqttStore.settings.parentChargePoint1})):(console.log("rebooting primary system"),this.$root.sendSystemCommand("systemReboot"))}}};function N(w,l,f,b,d,c){const u=o("FontAwesomeIcon"),n=o("i-container"),a=o("i-button"),r=o("i-column"),p=o("i-row"),g=o("i-modal");return m(),_(a,{color:"warning",size:"lg",onClick:l[3]||(l[3]=i=>c.toggleModal())},{default:e(()=>[s(" openWB neu starten "),t(u,{"fixed-width":"",icon:["fas","fa-undo"]}),(m(),_(M,{to:"body"},[t(g,{modelValue:d.showModal,"onUpdate:modelValue":l[2]||(l[2]=i=>d.showModal=i),size:"sm"},{header:e(()=>[s(" openWB neu starten... ")]),footer:e(()=>[t(n,null,{default:e(()=>[t(p,null,{default:e(()=>[t(r,{class:"_text-align:right"},{default:e(()=>[t(a,{color:"success",onClick:l[0]||(l[0]=i=>c.cancel())},{default:e(()=>[s(" Zurück ")]),_:1})]),_:1}),t(r,null,{default:e(()=>[t(a,{color:"danger",onClick:l[1]||(l[1]=i=>c.confirm())},{default:e(()=>[s(" Neustart ")]),_:1})]),_:1})]),_:1})]),_:1})]),default:e(()=>[t(n,null,{default:e(()=>[s(" Möchten Sie diese openWB wirklich neu starten? ")]),_:1})]),_:1},8,["modelValue"])]))]),_:1})}const R=h(D,[["render",N]]);y.add(V);const W={name:"ShutdownButton",components:{FontAwesomeIcon:k},props:{},data(){return{mqttStore:S(),showModal:!1}},methods:{toggleModal(){this.showModal=!this.showModal},cancel(){this.toggleModal()},confirm(){this.toggleModal(),console.log("shutdown requested"),this.mqttStore.settings.parentChargePoint1!==void 0?(console.log("shutting down secondary charge point:",this.mqttStore.settings.parentChargePoint1),this.$root.sendSystemCommand("chargepointShutdown",{chargePoint:this.mqttStore.settings.parentChargePoint1})):(console.log("shutting down primary system"),this.$root.sendSystemCommand("systemShutdown"))}}},L=A("br",null,null,-1);function T(w,l,f,b,d,c){const u=o("FontAwesomeIcon"),n=o("i-container"),a=o("i-button"),r=o("i-column"),p=o("i-row"),g=o("i-modal");return m(),_(a,{color:"danger",size:"lg",onClick:l[3]||(l[3]=i=>c.toggleModal())},{default:e(()=>[s(" openWB ausschalten "),t(u,{"fixed-width":"",icon:["fas","fa-power-off"]}),(m(),_(M,{to:"body"},[t(g,{modelValue:d.showModal,"onUpdate:modelValue":l[2]||(l[2]=i=>d.showModal=i),size:"sm"},{header:e(()=>[s(" openWB ausschalten... ")]),footer:e(()=>[t(n,null,{default:e(()=>[t(p,null,{default:e(()=>[t(r,{class:"_text-align:right"},{default:e(()=>[t(a,{color:"success",onClick:l[0]||(l[0]=i=>c.cancel())},{default:e(()=>[s(" Zurück ")]),_:1})]),_:1}),t(r,null,{default:e(()=>[t(a,{color:"danger",onClick:l[1]||(l[1]=i=>c.confirm())},{default:e(()=>[s(" Ausschalten ")]),_:1})]),_:1})]),_:1})]),_:1})]),default:e(()=>[t(n,null,{default:e(()=>[s(" Möchten Sie diese openWB wirklich ausschalten?"),L,s(" Nach dem Ausschalten muss die Ladestation komplett spannungsfrei geschaltet werden. Erst beim erneuten Zuschalten der Spannung fährt das System wieder hoch. ")]),_:1})]),_:1},8,["modelValue"])]))]),_:1})}const U=h(W,[["render",T]]),Z={name:"StatusView",components:{ReloadButton:z,RebootButton:R,ShutdownButton:U,DashBoardCard:I},props:{changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:S()}}};function E(w,l,f,b,d,c){const u=o("i-form-label"),n=o("i-column"),a=o("i-input"),r=o("i-row"),p=o("i-form-group"),g=o("reload-button"),i=o("reboot-button"),v=o("shutdown-button"),q=o("i-form"),B=o("i-container"),$=o("dash-board-card");return m(),_($,{color:"primary"},{headerLeft:e(()=>[s(" Status ")]),default:e(()=>[t(B,null,{default:e(()=>[t(q,null,{default:e(()=>[t(r,null,{default:e(()=>[t(n,null,{default:e(()=>[t(p,null,{default:e(()=>[t(r,{class:"_margin-top:2"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(u,null,{default:e(()=>[s(" IP-Adresse ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_ip",plaintext:"","model-value":d.mqttStore.getSystemIp},null,8,["model-value"])]),_:1})]),_:1}),t(r,{class:"_margin-top:1"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(u,null,{default:e(()=>[s(" Systemzeit ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_time",plaintext:"","model-value":d.mqttStore.getSystemTime},null,8,["model-value"])]),_:1})]),_:1}),t(r,{class:"_margin-top:1"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(u,null,{default:e(()=>[s(" Version ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_version",plaintext:"","model-value":d.mqttStore.getSystemVersion},null,8,["model-value"])]),_:1})]),_:1}),t(r,{class:"_margin-top:1"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(u,null,{default:e(()=>[s(" Version (Details) ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_commit",plaintext:"","model-value":d.mqttStore.getSystemCurrentCommit},null,8,["model-value"])]),_:1})]),_:1}),t(r,{class:"_margin-top:1"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(u,null,{default:e(()=>[s(" Entwicklungszweig ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_branch",plaintext:"","model-value":d.mqttStore.getSystemBranch},null,8,["model-value"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),f.changesLocked?C("",!0):(m(),_(r,{key:0,class:"_margin-top:5",between:""},{default:e(()=>[t(n,null,{default:e(()=>[t(g,{block:""})]),_:1})]),_:1})),f.changesLocked?C("",!0):(m(),_(r,{key:1,between:""},{default:e(()=>[t(n,null,{default:e(()=>[t(i,{block:"",class:"_margin-top:2"})]),_:1}),t(n,null,{default:e(()=>[t(v,{block:"",class:"_margin-top:2"})]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})}const K=h(Z,[["render",E]]);export{K as default}; diff --git a/packages/modules/display_themes/cards/web/assets/StatusView-Btd7JJiS.js b/packages/modules/display_themes/cards/web/assets/StatusView-Btd7JJiS.js deleted file mode 100644 index de3f6dc7f5..0000000000 --- a/packages/modules/display_themes/cards/web/assets/StatusView-Btd7JJiS.js +++ /dev/null @@ -1 +0,0 @@ -import{u as S}from"./index-D0wyw7xN.js";import{l as y,C,F as k,D as V}from"./vendor-fortawesome-DM89TELH.js";import{_ as h}from"./vendor-inkline-CinPe9R0.js";import{l as o,o as m,n as _,p as e,k as s,s as t,I as v,j as A,i as x}from"./vendor-DnHbc_zZ.js";import{D as I}from"./DashBoardCard-R8Ma9lyF.js";y.add(C);const F={name:"ReloadButton",components:{FontAwesomeIcon:k},props:{},data(){return{}},methods:{reloadDisplay(){location.reload()}}};function P(w,l,f,b,d,c){const r=o("FontAwesomeIcon"),n=o("i-button");return m(),_(n,{color:"success",size:"lg",onClick:l[0]||(l[0]=a=>c.reloadDisplay())},{default:e(()=>[s(" Display neu laden "),t(r,{"fixed-width":"",icon:["fas","fa-undo"]})]),_:1})}const z=h(F,[["render",P]]);y.add(C);const D={name:"RebootButton",components:{FontAwesomeIcon:k},props:{},data(){return{mqttStore:S(),showModal:!1}},methods:{toggleModal(){this.showModal=!this.showModal},cancel(){this.toggleModal()},confirm(){console.log("reboot requested"),this.mqttStore.state.settings.parentChargePoint1!==void 0?this.$root.sendSystemCommand("chargepointReboot",{chargePoint:this.mqttStore.state.settings.parentChargePoint1}):this.$root.sendSystemCommand("systemReboot")}}};function N(w,l,f,b,d,c){const r=o("FontAwesomeIcon"),n=o("i-container"),a=o("i-button"),u=o("i-column"),p=o("i-row"),g=o("i-modal");return m(),_(a,{color:"warning",size:"lg",onClick:l[3]||(l[3]=i=>c.toggleModal())},{default:e(()=>[s(" openWB neu starten "),t(r,{"fixed-width":"",icon:["fas","fa-undo"]}),(m(),_(v,{to:"body"},[t(g,{modelValue:d.showModal,"onUpdate:modelValue":l[2]||(l[2]=i=>d.showModal=i),size:"sm"},{header:e(()=>[s(" openWB neu starten... ")]),footer:e(()=>[t(n,null,{default:e(()=>[t(p,null,{default:e(()=>[t(u,{class:"_text-align:right"},{default:e(()=>[t(a,{color:"success",onClick:l[0]||(l[0]=i=>c.cancel())},{default:e(()=>[s(" Zurück ")]),_:1})]),_:1}),t(u,null,{default:e(()=>[t(a,{color:"danger",onClick:l[1]||(l[1]=i=>c.confirm())},{default:e(()=>[s(" Neustart ")]),_:1})]),_:1})]),_:1})]),_:1})]),default:e(()=>[t(n,null,{default:e(()=>[s(" Möchten Sie diese openWB wirklich neu starten? ")]),_:1})]),_:1},8,["modelValue"])]))]),_:1})}const R=h(D,[["render",N]]);y.add(V);const W={name:"ShutdownButton",components:{FontAwesomeIcon:k},props:{},data(){return{mqttStore:S(),showModal:!1}},methods:{toggleModal(){this.showModal=!this.showModal},cancel(){this.toggleModal()},confirm(){console.log("shutdown requested"),this.mqttStore.state.settings.parentChargePoint1!==void 0?this.$root.sendSystemCommand("chargepointShutdown",{chargePoint:this.mqttStore.state.settings.parentChargePoint1}):this.$root.sendSystemCommand("systemShutdown")}}},L=A("br",null,null,-1);function T(w,l,f,b,d,c){const r=o("FontAwesomeIcon"),n=o("i-container"),a=o("i-button"),u=o("i-column"),p=o("i-row"),g=o("i-modal");return m(),_(a,{color:"danger",size:"lg",onClick:l[3]||(l[3]=i=>c.toggleModal())},{default:e(()=>[s(" openWB ausschalten "),t(r,{"fixed-width":"",icon:["fas","fa-power-off"]}),(m(),_(v,{to:"body"},[t(g,{modelValue:d.showModal,"onUpdate:modelValue":l[2]||(l[2]=i=>d.showModal=i),size:"sm"},{header:e(()=>[s(" openWB ausschalten... ")]),footer:e(()=>[t(n,null,{default:e(()=>[t(p,null,{default:e(()=>[t(u,{class:"_text-align:right"},{default:e(()=>[t(a,{color:"success",onClick:l[0]||(l[0]=i=>c.cancel())},{default:e(()=>[s(" Zurück ")]),_:1})]),_:1}),t(u,null,{default:e(()=>[t(a,{color:"danger",onClick:l[1]||(l[1]=i=>c.confirm())},{default:e(()=>[s(" Ausschalten ")]),_:1})]),_:1})]),_:1})]),_:1})]),default:e(()=>[t(n,null,{default:e(()=>[s(" Möchten Sie diese openWB wirklich ausschalten?"),L,s(" Nach dem Ausschalten muss die Ladestation komplett spannungsfrei geschaltet werden. Erst beim erneuten Zuschalten der Spannung fährt das System wieder hoch. ")]),_:1})]),_:1},8,["modelValue"])]))]),_:1})}const U=h(W,[["render",T]]),Z={name:"StatusView",components:{ReloadButton:z,RebootButton:R,ShutdownButton:U,DashBoardCard:I},props:{changesLocked:{required:!1,type:Boolean,default:!1}},data(){return{mqttStore:S()}}};function E(w,l,f,b,d,c){const r=o("i-form-label"),n=o("i-column"),a=o("i-input"),u=o("i-row"),p=o("i-form-group"),g=o("reload-button"),i=o("reboot-button"),M=o("shutdown-button"),B=o("i-form"),q=o("i-container"),$=o("dash-board-card");return m(),_($,{color:"primary"},{headerLeft:e(()=>[s(" Status ")]),default:e(()=>[t(q,null,{default:e(()=>[t(B,null,{default:e(()=>[t(u,null,{default:e(()=>[t(n,null,{default:e(()=>[t(p,null,{default:e(()=>[t(u,{class:"_margin-top:2"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(r,null,{default:e(()=>[s(" IP-Adresse ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_ip",plaintext:"","model-value":d.mqttStore.getSystemIp},null,8,["model-value"])]),_:1})]),_:1}),t(u,{class:"_margin-top:1"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(r,null,{default:e(()=>[s(" Systemzeit ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_time",plaintext:"","model-value":d.mqttStore.getSystemTime},null,8,["model-value"])]),_:1})]),_:1}),t(u,{class:"_margin-top:1"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(r,null,{default:e(()=>[s(" Version ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_version",plaintext:"","model-value":d.mqttStore.getSystemVersion},null,8,["model-value"])]),_:1})]),_:1}),t(u,{class:"_margin-top:1"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(r,null,{default:e(()=>[s(" Version (Details) ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_commit",plaintext:"","model-value":d.mqttStore.getSystemCurrentCommit},null,8,["model-value"])]),_:1})]),_:1}),t(u,{class:"_margin-top:1"},{default:e(()=>[t(n,{xl:"2",lg:"3",md:"4"},{default:e(()=>[t(r,null,{default:e(()=>[s(" Entwicklungszweig ")]),_:1})]),_:1}),t(n,null,{default:e(()=>[t(a,{id:"input_system_branch",plaintext:"","model-value":d.mqttStore.getSystemBranch},null,8,["model-value"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),f.changesLocked?x("",!0):(m(),_(u,{key:0,class:"_margin-top:5",between:""},{default:e(()=>[t(n,null,{default:e(()=>[t(g,{block:""})]),_:1})]),_:1})),f.changesLocked?x("",!0):(m(),_(u,{key:1,between:""},{default:e(()=>[t(n,null,{default:e(()=>[t(i,{block:"",class:"_margin-top:2"})]),_:1}),t(n,null,{default:e(()=>[t(M,{block:"",class:"_margin-top:2"})]),_:1})]),_:1}))]),_:1})]),_:1})]),_:1})}const K=h(Z,[["render",E]]);export{K as default}; diff --git a/packages/modules/display_themes/cards/web/assets/index-D0wyw7xN.js b/packages/modules/display_themes/cards/web/assets/index-DTagQ25V.js similarity index 98% rename from packages/modules/display_themes/cards/web/assets/index-D0wyw7xN.js rename to packages/modules/display_themes/cards/web/assets/index-DTagQ25V.js index ba2d5ce8e1..693465594e 100644 --- a/packages/modules/display_themes/cards/web/assets/index-D0wyw7xN.js +++ b/packages/modules/display_themes/cards/web/assets/index-DTagQ25V.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashBoardView-ClYkWmHj.js","assets/DashBoardCard-R8Ma9lyF.js","assets/vendor-inkline-CinPe9R0.js","assets/vendor-DnHbc_zZ.js","assets/vendor-inkline-B7Agb5gs.css","assets/DashBoardCard-DKbC8x2S.css","assets/ChargePointPlugBadge-DAQjO_iO.js","assets/vendor-fortawesome-DM89TELH.js","assets/ChargePointPlugBadge-DqNX7D_z.css","assets/DashBoardView-CrVFeUF-.css","assets/EnergyFlowView-DEwG1TbM.js","assets/EnergyFlowView-C3xLYKue.css","assets/ChargePointsView-BQVeqYDM.js","assets/ChargePointsView-DPrjgv0h.css","assets/StatusView-Btd7JJiS.js"])))=>i.map(i=>d[i]); -import{o as m,e as y,k as _,x as S,j as D,F as V,H as N,l as u,n as f,p as c,f as W,i as w,A as T,s as l,I as F,z as M,R as j,J as A,K as R,L as U,M as z,N as H,O as G,P as K}from"./vendor-DnHbc_zZ.js";import{_ as v,I as J,c as Z}from"./vendor-inkline-CinPe9R0.js";import{l as I,f as L,a as E,F as O,b as Y,c as Q}from"./vendor-fortawesome-DM89TELH.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();const X={name:"DateTime",props:{separator:{type:String,default:"
"}},data(){return{dateTimeInterval:"",date:"",time:""}},mounted(){this.update(),this.dateTimeInterval=setInterval(this.update,1e3)},beforeUnmount(){clearInterval(this.dateTimeInterval)},methods:{update(){const e=new Date,t={weekday:"short",year:"numeric",month:"2-digit",day:"2-digit"},n={hour:"2-digit",minute:"2-digit",second:"2-digit"};this.date=e.toLocaleDateString(void 0,t),this.time=e.toLocaleTimeString(void 0,n)}}},ee=["innerHTML"];function te(e,t,n,i,r,o){return m(),y(V,null,[_(S(r.time),1),D("span",{innerHTML:n.separator},null,8,ee),_(S(r.date),1)],64)}const ne=v(X,[["render",te]]),P=N("mqtt",{state:()=>({settings:{localIp:void 0,localBranch:void 0,localCommit:void 0,localVersion:void 0,parentChargePoint1:void 0,parentChargePoint2:void 0},topics:{},chartData:{}}),getters:{getChargePointFilter:e=>{let t=[];return e.settings.parentChargePoint1!==void 0&&t.push(e.settings.parentChargePoint1),e.settings.parentChargePoint2!==void 0&&t.push(e.settings.parentChargePoint2),t},getWildcardIndexList:e=>(t,n=!1)=>{let i=t;n||(i="^"+t.replaceAll("/","\\/").replaceAll("+","[^+/]+").replaceAll("#","[^#/]+")+"$");let r=Object.keys(e.topics).filter(o=>o.match(i));return r.forEach((o,a,s)=>{s[a]=parseInt(o.match(/(?:\/)([0-9]+)(?=\/)*/g)[0].replace(/[^0-9]+/g,""))}),r},getWildcardTopics:e=>(t,n=!1)=>{let i=t;return n||(i="^"+t.replaceAll("/","\\/").replaceAll("+","[^+/]+").replaceAll("#","[^#/]+")+"$"),Object.keys(e.topics).filter(r=>r.match(i)).reduce((r,o)=>({...r,[o]:e.topics[o]}),{})},getObjectIds:e=>t=>{function n(i){let r=[];return i!==void 0&&i.forEach(o=>{o.type==t&&r.push(o.id),r=[...r,...n(o.children)]}),r}return n(e.topics["openWB/counter/get/hierarchy"])},getValueBool:e=>(t,n=!1)=>{let i=e.topics[t];return i!==void 0?i:(console.warn("topic not found! using default",t,n),n)},getValueString:e=>(t,n="W",i="",r=!0,o=!1,a="---",s=void 0)=>{var d=!1,g=e.topics[t];if(g===void 0||s!==void 0&&g[s]===void 0)console.warn("topic not found! using default",t,a),h=a;else{s!==void 0&&(g=g[s]),o&&(g*=-1);for(var h=g.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}),p=g;r&&(p>999||p<-999);)switch(p=p/1e3,d=!0,i){case"":i="k";break;case"k":i="M";break;case"M":i="G";break}h=p.toLocaleString(void 0,{minimumFractionDigits:d?2:0,maximumFractionDigits:d?2:0})}return{textValue:`${h} ${i}${n}`,value:g,unit:n,scaledValue:p,scaledUnit:`${i}${n}`}},getChartData:e=>t=>e.chartData[t]===void 0?[]:e.chartData[t],getDisplayStandby:e=>e.topics["openWB/optional/int_display/standby"],getThemeConfiguration:e=>{if("openWB/optional/int_display/theme"in e.topics&&e.topics["openWB/optional/int_display/theme"]!==void 0&&"configuration"in e.topics["openWB/optional/int_display/theme"])return e.topics["openWB/optional/int_display/theme"].configuration},getDashBoardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_view:!0},getEnergyFlowEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_energy_flow_view:!0},getChargePointsEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_charge_points_view:!0},getStateEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_status_view:!0},getGridCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_grid:!0},getHomeCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_home_consumption:!0},getBatteryCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_battery_sum:!0},getChargePointsCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_charge_point_sum:!0},getPvCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_inverter_sum:!0},getLockChanges(e){return e.getThemeConfiguration?e.getThemeConfiguration.lock_changes:!0},getSimpleChargePointView(e){return e.getThemeConfiguration?e.getThemeConfiguration.simple_charge_point_view:!1},getGridId(e){let t=e.topics["openWB/counter/get/hierarchy"];if(t!==void 0&&Object.keys(t).length>0){let n=Object.keys(e.topics["openWB/counter/get/hierarchy"])[0];if(console.debug("getGridId",n,e.topics["openWB/counter/get/hierarchy"][n]),e.topics["openWB/counter/get/hierarchy"][n].type=="counter")return e.topics["openWB/counter/get/hierarchy"][n].id}},getGridPower(e){return(t="textValue")=>{let n=e.getGridId;if(n===void 0)return"---";let i=e.getValueString(`openWB/counter/${n}/get/power`,"W");if(Object.hasOwnProperty.call(i,t))return i[t];if(t=="object")return i;console.error("returnType not found!",t,i)}},getGridPowerChartData(e){let t=e.getGridId;return t===void 0?[]:e.getChartData(`openWB/counter/${t}/get/power`)},getHomePower(e){return(t="textValue")=>{let n=e.getValueString("openWB/counter/set/home_consumption","W");if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getHomePowerChartData(e){return e.getChartData("openWB/counter/set/home_consumption")},getBatteryConfigured(e){return e.getValueBool("openWB/bat/config/configured")},getBatteryPower(e){return(t="textValue")=>{let n=e.getValueString("openWB/bat/get/power","W");if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getBatteryPowerChartData(e){return e.getChartData("openWB/bat/get/power")},getBatterySoc(e){return(t="textValue")=>{let n=e.getValueString("openWB/bat/get/soc","%","",!1);if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getBatterySocChartData(e){return e.getChartData("openWB/bat/get/soc")},getPvConfigured(e){return e.getValueBool("openWB/pv/config/configured")},getPvPower(e){return(t="textValue")=>{var n=e.getValueString("openWB/pv/get/power","W","",!0,!0);if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getPvPowerChartData(e){return e.getChartData("openWB/pv/get/power").map(t=>t*-1)},getChargePointSumPower(e){return(t="textValue")=>{var n=e.getValueString("openWB/chargepoint/get/power","W");if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getChargePointSumPowerChartData(e){return e.getChartData("openWB/chargepoint/get/power")},getChargePointIds(e){let t=e.getObjectIds("cp"),n=this.getChargePointFilter;return n.length>0?(console.debug("charge points are filtered!",t,n),t.filter(i=>n.includes(i))):t},getChargePointName(e){return t=>e.topics[`openWB/chargepoint/${t}/config`]!==void 0?e.topics[`openWB/chargepoint/${t}/config`].name:"---"},getChargePointPower(e){return(t,n="textValue")=>{var i=e.getValueString(`openWB/chargepoint/${t}/get/power`,"W");if(Object.hasOwnProperty.call(i,n))return i[n];if(n=="object")return i;console.error("returnType not found!",n,i)}},getChargePointImportedSincePlugged(e){return t=>({energy:e.getValueString(`openWB/chargepoint/${t}/set/log`,"Wh","",!0,!1,"---","imported_since_plugged").textValue,range:e.getValueString(`openWB/chargepoint/${t}/set/log`,"m","k",!1,!1,"---","range_charged").textValue})},getChargePointPowerChartData(e){return t=>e.getChartData(`openWB/chargepoint/${t}/get/power`)},getChargePointSetCurrent(e){return(t,n="textValue")=>{let i=e.getValueString(`openWB/chargepoint/${t}/set/current`,"A");if(Object.hasOwnProperty.call(i,n))return i[n];if(n=="object")return i;console.error("returnType not found!",n,i)}},getChargePointPhasesInUse(e){return t=>{const n=["/","①","②","③"],i=e.topics[`openWB/chargepoint/${t}/get/phases_in_use`];return i!==void 0&&i>=0&&ie.getValueBool(`openWB/chargepoint/${t}/get/plug_state`)},getChargePointChargeState(e){return t=>e.getValueBool(`openWB/chargepoint/${t}/get/charge_state`)},getChargePointManualLock(e){return t=>e.getValueBool(`openWB/chargepoint/${t}/set/manual_lock`)},getChargepointTagState(e){return t=>{if([void 0,null,""].includes(e.topics[`openWB/chargepoint/${t}/set/rfid`])){if(![void 0,null,""].includes(e.topics[`openWB/chargepoint/${t}/get/rfid`]))return 1}else return 2;return 0}},getChargePointConnectedVehicleConfig(e){return t=>e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/config`]},getChargePointConnectedVehicleChargeMode(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.translateChargeMode(e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.selected)}},getChargePointConnectedVehiclePriority(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).prio}},getChargePointConnectedVehicleInfo(e){return t=>e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/info`]},getChargePointConnectedVehicleId(e){return t=>{if(e.getChargePointConnectedVehicleInfo(t))return e.getChargePointConnectedVehicleInfo(t).id}},getChargePointConnectedVehicleChargeTemplateIndex(e){return t=>{if(e.getChargePointConnectedVehicleConfig(t))return e.getChargePointConnectedVehicleConfig(t).charge_template}},getChargePointConnectedVehicleChargeTemplate(e){return t=>{let n=e.getChargePointConnectedVehicleChargeTemplateIndex(t);return e.topics[`openWB/vehicle/template/charge_template/${n}`]}},getChargePointConnectedVehicleEvTemplate(e){return t=>{if(e.getChargePointConnectedVehicleConfig(t))return e.getChargePointConnectedVehicleConfig(t).ev_template}},getChargePointConnectedVehicleName(e){return t=>{if(e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/info`])return e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/info`].name}},getChargePointConnectedVehicleSoc(e){return t=>e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/soc`]},getChargePointConnectedVehicleTimeChargingActive(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).time_charging.active}},getChargePointConnectedVehicleTimeChargingRunning(e){return t=>{let n=e.getChargePointConnectedVehicleConfig(t).time_charging_in_use;return n!==void 0?n:!1}},getChargePointConnectedVehicleInstantChargingCurrent(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.instant_charging.current}},getChargePointConnectedVehicleInstantChargingLimit(e){return t=>e.getChargePointConnectedVehicleChargeTemplate(t)?e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.instant_charging.limit:{selected:void 0}},getChargePointConnectedVehiclePvChargingFeedInLimit(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.feed_in_limit}},getChargePointConnectedVehiclePvChargingMinCurrent(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.min_current}},getChargePointConnectedVehiclePvChargingMinSoc(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.min_soc}},getChargePointConnectedVehiclePvChargingMinSocCurrent(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.min_soc_current}},getChargePointConnectedVehiclePvChargingMaxSoc(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.max_soc}},getChargePointConnectedVehicleScheduledChargingPlans(e){return t=>{let n=e.getChargePointConnectedVehicleChargeTemplateIndex(t);return e.getWildcardTopics(`openWB/vehicle/template/charge_template/${n}/chargemode/scheduled_charging/plans/+`)}},getChargePointConnectedVehicleTimeChargingPlans(e){return t=>{let n=e.getChargePointConnectedVehicleChargeTemplateIndex(t);return e.getWildcardTopics(`openWB/vehicle/template/charge_template/${n}/time_charging/plans/+`)}},getVehicleList(e){return e.getWildcardTopics("openWB/vehicle/+/name")},getVehicleName(e){return t=>e.topics[`openWB/vehicle/${t}/name`]},getVehicleSocConfigured(e){return t=>e.topics[`openWB/vehicle/${t}/soc_module/config`].type!=null},getVehicleSocIsManual(e){return t=>e.topics[`openWB/vehicle/${t}/soc_module/config`].type=="manual"},getVehicleFaultState(e){return t=>e.topics[`openWB/vehicle/${t}/get/fault_state`]?e.topics[`openWB/vehicle/${t}/get/fault_state`]:0},getSystemTime(e){if(e.topics["openWB/system/time"])return new Date(e.topics["openWB/system/time"]*1e3).toLocaleString()},getSystemIp(e){if(e.settings.localIp!==void 0)return e.settings.localIp;if(e.topics["openWB/system/ip_address"])return e.topics["openWB/system/ip_address"]},getSystemVersion(e){if(e.settings.localVersion!==void 0)return e.settings.localVersion;if(e.topics["openWB/system/version"])return e.topics["openWB/system/version"]},getSystemBranch(e){if(e.settings.localBranch!==void 0)return e.settings.localBranch;if(e.topics["openWB/system/current_branch"])return e.topics["openWB/system/current_branch"]},getSystemCurrentCommit(e){if(e.settings.localCommit!==void 0)return e.settings.localCommit;if(e.topics["openWB/system/current_commit"])return e.topics["openWB/system/current_commit"]},getRfidEnabled(){return this.getValueBool("openWB/optional/rfid/active")}},actions:{updateSetting(e,t){e in this.settings&&(this.settings[e]=t)},initTopic(e,t=void 0){e.includes("#")||e.includes("+")?console.debug("skipping init of wildcard topic:",e):this.addTopic(e,t)},addTopic(e,t){console.debug("addTopic",e,t),this.topics[e]=t},removeTopic(e){e.includes("#")||e.includes("+")?(console.debug("expanding wildcard topic for removal:",e),Object.keys(this.getWildcardTopics(e)).forEach(t=>{console.debug("removing wildcardTopic:",t),delete this.topics[t]})):delete this.topics[e]},updateTopic(e,t,n=void 0){const i=(r,o,a)=>o.split(".").reduce((s,d,g)=>s[d]=o.split(".").length===++g?a:s[d]||{},r);e in this.topics?n!=null?i(this.topics[e],n,t):this.topics[e]=t:console.debug("topic not found: ",e)},updateChartData(){for(const[e,t]of Object.entries(this.topics))(e.endsWith("home_consumption")||e.endsWith("power")||e.endsWith("soc"))&&(this.chartData[e]===void 0&&(this.chartData[e]=[]),t!=null&&(this.chartData[e].push(t),this.chartData[e].slice(-128)))},updateState(e,t,n=void 0){console.debug("updateState:",e,t,n),this.updateTopic(e,t,n)},chargeModeList(){var e=[{id:"instant_charging"},{id:"pv_charging"},{id:"scheduled_charging"},{id:"standby"},{id:"stop"}];return e.forEach(t=>{t.label=this.translateChargeMode(t.id).label,t.class=this.translateChargeMode(t.id).class}),e},translateChargeMode(e){switch(e){case"instant_charging":return{mode:e,label:"Sofort",class:"danger"};case"pv_charging":return{mode:e,label:"PV",class:"success"};case"scheduled_charging":return{mode:e,label:"Zielladen",class:"primary"};case"time_charging":return{mode:e,label:"Zeitladen",class:"warning"};case"standby":return{mode:e,label:"Standby",class:"secondary"};case"stop":return{mode:e,label:"Stop",class:"dark"};default:return console.warn("unknown charge mode:",e),{mode:e,label:e,class:e}}},checkChangesLockCode(e){return!!(this.getThemeConfiguration&&this.getThemeConfiguration.lock_changes_code==e)},formatDate(e,t={year:"numeric",month:"2-digit",day:"2-digit"}){return new Date(e).toLocaleDateString(void 0,t)},formatDateRange(e,t="-"){const n={year:"numeric",month:"2-digit",day:"2-digit"};let i={day:"2-digit"};const r=new Date(e[0]),o=new Date(e[1]);return r.getFullYear()==o.getFullYear()?r.getMonth()!=o.getMonth()&&(i.month=n.month):i=n,`${this.formatDate(e[0],i)}${t}${this.formatDate(e[1],n)}`},formatWeeklyScheduleDays(e){const t=["Mo","Di","Mi","Do","Fr","Sa","So"];let n=[];return e.forEach(function(i,r){i==!0&&n.push(t[r])}),n.join(",")}}}),oe={name:"NavItem",props:{to:{type:Object,required:!0}}};function re(e,t,n,i,r,o){const a=u("i-nav-item");return m(),f(a,{to:n.to,"active-class":"-active",class:"_border _border-color:primary _text-align:center"},{default:c(()=>[W(e.$slots,"default",{},void 0,!0)]),_:3},8,["to"])}const ie=v(oe,[["render",re],["__scopeId","data-v-1db6ae73"]]),ae={name:"NavBar",components:{NavItem:ie},data(){return{mqttStore:P()}}};function ce(e,t,n,i,r,o){const a=u("nav-item"),s=u("i-nav");return m(),f(s,{vertical:"",class:"_align-items:stretch",size:"lg"},{default:c(()=>[r.mqttStore.getDashBoardEnabled?(m(),f(a,{key:0,to:{name:"dash-board"}},{default:c(()=>[_(" Übersicht ")]),_:1})):w("",!0),r.mqttStore.getEnergyFlowEnabled?(m(),f(a,{key:1,to:{name:"energy-flow"}},{default:c(()=>[_(" Energiefluss ")]),_:1})):w("",!0),r.mqttStore.getChargePointsEnabled&&r.mqttStore.getChargePointIds.length>0?(m(),f(a,{key:2,to:{name:"charge-points"}},{default:c(()=>[_(" Ladepunkte ")]),_:1})):w("",!0),r.mqttStore.getStateEnabled?(m(),f(a,{key:3,to:{name:"status"}},{default:c(()=>[_(" Status ")]),_:1})):w("",!0)]),_:1})}const se=v(ae,[["render",ce]]);I.add(L,E);const le={name:"NumberPad",components:{FontAwesomeIcon:O},emits:["key:digit","key:clear","key:delete"],data(){return{buttonRows:[[{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"}],[{value:4,label:"4"},{value:5,label:"5"},{value:6,label:"6"}],[{value:7,label:"7"},{value:8,label:"8"},{value:9,label:"9"}]]}},methods:{emitDigit(e){this.$emit("key:digit",e)},emitClear(){this.$emit("key:clear")},emitDelete(){this.$emit("key:delete")}}};function ue(e,t,n,i,r,o){const a=u("i-button"),s=u("i-column"),d=u("i-row"),g=u("FontAwesomeIcon"),h=u("i-container");return m(),f(h,null,{default:c(()=>[(m(!0),y(V,null,T(r.buttonRows,p=>(m(),f(d,{key:p,center:"",class:"_padding-bottom:1"},{default:c(()=>[(m(!0),y(V,null,T(p,b=>(m(),f(s,{key:b.value,class:"pin-button-column"},{default:c(()=>[l(a,{size:"lg",class:"pin-button",onClick:C=>o.emitDigit(b.value)},{default:c(()=>[_(S(b.label),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:2},1024))),128)),l(d,{center:""},{default:c(()=>[l(s,{class:"pin-button-column"},{default:c(()=>[l(a,{size:"lg",class:"pin-button",onClick:t[0]||(t[0]=p=>o.emitClear())},{default:c(()=>[l(g,{"fixed-width":"",icon:["fas","fa-eraser"]})]),_:1})]),_:1}),l(s,{class:"pin-button-column"},{default:c(()=>[l(a,{size:"lg",class:"pin-button",onClick:t[1]||(t[1]=p=>o.emitDigit("0"))},{default:c(()=>[_(" 0 ")]),_:1})]),_:1}),l(s,{class:"pin-button-column"},{default:c(()=>[l(a,{size:"lg",class:"pin-button",onClick:t[2]||(t[2]=p=>o.emitDelete())},{default:c(()=>[l(g,{"fixed-width":"",icon:["fas","fa-delete-left"]})]),_:1})]),_:1})]),_:1})]),_:1})}const de=v(le,[["render",ue],["__scopeId","data-v-4e2103db"]]),ge={name:"CodeInputModal",components:{NumberPad:de},props:{modelValue:{type:Boolean,required:!0},backgroundColor:{type:String,default:"warning"},placeholderCharacter:{type:String,default:"*",validator(e){return e.length==1}},inputVisible:{type:Boolean,default:!1},minLength:{type:Number,default:4},maxLength:{type:Number,default:4}},emits:["update:modelValue","update:inputValue"],data(){return{number:"",modalBackground:this.backgroundColor}},computed:{placeholder(){return this.placeholderCharacter.repeat(this.minLength)},enableSubmit(){return this.number.length>=this.minLength&&this.number.length<=this.maxLength}},watch:{modelValue(e,t){e===!1&&t===!0&&this.clear()}},methods:{abort(){this.$emit("update:modelValue",!1)},addDigit(e){this.number.length{this.$emit("update:modelValue",!1),this.modalBackground=this.backgroundColor},500)},error(e="danger"){this.modalBackground=e,setTimeout(()=>{this.clear(),this.modalBackground=this.backgroundColor},2e3)}}};function he(e,t,n,i,r,o){const a=u("i-input"),s=u("i-column"),d=u("i-row"),g=u("NumberPad"),h=u("i-container"),p=u("i-button"),b=u("i-modal");return m(),f(F,{to:"body"},[l(b,{"model-value":n.modelValue,color:r.modalBackground,"onUpdate:modelValue":t[4]||(t[4]=C=>e.$emit("update:modelValue",C))},{header:c(()=>[W(e.$slots,"header",{},()=>[_(" **HEADER** ")])]),footer:c(()=>[l(h,null,{default:c(()=>[l(d,null,{default:c(()=>[l(s,null,{default:c(()=>[l(p,{color:"danger",onClick:o.abort},{default:c(()=>[W(e.$slots,"abort",{},()=>[_(" Zurück ")])]),_:3},8,["onClick"])]),_:3}),l(s,{class:"_text-align:right"},{default:c(()=>[o.enableSubmit?(m(),f(p,{key:0,color:"success",onClick:o.submit},{default:c(()=>[W(e.$slots,"submit",{},()=>[_(" OK ")])]),_:3},8,["onClick"])):w("",!0)]),_:3})]),_:3})]),_:3})]),default:c(()=>[l(h,null,{default:c(()=>[l(d,{center:"",class:"_padding-bottom:1"},{default:c(()=>[l(s,null,{default:c(()=>[l(a,{modelValue:r.number,"onUpdate:modelValue":t[0]||(t[0]=C=>r.number=C),placeholder:o.placeholder,readonly:"",size:"lg",type:n.inputVisible?"text":"password",class:"_text-align:center"},null,8,["modelValue","placeholder","type"])]),_:1})]),_:1}),l(g,{"onKey:digit":t[1]||(t[1]=C=>o.addDigit(C)),"onKey:clear":t[2]||(t[2]=C=>o.clear()),"onKey:delete":t[3]||(t[3]=C=>o.removeDigit(C))})]),_:1})]),_:3},8,["model-value","color"])])}const pe=v(ge,[["render",he]]);I.add(Y,Q,L,E);const me={name:"LockNavItem",components:{FontAwesomeIcon:O,CodeInputModal:pe},props:{},data(){return{mqttStore:P(),modalPinEntryVisible:!1,modalPinEntryColor:"warning",code:"",countdown:0,countdownInterval:void 0,events:["mousemove","touchmove","wheel"]}},computed:{changesLocked:{get(){return this.mqttStore.settings.changesLocked},set(e){this.mqttStore.settings.changesLocked=e}},timer(){return Math.trunc(this.countdown/60).toString()+":"+(this.countdown%60).toString().padStart(2,"0")}},mounted(){this.changesLocked=!0},methods:{toggleChangesLock(){this.changesLocked?this.unlockChanges():this.lockChanges()},unlockChanges(){this.modalPinEntryVisible=!0},checkUnlockCode(e){console.log("checkUnlockCode",e),this.mqttStore.checkChangesLockCode(e)?(this.$refs.lockInput.success("success"),this.changesLocked=!1,this.mqttStore.getDisplayStandby>0&&(this.countdown=this.mqttStore.getDisplayStandby,this.countdownInterval=setInterval(this.updateCountdown,1e3),this.events.forEach(t=>{document.addEventListener(t,this.handleDocumentEvent,{passive:!0})}))):(console.warn("check unlock code failed!"),this.$refs.lockInput.error("danger"))},lockChanges(){this.changesLocked=!0,this.events.forEach(e=>{document.removeEventListener(e,this.handleDocumentEvent,{passive:!0})}),this.countdownInterval!==void 0&&(clearInterval(this.countdownInterval),this.countdownInterval=void 0)},updateCountdown(){this.countdown-=1,this.countdown<1&&this.lockChanges()},handleDocumentEvent(){this.countdown=this.mqttStore.getDisplayStandby}}},fe={key:0,class:"_padding-left:1"};function _e(e,t,n,i,r,o){const a=u("FontAwesomeIcon"),s=u("i-button"),d=u("CodeInputModal");return m(),y(V,null,[r.mqttStore.getLockChanges?(m(),f(s,{key:0,class:"_padding-left:0 _padding-right:0 _margin-bottom:1",size:"lg",block:"",color:o.changesLocked?"danger":"success",onClick:t[0]||(t[0]=g=>o.toggleChangesLock())},{default:c(()=>[l(a,{"fixed-width":"",icon:o.changesLocked?["fas","fa-lock"]:["fas","fa-lock-open"],class:M(o.changesLocked?"_color:danger-80":"_color:success-80")},null,8,["icon","class"]),!o.changesLocked&&r.countdownInterval?(m(),y("span",fe,S(o.timer),1)):w("",!0)]),_:1},8,["color"])):w("",!0),l(d,{ref:"lockInput",modelValue:r.modalPinEntryVisible,"onUpdate:modelValue":t[1]||(t[1]=g=>r.modalPinEntryVisible=g),"min-length":4,"max-length":10,"onUpdate:inputValue":o.checkUnlockCode},{header:c(()=>[_(" Bitte den PIN zur Freigabe von Änderungen eingeben. ")]),_:1},8,["modelValue","onUpdate:inputValue"])],64)}const Ce=v(me,[["render",_e]]),be={name:"OpenwbDisplayCardsApp",components:{RouterView:j,DateTime:ne,NavBar:se,LockNavItem:Ce},data(){return{client:{connected:!1},connection:{protocol:location.protocol=="https:"?"wss":"ws",host:location.hostname,port:parseInt(location.port)||(location.protocol=="https:"?443:80),endpoint:"/ws",connectTimeout:4e3,reconnectPeriod:4e3},mqttTopicsToSubscribe:["openWB/bat/config/configured","openWB/bat/get/power","openWB/bat/get/soc","openWB/chargepoint/+/config","openWB/chargepoint/+/get/charge_state","openWB/chargepoint/+/get/connected_vehicle/+","openWB/chargepoint/+/get/phases_in_use","openWB/chargepoint/+/get/plug_state","openWB/chargepoint/+/get/power","openWB/chargepoint/+/get/rfid","openWB/chargepoint/+/set/current","openWB/chargepoint/+/set/manual_lock","openWB/chargepoint/+/set/log","openWB/chargepoint/+/set/rfid","openWB/chargepoint/get/power","openWB/counter/+/get/power","openWB/counter/get/hierarchy","openWB/counter/set/home_consumption","openWB/optional/int_display/theme","openWB/optional/int_display/standby","openWB/optional/rfid/active","openWB/pv/config/configured","openWB/pv/get/power","openWB/system/current_branch","openWB/system/current_commit","openWB/system/ip_address","openWB/system/time","openWB/system/version","openWB/vehicle/+/get/fault_state","openWB/vehicle/+/name","openWB/vehicle/+/soc_module/config","openWB/vehicle/template/charge_template/#"],mqttStore:P(),chartInterval:""}},computed:{changesLocked(){return this.mqttStore.getLockChanges&&this.mqttStore.settings.changesLocked}},created(){this.createConnection()},mounted(){let e=window.location.search;if(e!=""){console.debug("search",e);let t=new URLSearchParams(e);if(t.has("data")){let n=JSON.parse(t.get("data"));Object.entries(n).forEach(([i,r])=>{console.log("updateSetting",i,r),this.mqttStore.updateSetting(i,r)})}}this.doSubscribe(this.mqttTopicsToSubscribe),this.chartInterval=setInterval(this.mqttStore.updateChartData,5e3)},beforeUnmount(){this.doUnsubscribe(this.mqttTopicsToSubscribe),clearInterval(this.chartInterval)},methods:{createConnection(){const{protocol:e,host:t,port:n,endpoint:i,...r}=this.connection,o=`${e}://${t}:${n}${i}`;console.debug("connecting to broker:",o);try{this.client=A.connect(o,r)}catch(a){console.error("mqtt.connect error",a)}this.client.on("connect",()=>{console.debug("Connection succeeded! ClientId: ",this.client.options.clientId)}),this.client.on("error",a=>{console.error("Connection failed",a)}),this.client.on("message",(a,s)=>{if(console.debug(`Received message "${s}" from topic "${a}"`),s.toString().length>0){let d;try{d=JSON.parse(s.toString())}catch(g){console.debug("Json parsing failed, fallback to string: ",a,g),d=s.toString()}this.mqttStore.addTopic(a,d)}else this.mqttStore.removeTopic(a)})},doSubscribe(e){e.forEach(t=>{this.mqttStore.initTopic(t)}),this.client.subscribe(e,{},t=>{if(t){console.error("Subscribe to topics error",t);return}})},doUnsubscribe(e){e.forEach(t=>{this.mqttStore.removeTopic(t)}),this.client.unsubscribe(e,t=>{t&&console.error("Unsubscribe error",t)})},doPublish(e,t,n=!0,i=2){console.debug("doPublish",e,t);let r={qos:i,retain:n};this.client.publish(e,JSON.stringify(t),r,o=>{o&&console.error("Publish error",o)})},sendTopicToBroker(e,t=void 0){let n=e.replace("openWB/","openWB/set/");t===void 0&&(t=this.mqttStore.topics[e]),this.doPublish(n,t)},sendCommand(e){this.doPublish("openWB/set/command/"+this.client.options.clientId+"/todo",e,!1)},sendSystemCommand(e,t={}){this.sendCommand({command:e,data:t})}}};function ve(e,t,n,i,r,o){const a=u("DateTime"),s=u("i-column"),d=u("i-row"),g=u("i-container"),h=u("LockNavItem"),p=u("NavBar"),b=u("i-layout-aside"),C=u("RouterView"),q=u("i-layout-content"),x=u("i-layout");return m(),f(x,{vertical:""},{default:c(()=>[l(b,{class:"_position:fixed"},{default:c(()=>[l(g,{fluid:"",class:"_margin-bottom:1"},{default:c(()=>[l(d,{center:""},{default:c(()=>[l(s,null,{default:c(()=>[l(a)]),_:1})]),_:1})]),_:1}),l(h),l(p,{"changes-locked":o.changesLocked},null,8,["changes-locked"])]),_:1}),l(q,null,{default:c(()=>[l(C,{"changes-locked":o.changesLocked},null,8,["changes-locked"])]),_:1})]),_:1})}const we=v(be,[["render",ve],["__scopeId","data-v-12a825f7"]]),ye="modulepreload",Be=function(e){return"/openWB/web/display/themes/cards/"+e},$={},B=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.all(n.map(s=>{if(s=Be(s),s in $)return;$[s]=!0;const d=s.endsWith(".css"),g=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${g}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":ye,d||(h.as="script",h.crossOrigin=""),h.href=s,a&&h.setAttribute("nonce",a),document.head.appendChild(h),d)return new Promise((p,b)=>{h.addEventListener("load",p),h.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${s}`)))})}))}return r.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},We="/openWB/web/display/themes/cards/openWB_logo_dark.png",Se={name:"WelcomeView",data(){return{mqttStore:P()}},computed:{firstView(){if(this.mqttStore.getThemeConfiguration){if(this.mqttStore.getThemeConfiguration.enable_dashboard_view)return"dash-board";if(this.mqttStore.getThemeConfiguration.enable_energy_flow_view)return"energy-flow";if(this.mqttStore.getThemeConfiguration.enable_charge_points_view)return"charge-points";if(this.mqttStore.getThemeConfiguration.enable_status_view)return"status"}}},mounted(){setTimeout(this.selectFirstRoute,3e3)},methods:{selectFirstRoute(){this.firstView?this.$router.push({name:this.firstView}):console.warn("no router view enabled, check your configuration!")}}},Ve=e=>(R("data-v-16686e30"),e=e(),U(),e),Pe=Ve(()=>D("img",{class:"logo",src:We},null,-1));function ke(e,t,n,i,r,o){const a=u("i-card"),s=u("i-column"),d=u("i-row"),g=u("i-container");return m(),f(g,null,{default:c(()=>[l(d,{center:"",middle:""},{default:c(()=>[l(s,null,{default:c(()=>[l(a,{color:"primary"},{header:c(()=>[_(" Cards Theme ")]),default:c(()=>[Pe]),_:1})]),_:1})]),_:1})]),_:1})}const Te=v(Se,[["render",ke],["__scopeId","data-v-16686e30"]]),$e=z({history:H("/openWB/web/display/themes/cards/"),routes:[{path:"/",name:"welcome",component:Te},{path:"/DashBoard",name:"dash-board",component:()=>B(()=>import("./DashBoardView-ClYkWmHj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))},{path:"/EnergyFlow",name:"energy-flow",component:()=>B(()=>import("./EnergyFlowView-DEwG1TbM.js"),__vite__mapDeps([10,1,2,3,4,5,7,11]))},{path:"/ChargePoints",name:"charge-points",component:()=>B(()=>import("./ChargePointsView-BQVeqYDM.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,13]))},{path:"/Status",name:"status",component:()=>B(()=>import("./StatusView-Btd7JJiS.js"),__vite__mapDeps([14,7,3,2,4,1,5]))}]}),k=G(we);k.use(K());k.use($e);k.use(J,{colorMode:"dark",components:Z});k.mount("#app");export{pe as C,de as N,P as u}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashBoardView-DEUu_ZQW.js","assets/DashBoardCard-R8Ma9lyF.js","assets/vendor-inkline-CinPe9R0.js","assets/vendor-DnHbc_zZ.js","assets/vendor-inkline-B7Agb5gs.css","assets/DashBoardCard-DKbC8x2S.css","assets/ChargePointPlugBadge-B7K7z1N_.js","assets/vendor-fortawesome-DM89TELH.js","assets/ChargePointPlugBadge-DqNX7D_z.css","assets/DashBoardView-CrVFeUF-.css","assets/EnergyFlowView-C2EKjwZe.js","assets/EnergyFlowView-C3xLYKue.css","assets/ChargePointsView-BZVPA9o4.js","assets/ChargePointsView-DPrjgv0h.css","assets/StatusView-BaXuMl-p.js"])))=>i.map(i=>d[i]); +import{o as m,e as y,k as _,x as S,j as D,F as V,H as N,l as u,n as f,p as c,f as W,i as w,A as T,s as l,I as F,z as M,R as j,J as A,K as R,L as U,M as z,N as H,O as G,P as K}from"./vendor-DnHbc_zZ.js";import{_ as v,I as J,c as Z}from"./vendor-inkline-CinPe9R0.js";import{l as I,f as L,a as E,F as O,b as Y,c as Q}from"./vendor-fortawesome-DM89TELH.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();const X={name:"DateTime",props:{separator:{type:String,default:"
"}},data(){return{dateTimeInterval:"",date:"",time:""}},mounted(){this.update(),this.dateTimeInterval=setInterval(this.update,1e3)},beforeUnmount(){clearInterval(this.dateTimeInterval)},methods:{update(){const e=new Date,t={weekday:"short",year:"numeric",month:"2-digit",day:"2-digit"},n={hour:"2-digit",minute:"2-digit",second:"2-digit"};this.date=e.toLocaleDateString(void 0,t),this.time=e.toLocaleTimeString(void 0,n)}}},ee=["innerHTML"];function te(e,t,n,i,r,o){return m(),y(V,null,[_(S(r.time),1),D("span",{innerHTML:n.separator},null,8,ee),_(S(r.date),1)],64)}const ne=v(X,[["render",te]]),P=N("mqtt",{state:()=>({settings:{localIp:void 0,localBranch:void 0,localCommit:void 0,localVersion:void 0,parentChargePoint1:void 0,parentChargePoint2:void 0},topics:{},chartData:{}}),getters:{getChargePointFilter:e=>{let t=[];return e.settings.parentChargePoint1!==void 0&&t.push(e.settings.parentChargePoint1),e.settings.parentChargePoint2!==void 0&&t.push(e.settings.parentChargePoint2),t},getWildcardIndexList:e=>(t,n=!1)=>{let i=t;n||(i="^"+t.replaceAll("/","\\/").replaceAll("+","[^+/]+").replaceAll("#","[^#/]+")+"$");let r=Object.keys(e.topics).filter(o=>o.match(i));return r.forEach((o,a,s)=>{s[a]=parseInt(o.match(/(?:\/)([0-9]+)(?=\/)*/g)[0].replace(/[^0-9]+/g,""))}),r},getWildcardTopics:e=>(t,n=!1)=>{let i=t;return n||(i="^"+t.replaceAll("/","\\/").replaceAll("+","[^+/]+").replaceAll("#","[^#/]+")+"$"),Object.keys(e.topics).filter(r=>r.match(i)).reduce((r,o)=>({...r,[o]:e.topics[o]}),{})},getObjectIds:e=>t=>{function n(i){let r=[];return i!==void 0&&i.forEach(o=>{o.type==t&&r.push(o.id),r=[...r,...n(o.children)]}),r}return n(e.topics["openWB/counter/get/hierarchy"])},getValueBool:e=>(t,n=!1)=>{let i=e.topics[t];return i!==void 0?i:(console.warn("topic not found! using default",t,n),n)},getValueString:e=>(t,n="W",i="",r=!0,o=!1,a="---",s=void 0)=>{var d=!1,g=e.topics[t];if(g===void 0||s!==void 0&&g[s]===void 0)console.warn("topic not found! using default",t,a),h=a;else{s!==void 0&&(g=g[s]),o&&(g*=-1);for(var h=g.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}),p=g;r&&(p>999||p<-999);)switch(p=p/1e3,d=!0,i){case"":i="k";break;case"k":i="M";break;case"M":i="G";break}h=p.toLocaleString(void 0,{minimumFractionDigits:d?2:0,maximumFractionDigits:d?2:0})}return{textValue:`${h} ${i}${n}`,value:g,unit:n,scaledValue:p,scaledUnit:`${i}${n}`}},getChartData:e=>t=>e.chartData[t]===void 0?[]:e.chartData[t],getDisplayStandby:e=>e.topics["openWB/optional/int_display/standby"],getThemeConfiguration:e=>{if("openWB/optional/int_display/theme"in e.topics&&e.topics["openWB/optional/int_display/theme"]!==void 0&&"configuration"in e.topics["openWB/optional/int_display/theme"])return e.topics["openWB/optional/int_display/theme"].configuration},getDashBoardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_view:!0},getEnergyFlowEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_energy_flow_view:!0},getChargePointsEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_charge_points_view:!0},getStateEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_status_view:!0},getGridCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_grid:!0},getHomeCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_home_consumption:!0},getBatteryCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_battery_sum:!0},getChargePointsCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_charge_point_sum:!0},getPvCardEnabled(e){return e.getThemeConfiguration?e.getThemeConfiguration.enable_dashboard_card_inverter_sum:!0},getLockChanges(e){return e.getThemeConfiguration?e.getThemeConfiguration.lock_changes:!0},getSimpleChargePointView(e){return e.getThemeConfiguration?e.getThemeConfiguration.simple_charge_point_view:!1},getGridId(e){let t=e.topics["openWB/counter/get/hierarchy"];if(t!==void 0&&Object.keys(t).length>0){let n=Object.keys(e.topics["openWB/counter/get/hierarchy"])[0];if(console.debug("getGridId",n,e.topics["openWB/counter/get/hierarchy"][n]),e.topics["openWB/counter/get/hierarchy"][n].type=="counter")return e.topics["openWB/counter/get/hierarchy"][n].id}},getGridPower(e){return(t="textValue")=>{let n=e.getGridId;if(n===void 0)return"---";let i=e.getValueString(`openWB/counter/${n}/get/power`,"W");if(Object.hasOwnProperty.call(i,t))return i[t];if(t=="object")return i;console.error("returnType not found!",t,i)}},getGridPowerChartData(e){let t=e.getGridId;return t===void 0?[]:e.getChartData(`openWB/counter/${t}/get/power`)},getHomePower(e){return(t="textValue")=>{let n=e.getValueString("openWB/counter/set/home_consumption","W");if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getHomePowerChartData(e){return e.getChartData("openWB/counter/set/home_consumption")},getBatteryConfigured(e){return e.getValueBool("openWB/bat/config/configured")},getBatteryPower(e){return(t="textValue")=>{let n=e.getValueString("openWB/bat/get/power","W");if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getBatteryPowerChartData(e){return e.getChartData("openWB/bat/get/power")},getBatterySoc(e){return(t="textValue")=>{let n=e.getValueString("openWB/bat/get/soc","%","",!1);if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getBatterySocChartData(e){return e.getChartData("openWB/bat/get/soc")},getPvConfigured(e){return e.getValueBool("openWB/pv/config/configured")},getPvPower(e){return(t="textValue")=>{var n=e.getValueString("openWB/pv/get/power","W","",!0,!0);if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getPvPowerChartData(e){return e.getChartData("openWB/pv/get/power").map(t=>t*-1)},getChargePointSumPower(e){return(t="textValue")=>{var n=e.getValueString("openWB/chargepoint/get/power","W");if(Object.hasOwnProperty.call(n,t))return n[t];if(t=="object")return n;console.error("returnType not found!",t,n)}},getChargePointSumPowerChartData(e){return e.getChartData("openWB/chargepoint/get/power")},getChargePointIds(e){let t=e.getObjectIds("cp"),n=this.getChargePointFilter;return n.length>0?(console.debug("charge points are filtered!",t,n),t.filter(i=>n.includes(i))):t},getChargePointName(e){return t=>e.topics[`openWB/chargepoint/${t}/config`]!==void 0?e.topics[`openWB/chargepoint/${t}/config`].name:"---"},getChargePointPower(e){return(t,n="textValue")=>{var i=e.getValueString(`openWB/chargepoint/${t}/get/power`,"W");if(Object.hasOwnProperty.call(i,n))return i[n];if(n=="object")return i;console.error("returnType not found!",n,i)}},getChargePointImportedSincePlugged(e){return t=>({energy:e.getValueString(`openWB/chargepoint/${t}/set/log`,"Wh","",!0,!1,"---","imported_since_plugged").textValue,range:e.getValueString(`openWB/chargepoint/${t}/set/log`,"m","k",!1,!1,"---","range_charged").textValue})},getChargePointPowerChartData(e){return t=>e.getChartData(`openWB/chargepoint/${t}/get/power`)},getChargePointSetCurrent(e){return(t,n="textValue")=>{let i=e.getValueString(`openWB/chargepoint/${t}/set/current`,"A");if(Object.hasOwnProperty.call(i,n))return i[n];if(n=="object")return i;console.error("returnType not found!",n,i)}},getChargePointPhasesInUse(e){return t=>{const n=["/","①","②","③"],i=e.topics[`openWB/chargepoint/${t}/get/phases_in_use`];return i!==void 0&&i>=0&&ie.getValueBool(`openWB/chargepoint/${t}/get/plug_state`)},getChargePointChargeState(e){return t=>e.getValueBool(`openWB/chargepoint/${t}/get/charge_state`)},getChargePointManualLock(e){return t=>e.getValueBool(`openWB/chargepoint/${t}/set/manual_lock`)},getChargepointTagState(e){return t=>{if([void 0,null,""].includes(e.topics[`openWB/chargepoint/${t}/set/rfid`])){if(![void 0,null,""].includes(e.topics[`openWB/chargepoint/${t}/get/rfid`]))return 1}else return 2;return 0}},getChargePointConnectedVehicleConfig(e){return t=>e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/config`]},getChargePointConnectedVehicleChargeMode(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.translateChargeMode(e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.selected)}},getChargePointConnectedVehiclePriority(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).prio}},getChargePointConnectedVehicleInfo(e){return t=>e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/info`]},getChargePointConnectedVehicleId(e){return t=>{if(e.getChargePointConnectedVehicleInfo(t))return e.getChargePointConnectedVehicleInfo(t).id}},getChargePointConnectedVehicleChargeTemplateIndex(e){return t=>{if(e.getChargePointConnectedVehicleConfig(t))return e.getChargePointConnectedVehicleConfig(t).charge_template}},getChargePointConnectedVehicleChargeTemplate(e){return t=>{let n=e.getChargePointConnectedVehicleChargeTemplateIndex(t);return e.topics[`openWB/vehicle/template/charge_template/${n}`]}},getChargePointConnectedVehicleEvTemplate(e){return t=>{if(e.getChargePointConnectedVehicleConfig(t))return e.getChargePointConnectedVehicleConfig(t).ev_template}},getChargePointConnectedVehicleName(e){return t=>{if(e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/info`])return e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/info`].name}},getChargePointConnectedVehicleSoc(e){return t=>e.topics[`openWB/chargepoint/${t}/get/connected_vehicle/soc`]},getChargePointConnectedVehicleTimeChargingActive(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).time_charging.active}},getChargePointConnectedVehicleTimeChargingRunning(e){return t=>{let n=e.getChargePointConnectedVehicleConfig(t).time_charging_in_use;return n!==void 0?n:!1}},getChargePointConnectedVehicleInstantChargingCurrent(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.instant_charging.current}},getChargePointConnectedVehicleInstantChargingLimit(e){return t=>e.getChargePointConnectedVehicleChargeTemplate(t)?e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.instant_charging.limit:{selected:void 0}},getChargePointConnectedVehiclePvChargingFeedInLimit(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.feed_in_limit}},getChargePointConnectedVehiclePvChargingMinCurrent(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.min_current}},getChargePointConnectedVehiclePvChargingMinSoc(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.min_soc}},getChargePointConnectedVehiclePvChargingMinSocCurrent(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.min_soc_current}},getChargePointConnectedVehiclePvChargingMaxSoc(e){return t=>{if(e.getChargePointConnectedVehicleChargeTemplate(t))return e.getChargePointConnectedVehicleChargeTemplate(t).chargemode.pv_charging.max_soc}},getChargePointConnectedVehicleScheduledChargingPlans(e){return t=>{let n=e.getChargePointConnectedVehicleChargeTemplateIndex(t);return e.getWildcardTopics(`openWB/vehicle/template/charge_template/${n}/chargemode/scheduled_charging/plans/+`)}},getChargePointConnectedVehicleTimeChargingPlans(e){return t=>{let n=e.getChargePointConnectedVehicleChargeTemplateIndex(t);return e.getWildcardTopics(`openWB/vehicle/template/charge_template/${n}/time_charging/plans/+`)}},getVehicleList(e){return e.getWildcardTopics("openWB/vehicle/+/name")},getVehicleName(e){return t=>e.topics[`openWB/vehicle/${t}/name`]},getVehicleSocConfigured(e){return t=>e.topics[`openWB/vehicle/${t}/soc_module/config`].type!=null},getVehicleSocIsManual(e){return t=>e.topics[`openWB/vehicle/${t}/soc_module/config`].type=="manual"},getVehicleFaultState(e){return t=>e.topics[`openWB/vehicle/${t}/get/fault_state`]?e.topics[`openWB/vehicle/${t}/get/fault_state`]:0},getSystemTime(e){if(e.topics["openWB/system/time"])return new Date(e.topics["openWB/system/time"]*1e3).toLocaleString()},getSystemIp(e){if(e.settings.localIp!==void 0)return e.settings.localIp;if(e.topics["openWB/system/ip_address"])return e.topics["openWB/system/ip_address"]},getSystemVersion(e){if(e.settings.localVersion!==void 0)return e.settings.localVersion;if(e.topics["openWB/system/version"])return e.topics["openWB/system/version"]},getSystemBranch(e){if(e.settings.localBranch!==void 0)return e.settings.localBranch;if(e.topics["openWB/system/current_branch"])return e.topics["openWB/system/current_branch"]},getSystemCurrentCommit(e){if(e.settings.localCommit!==void 0)return e.settings.localCommit;if(e.topics["openWB/system/current_commit"])return e.topics["openWB/system/current_commit"]},getRfidEnabled(){return this.getValueBool("openWB/optional/rfid/active")}},actions:{updateSetting(e,t){e in this.settings&&(this.settings[e]=t)},initTopic(e,t=void 0){e.includes("#")||e.includes("+")?console.debug("skipping init of wildcard topic:",e):this.addTopic(e,t)},addTopic(e,t){console.debug("addTopic",e,t),this.topics[e]=t},removeTopic(e){e.includes("#")||e.includes("+")?(console.debug("expanding wildcard topic for removal:",e),Object.keys(this.getWildcardTopics(e)).forEach(t=>{console.debug("removing wildcardTopic:",t),delete this.topics[t]})):delete this.topics[e]},updateTopic(e,t,n=void 0){const i=(r,o,a)=>o.split(".").reduce((s,d,g)=>s[d]=o.split(".").length===++g?a:s[d]||{},r);e in this.topics?n!=null?i(this.topics[e],n,t):this.topics[e]=t:console.debug("topic not found: ",e)},updateChartData(){for(const[e,t]of Object.entries(this.topics))(e.endsWith("home_consumption")||e.endsWith("power")||e.endsWith("soc"))&&(this.chartData[e]===void 0&&(this.chartData[e]=[]),t!=null&&(this.chartData[e].push(t),this.chartData[e].slice(-128)))},updateState(e,t,n=void 0){console.debug("updateState:",e,t,n),this.updateTopic(e,t,n)},chargeModeList(){var e=[{id:"instant_charging"},{id:"pv_charging"},{id:"scheduled_charging"},{id:"standby"},{id:"stop"}];return e.forEach(t=>{t.label=this.translateChargeMode(t.id).label,t.class=this.translateChargeMode(t.id).class}),e},translateChargeMode(e){switch(e){case"instant_charging":return{mode:e,label:"Sofort",class:"danger"};case"pv_charging":return{mode:e,label:"PV",class:"success"};case"scheduled_charging":return{mode:e,label:"Zielladen",class:"primary"};case"time_charging":return{mode:e,label:"Zeitladen",class:"warning"};case"standby":return{mode:e,label:"Standby",class:"secondary"};case"stop":return{mode:e,label:"Stop",class:"dark"};default:return console.warn("unknown charge mode:",e),{mode:e,label:e,class:e}}},checkChangesLockCode(e){return!!(this.getThemeConfiguration&&this.getThemeConfiguration.lock_changes_code==e)},formatDate(e,t={year:"numeric",month:"2-digit",day:"2-digit"}){return new Date(e).toLocaleDateString(void 0,t)},formatDateRange(e,t="-"){const n={year:"numeric",month:"2-digit",day:"2-digit"};let i={day:"2-digit"};const r=new Date(e[0]),o=new Date(e[1]);return r.getFullYear()==o.getFullYear()?r.getMonth()!=o.getMonth()&&(i.month=n.month):i=n,`${this.formatDate(e[0],i)}${t}${this.formatDate(e[1],n)}`},formatWeeklyScheduleDays(e){const t=["Mo","Di","Mi","Do","Fr","Sa","So"];let n=[];return e.forEach(function(i,r){i==!0&&n.push(t[r])}),n.join(",")}}}),oe={name:"NavItem",props:{to:{type:Object,required:!0}}};function re(e,t,n,i,r,o){const a=u("i-nav-item");return m(),f(a,{to:n.to,"active-class":"-active",class:"_border _border-color:primary _text-align:center"},{default:c(()=>[W(e.$slots,"default",{},void 0,!0)]),_:3},8,["to"])}const ie=v(oe,[["render",re],["__scopeId","data-v-1db6ae73"]]),ae={name:"NavBar",components:{NavItem:ie},data(){return{mqttStore:P()}}};function ce(e,t,n,i,r,o){const a=u("nav-item"),s=u("i-nav");return m(),f(s,{vertical:"",class:"_align-items:stretch",size:"lg"},{default:c(()=>[r.mqttStore.getDashBoardEnabled?(m(),f(a,{key:0,to:{name:"dash-board"}},{default:c(()=>[_(" Übersicht ")]),_:1})):w("",!0),r.mqttStore.getEnergyFlowEnabled?(m(),f(a,{key:1,to:{name:"energy-flow"}},{default:c(()=>[_(" Energiefluss ")]),_:1})):w("",!0),r.mqttStore.getChargePointsEnabled&&r.mqttStore.getChargePointIds.length>0?(m(),f(a,{key:2,to:{name:"charge-points"}},{default:c(()=>[_(" Ladepunkte ")]),_:1})):w("",!0),r.mqttStore.getStateEnabled?(m(),f(a,{key:3,to:{name:"status"}},{default:c(()=>[_(" Status ")]),_:1})):w("",!0)]),_:1})}const se=v(ae,[["render",ce]]);I.add(L,E);const le={name:"NumberPad",components:{FontAwesomeIcon:O},emits:["key:digit","key:clear","key:delete"],data(){return{buttonRows:[[{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"}],[{value:4,label:"4"},{value:5,label:"5"},{value:6,label:"6"}],[{value:7,label:"7"},{value:8,label:"8"},{value:9,label:"9"}]]}},methods:{emitDigit(e){this.$emit("key:digit",e)},emitClear(){this.$emit("key:clear")},emitDelete(){this.$emit("key:delete")}}};function ue(e,t,n,i,r,o){const a=u("i-button"),s=u("i-column"),d=u("i-row"),g=u("FontAwesomeIcon"),h=u("i-container");return m(),f(h,null,{default:c(()=>[(m(!0),y(V,null,T(r.buttonRows,p=>(m(),f(d,{key:p,center:"",class:"_padding-bottom:1"},{default:c(()=>[(m(!0),y(V,null,T(p,b=>(m(),f(s,{key:b.value,class:"pin-button-column"},{default:c(()=>[l(a,{size:"lg",class:"pin-button",onClick:C=>o.emitDigit(b.value)},{default:c(()=>[_(S(b.label),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:2},1024))),128)),l(d,{center:""},{default:c(()=>[l(s,{class:"pin-button-column"},{default:c(()=>[l(a,{size:"lg",class:"pin-button",onClick:t[0]||(t[0]=p=>o.emitClear())},{default:c(()=>[l(g,{"fixed-width":"",icon:["fas","fa-eraser"]})]),_:1})]),_:1}),l(s,{class:"pin-button-column"},{default:c(()=>[l(a,{size:"lg",class:"pin-button",onClick:t[1]||(t[1]=p=>o.emitDigit("0"))},{default:c(()=>[_(" 0 ")]),_:1})]),_:1}),l(s,{class:"pin-button-column"},{default:c(()=>[l(a,{size:"lg",class:"pin-button",onClick:t[2]||(t[2]=p=>o.emitDelete())},{default:c(()=>[l(g,{"fixed-width":"",icon:["fas","fa-delete-left"]})]),_:1})]),_:1})]),_:1})]),_:1})}const de=v(le,[["render",ue],["__scopeId","data-v-4e2103db"]]),ge={name:"CodeInputModal",components:{NumberPad:de},props:{modelValue:{type:Boolean,required:!0},backgroundColor:{type:String,default:"warning"},placeholderCharacter:{type:String,default:"*",validator(e){return e.length==1}},inputVisible:{type:Boolean,default:!1},minLength:{type:Number,default:4},maxLength:{type:Number,default:4}},emits:["update:modelValue","update:inputValue"],data(){return{number:"",modalBackground:this.backgroundColor}},computed:{placeholder(){return this.placeholderCharacter.repeat(this.minLength)},enableSubmit(){return this.number.length>=this.minLength&&this.number.length<=this.maxLength}},watch:{modelValue(e,t){e===!1&&t===!0&&this.clear()}},methods:{abort(){this.$emit("update:modelValue",!1)},addDigit(e){this.number.length{this.$emit("update:modelValue",!1),this.modalBackground=this.backgroundColor},500)},error(e="danger"){this.modalBackground=e,setTimeout(()=>{this.clear(),this.modalBackground=this.backgroundColor},2e3)}}};function he(e,t,n,i,r,o){const a=u("i-input"),s=u("i-column"),d=u("i-row"),g=u("NumberPad"),h=u("i-container"),p=u("i-button"),b=u("i-modal");return m(),f(F,{to:"body"},[l(b,{"model-value":n.modelValue,color:r.modalBackground,"onUpdate:modelValue":t[4]||(t[4]=C=>e.$emit("update:modelValue",C))},{header:c(()=>[W(e.$slots,"header",{},()=>[_(" **HEADER** ")])]),footer:c(()=>[l(h,null,{default:c(()=>[l(d,null,{default:c(()=>[l(s,null,{default:c(()=>[l(p,{color:"danger",onClick:o.abort},{default:c(()=>[W(e.$slots,"abort",{},()=>[_(" Zurück ")])]),_:3},8,["onClick"])]),_:3}),l(s,{class:"_text-align:right"},{default:c(()=>[o.enableSubmit?(m(),f(p,{key:0,color:"success",onClick:o.submit},{default:c(()=>[W(e.$slots,"submit",{},()=>[_(" OK ")])]),_:3},8,["onClick"])):w("",!0)]),_:3})]),_:3})]),_:3})]),default:c(()=>[l(h,null,{default:c(()=>[l(d,{center:"",class:"_padding-bottom:1"},{default:c(()=>[l(s,null,{default:c(()=>[l(a,{modelValue:r.number,"onUpdate:modelValue":t[0]||(t[0]=C=>r.number=C),placeholder:o.placeholder,readonly:"",size:"lg",type:n.inputVisible?"text":"password",class:"_text-align:center"},null,8,["modelValue","placeholder","type"])]),_:1})]),_:1}),l(g,{"onKey:digit":t[1]||(t[1]=C=>o.addDigit(C)),"onKey:clear":t[2]||(t[2]=C=>o.clear()),"onKey:delete":t[3]||(t[3]=C=>o.removeDigit(C))})]),_:1})]),_:3},8,["model-value","color"])])}const pe=v(ge,[["render",he]]);I.add(Y,Q,L,E);const me={name:"LockNavItem",components:{FontAwesomeIcon:O,CodeInputModal:pe},props:{},data(){return{mqttStore:P(),modalPinEntryVisible:!1,modalPinEntryColor:"warning",code:"",countdown:0,countdownInterval:void 0,events:["mousemove","touchmove","wheel"]}},computed:{changesLocked:{get(){return this.mqttStore.settings.changesLocked},set(e){this.mqttStore.settings.changesLocked=e}},timer(){return Math.trunc(this.countdown/60).toString()+":"+(this.countdown%60).toString().padStart(2,"0")}},mounted(){this.changesLocked=!0},methods:{toggleChangesLock(){this.changesLocked?this.unlockChanges():this.lockChanges()},unlockChanges(){this.modalPinEntryVisible=!0},checkUnlockCode(e){console.log("checkUnlockCode",e),this.mqttStore.checkChangesLockCode(e)?(this.$refs.lockInput.success("success"),this.changesLocked=!1,this.mqttStore.getDisplayStandby>0&&(this.countdown=this.mqttStore.getDisplayStandby,this.countdownInterval=setInterval(this.updateCountdown,1e3),this.events.forEach(t=>{document.addEventListener(t,this.handleDocumentEvent,{passive:!0})}))):(console.warn("check unlock code failed!"),this.$refs.lockInput.error("danger"))},lockChanges(){this.changesLocked=!0,this.events.forEach(e=>{document.removeEventListener(e,this.handleDocumentEvent,{passive:!0})}),this.countdownInterval!==void 0&&(clearInterval(this.countdownInterval),this.countdownInterval=void 0)},updateCountdown(){this.countdown-=1,this.countdown<1&&this.lockChanges()},handleDocumentEvent(){this.countdown=this.mqttStore.getDisplayStandby}}},fe={key:0,class:"_padding-left:1"};function _e(e,t,n,i,r,o){const a=u("FontAwesomeIcon"),s=u("i-button"),d=u("CodeInputModal");return m(),y(V,null,[r.mqttStore.getLockChanges?(m(),f(s,{key:0,class:"_padding-left:0 _padding-right:0 _margin-bottom:1",size:"lg",block:"",color:o.changesLocked?"danger":"success",onClick:t[0]||(t[0]=g=>o.toggleChangesLock())},{default:c(()=>[l(a,{"fixed-width":"",icon:o.changesLocked?["fas","fa-lock"]:["fas","fa-lock-open"],class:M(o.changesLocked?"_color:danger-80":"_color:success-80")},null,8,["icon","class"]),!o.changesLocked&&r.countdownInterval?(m(),y("span",fe,S(o.timer),1)):w("",!0)]),_:1},8,["color"])):w("",!0),l(d,{ref:"lockInput",modelValue:r.modalPinEntryVisible,"onUpdate:modelValue":t[1]||(t[1]=g=>r.modalPinEntryVisible=g),"min-length":4,"max-length":10,"onUpdate:inputValue":o.checkUnlockCode},{header:c(()=>[_(" Bitte den PIN zur Freigabe von Änderungen eingeben. ")]),_:1},8,["modelValue","onUpdate:inputValue"])],64)}const Ce=v(me,[["render",_e]]),be={name:"OpenwbDisplayCardsApp",components:{RouterView:j,DateTime:ne,NavBar:se,LockNavItem:Ce},data(){return{client:{connected:!1},connection:{protocol:location.protocol=="https:"?"wss":"ws",host:location.hostname,port:parseInt(location.port)||(location.protocol=="https:"?443:80),endpoint:"/ws",connectTimeout:4e3,reconnectPeriod:4e3},mqttTopicsToSubscribe:["openWB/bat/config/configured","openWB/bat/get/power","openWB/bat/get/soc","openWB/chargepoint/+/config","openWB/chargepoint/+/get/charge_state","openWB/chargepoint/+/get/connected_vehicle/+","openWB/chargepoint/+/get/phases_in_use","openWB/chargepoint/+/get/plug_state","openWB/chargepoint/+/get/power","openWB/chargepoint/+/get/rfid","openWB/chargepoint/+/set/current","openWB/chargepoint/+/set/manual_lock","openWB/chargepoint/+/set/log","openWB/chargepoint/+/set/rfid","openWB/chargepoint/get/power","openWB/counter/+/get/power","openWB/counter/get/hierarchy","openWB/counter/set/home_consumption","openWB/optional/int_display/theme","openWB/optional/int_display/standby","openWB/optional/rfid/active","openWB/pv/config/configured","openWB/pv/get/power","openWB/system/current_branch","openWB/system/current_commit","openWB/system/ip_address","openWB/system/time","openWB/system/version","openWB/vehicle/+/get/fault_state","openWB/vehicle/+/name","openWB/vehicle/+/soc_module/config","openWB/vehicle/template/charge_template/#"],mqttStore:P(),chartInterval:""}},computed:{changesLocked(){return this.mqttStore.getLockChanges&&this.mqttStore.settings.changesLocked}},created(){this.createConnection()},mounted(){let e=window.location.search;if(e!=""){console.debug("search",e);let t=new URLSearchParams(e);if(t.has("data")){let n=JSON.parse(t.get("data"));Object.entries(n).forEach(([i,r])=>{console.log("updateSetting",i,r),this.mqttStore.updateSetting(i,r)})}}this.doSubscribe(this.mqttTopicsToSubscribe),this.chartInterval=setInterval(this.mqttStore.updateChartData,5e3)},beforeUnmount(){this.doUnsubscribe(this.mqttTopicsToSubscribe),clearInterval(this.chartInterval)},methods:{createConnection(){const{protocol:e,host:t,port:n,endpoint:i,...r}=this.connection,o=`${e}://${t}:${n}${i}`;console.debug("connecting to broker:",o);try{this.client=A.connect(o,r)}catch(a){console.error("mqtt.connect error",a)}this.client.on("connect",()=>{console.debug("Connection succeeded! ClientId: ",this.client.options.clientId)}),this.client.on("error",a=>{console.error("Connection failed",a)}),this.client.on("message",(a,s)=>{if(console.debug(`Received message "${s}" from topic "${a}"`),s.toString().length>0){let d;try{d=JSON.parse(s.toString())}catch(g){console.debug("Json parsing failed, fallback to string: ",a,g),d=s.toString()}this.mqttStore.addTopic(a,d)}else this.mqttStore.removeTopic(a)})},doSubscribe(e){e.forEach(t=>{this.mqttStore.initTopic(t)}),this.client.subscribe(e,{},t=>{if(t){console.error("Subscribe to topics error",t);return}})},doUnsubscribe(e){e.forEach(t=>{this.mqttStore.removeTopic(t)}),this.client.unsubscribe(e,t=>{t&&console.error("Unsubscribe error",t)})},doPublish(e,t,n=!0,i=2){console.debug("doPublish",e,t);let r={qos:i,retain:n};this.client.publish(e,JSON.stringify(t),r,o=>{o&&console.error("Publish error",o)})},sendTopicToBroker(e,t=void 0){let n=e.replace("openWB/","openWB/set/");t===void 0&&(t=this.mqttStore.topics[e]),this.doPublish(n,t)},sendCommand(e){this.doPublish("openWB/set/command/"+this.client.options.clientId+"/todo",e,!1)},sendSystemCommand(e,t={}){this.sendCommand({command:e,data:t})}}};function ve(e,t,n,i,r,o){const a=u("DateTime"),s=u("i-column"),d=u("i-row"),g=u("i-container"),h=u("LockNavItem"),p=u("NavBar"),b=u("i-layout-aside"),C=u("RouterView"),q=u("i-layout-content"),x=u("i-layout");return m(),f(x,{vertical:""},{default:c(()=>[l(b,{class:"_position:fixed"},{default:c(()=>[l(g,{fluid:"",class:"_margin-bottom:1"},{default:c(()=>[l(d,{center:""},{default:c(()=>[l(s,null,{default:c(()=>[l(a)]),_:1})]),_:1})]),_:1}),l(h),l(p,{"changes-locked":o.changesLocked},null,8,["changes-locked"])]),_:1}),l(q,null,{default:c(()=>[l(C,{"changes-locked":o.changesLocked},null,8,["changes-locked"])]),_:1})]),_:1})}const we=v(be,[["render",ve],["__scopeId","data-v-12a825f7"]]),ye="modulepreload",Be=function(e){return"/openWB/web/display/themes/cards/"+e},$={},B=function(t,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));r=Promise.all(n.map(s=>{if(s=Be(s),s in $)return;$[s]=!0;const d=s.endsWith(".css"),g=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${g}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":ye,d||(h.as="script",h.crossOrigin=""),h.href=s,a&&h.setAttribute("nonce",a),document.head.appendChild(h),d)return new Promise((p,b)=>{h.addEventListener("load",p),h.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${s}`)))})}))}return r.then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},We="/openWB/web/display/themes/cards/openWB_logo_dark.png",Se={name:"WelcomeView",data(){return{mqttStore:P()}},computed:{firstView(){if(this.mqttStore.getThemeConfiguration){if(this.mqttStore.getThemeConfiguration.enable_dashboard_view)return"dash-board";if(this.mqttStore.getThemeConfiguration.enable_energy_flow_view)return"energy-flow";if(this.mqttStore.getThemeConfiguration.enable_charge_points_view)return"charge-points";if(this.mqttStore.getThemeConfiguration.enable_status_view)return"status"}}},mounted(){setTimeout(this.selectFirstRoute,3e3)},methods:{selectFirstRoute(){this.firstView?this.$router.push({name:this.firstView}):console.warn("no router view enabled, check your configuration!")}}},Ve=e=>(R("data-v-16686e30"),e=e(),U(),e),Pe=Ve(()=>D("img",{class:"logo",src:We},null,-1));function ke(e,t,n,i,r,o){const a=u("i-card"),s=u("i-column"),d=u("i-row"),g=u("i-container");return m(),f(g,null,{default:c(()=>[l(d,{center:"",middle:""},{default:c(()=>[l(s,null,{default:c(()=>[l(a,{color:"primary"},{header:c(()=>[_(" Cards Theme ")]),default:c(()=>[Pe]),_:1})]),_:1})]),_:1})]),_:1})}const Te=v(Se,[["render",ke],["__scopeId","data-v-16686e30"]]),$e=z({history:H("/openWB/web/display/themes/cards/"),routes:[{path:"/",name:"welcome",component:Te},{path:"/DashBoard",name:"dash-board",component:()=>B(()=>import("./DashBoardView-DEUu_ZQW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))},{path:"/EnergyFlow",name:"energy-flow",component:()=>B(()=>import("./EnergyFlowView-C2EKjwZe.js"),__vite__mapDeps([10,1,2,3,4,5,7,11]))},{path:"/ChargePoints",name:"charge-points",component:()=>B(()=>import("./ChargePointsView-BZVPA9o4.js"),__vite__mapDeps([12,1,2,3,4,5,6,7,8,13]))},{path:"/Status",name:"status",component:()=>B(()=>import("./StatusView-BaXuMl-p.js"),__vite__mapDeps([14,7,3,2,4,1,5]))}]}),k=G(we);k.use(K());k.use($e);k.use(J,{colorMode:"dark",components:Z});k.mount("#app");export{pe as C,de as N,P as u}; diff --git a/packages/modules/display_themes/cards/web/index.html b/packages/modules/display_themes/cards/web/index.html index 8f6f734738..7bda34d05e 100644 --- a/packages/modules/display_themes/cards/web/index.html +++ b/packages/modules/display_themes/cards/web/index.html @@ -6,7 +6,7 @@ openWB Display - Cards - +