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