"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[3025],{43483:function(e,t,n){n.d(t,{A:function(){return v}});var i=n(20641),a=n(90033),l=n(53751);const o=["checked","id"],s={class:"label"};function c(e,t,n,c,d,u){return(0,i.uX)(),(0,i.CE)("div",{class:(0,a.C4)(["power-switch",{disabled:n.disabled}]),onClick:t[0]||(t[0]=(0,l.D$)((...e)=>u.onInput&&u.onInput(...e),["stop"]))},[(0,i.Lk)("input",{type:"checkbox",checked:n.value,id:n.id},null,8,o),(0,i.Lk)("label",null,[t[1]||(t[1]=(0,i.Lk)("div",{class:"switch"},[(0,i.Lk)("div",{class:"dot"})],-1)),(0,i.Lk)("span",s,[(0,i.RG)(e.$slots,"default",{},void 0,!0)])])],2)}var d={name:"ToggleSwitch",emits:["input"],props:{id:{type:String},value:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},methods:{onInput(e){if(this.disabled)return!1;this.$emit("input",e)}}},u=n(66262);const r=(0,u.A)(d,[["render",c],["__scopeId","data-v-eff375b6"]]);var v=r},53025:function(e,t,n){n.r(t),n.d(t,{default:function(){return b}});var i=n(20641),a=n(90033),l=n(53751);const o={class:"entity device-container"},s={class:"head"},c={class:"icon"},d={class:"label"},u=["textContent"];function r(e,t,n,r,v,p){const h=(0,i.g2)("EntityIcon"),f=(0,i.g2)("ToggleSwitch");return(0,i.uX)(),(0,i.CE)("div",o,[(0,i.Lk)("div",s,[(0,i.Lk)("div",c,[(0,i.bF)(h,{entity:e.value,loading:e.loading,error:e.error},null,8,["entity","loading","error"])]),(0,i.Lk)("div",d,[(0,i.Lk)("div",{class:"name",textContent:(0,a.v_)(e.value.name)},null,8,u)]),(0,i.Lk)("div",{class:(0,a.C4)(["value-container",{"with-children":e.value?.children_ids?.length}])},[(0,i.bF)(f,{value:e.value.connected,disabled:e.loading,onInput:p.connect,onClick:t[0]||(t[0]=(0,l.D$)(()=>{},["stop"]))},null,8,["value","disabled","onInput"])],2)])])}var v=n(14897),p=n(73818),h=n(43483),f={name:"BluetoothDevice",components:{EntityIcon:p["default"],ToggleSwitch:h.A},mixins:[v["default"]],methods:{async connect(e){e.stopPropagation(),this.$emit("loading",!0);const t="bluetooth."+(this.value.connected?"disconnect":"connect");try{await this.request(t,{device:this.value.address})}finally{this.$emit("loading",!1)}}}},k=n(66262);const g=(0,k.A)(f,[["render",r],["__scopeId","data-v-6aff1eff"]]);var b=g}}]);
//# sourceMappingURL=3025.99d32705.js.map