"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[7549,3459],{6:function(e,t,l){l.d(t,{Z:function(){return h}});var n=l(6252),o=l(3577),i=l(9963);const a=e=>((0,n.dD)("data-v-a6396ae8"),e=e(),(0,n.Cn)(),e),c=["checked"],r=a((()=>(0,n._)("div",{class:"switch"},[(0,n._)("div",{class:"dot"})],-1))),s={class:"label"};function u(e,t,l,a,u,d){return(0,n.wg)(),(0,n.iD)("div",{class:(0,o.C_)(["power-switch",{disabled:l.disabled}]),onClick:t[0]||(t[0]=(0,i.iM)(((...e)=>d.onInput&&d.onInput(...e)),["stop"]))},[(0,n._)("input",{type:"checkbox",checked:l.value},null,8,c),(0,n._)("label",null,[r,(0,n._)("span",s,[(0,n.WI)(e.$slots,"default",{},void 0,!0)])])],2)}var d={name:"ToggleSwitch",emits:["input"],props:{value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput(e){if(this.disabled)return!1;this.$emit("input",e)}}},p=l(3744);const v=(0,p.Z)(d,[["render",u],["__scopeId","data-v-a6396ae8"]]);var h=v},7549:function(e,t,l){l.r(t),l.d(t,{default:function(){return g}});var n=l(6252),o=l(3577);const i={class:"entity sensor-container"},a={class:"head"},c={class:"col-1 icon"},r={class:"col-s-8 col-m-9 label"},s=["textContent"],u={key:0,class:"col-s-3 col-m-2 pull-right"};function d(e,t,l,d,p,v){const h=(0,n.up)("EntityIcon"),y=(0,n.up)("ToggleSwitch");return(0,n.wg)(),(0,n.iD)("div",i,[(0,n._)("div",a,[(0,n._)("div",c,[(0,n.Wm)(h,{entity:e.value,loading:e.loading,error:e.error},null,8,["entity","loading","error"])]),(0,n._)("div",r,[(0,n._)("div",{class:"name",textContent:(0,o.zw)(e.value.name)},null,8,s)]),null!=e.value.value?((0,n.wg)(),(0,n.iD)("div",u,[(0,n.Wm)(y,{value:e.value.value,disabled:!0},null,8,["value"])])):(0,n.kq)("",!0)])])}var p=l(7909),v=l(3459),h=l(6),y={name:"BinarySensor",components:{EntityIcon:v["default"],ToggleSwitch:h.Z},mixins:[p["default"]]},f=l(3744);const m=(0,f.Z)(y,[["render",d],["__scopeId","data-v-e7b0b2c4"]]);var g=m},3459:function(e,t,l){l.r(t),l.d(t,{default:function(){return v}});var n=l(6252),o=l(3577),i=l(3540);const a={key:0,src:i,class:"loading"},c={key:1,class:"fas fa-circle-exclamation error"};function r(e,t,l,i,r,s){const u=(0,n.up)("Icon");return(0,n.wg)(),(0,n.iD)("div",{class:(0,o.C_)(["entity-icon-container",{"with-color-fill":!!s.colorFill}]),style:(0,o.j5)(s.colorFillStyle)},[l.loading?((0,n.wg)(),(0,n.iD)("img",a)):l.error?((0,n.wg)(),(0,n.iD)("i",c)):((0,n.wg)(),(0,n.j4)(u,(0,o.vs)((0,n.dG)({key:2},s.computedIconNormalized)),null,16))],6)}var s=l(1478),u={name:"EntityIcon",components:{Icon:s.Z},props:{loading:{type:Boolean,default:!1},error:{type:Boolean,default:!1},entity:{type:Object,required:!0},icon:{type:Object,default:()=>{}},hasColorFill:{type:Boolean,default:!1}},data(){return{component:null,modalVisible:!1}},computed:{computedIcon(){let e={...this.entity?.meta?.icon||{}};return Object.keys(this.icon||{}).length&&(e=this.icon),{...e}},colorFill(){return this.hasColorFill&&this.computedIcon.color},colorFillStyle(){return this.colorFill&&!this.error?{background:this.colorFill}:{}},computedIconNormalized(){const e={...this.computedIcon};return this.colorFill&&delete e.color,e},type(){let e=this.entity.type||"";return e.charAt(0).toUpperCase()+e.slice(1)}}},d=l(3744);const p=(0,d.Z)(u,[["render",r],["__scopeId","data-v-4fad24e6"]]);var v=p},3540:function(e,t,l){e.exports=l.p+"static/img/spinner.c0bee445.gif"}}]);
//# sourceMappingURL=7549.8b5472d6.js.map