"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[6752],{43483:function(t,e,n){n.d(e,{A:function(){return p}});var i=n(20641),o=n(90033),a=n(53751);const s=["checked","id"],l={class:"label"};function c(t,e,n,c,d,u){return(0,i.uX)(),(0,i.CE)("div",{class:(0,o.C4)(["power-switch",{disabled:n.disabled}]),onClick:e[0]||(e[0]=(0,a.D$)((...t)=>u.onInput&&u.onInput(...t),["stop"]))},[(0,i.Lk)("input",{type:"checkbox",checked:n.value,id:n.id},null,8,s),(0,i.Lk)("label",null,[e[1]||(e[1]=(0,i.Lk)("div",{class:"switch"},[(0,i.Lk)("div",{class:"dot"})],-1)),(0,i.Lk)("span",l,[(0,i.RG)(t.$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(t){if(this.disabled)return!1;this.$emit("input",t)}}},u=n(66262);const r=(0,u.A)(d,[["render",c],["__scopeId","data-v-eff375b6"]]);var p=r},96752:function(t,e,n){n.r(e),n.d(e,{default:function(){return y}});var i=n(20641),o=n(90033),a=n(53751);const s={class:"entity bluetooth-service-container"},l={class:"head"},c={class:"col-1 icon"},d={class:"col-9 label"},u=["textContent"],r={class:"col-2 connector pull-right"};function p(t,e,n,p,h,v){const g=(0,i.g2)("EntityIcon"),f=(0,i.g2)("ToggleSwitch");return(0,i.uX)(),(0,i.CE)("div",s,[(0,i.Lk)("div",l,[(0,i.Lk)("div",c,[(0,i.bF)(g,{entity:t.value,loading:t.loading,error:t.error},null,8,["entity","loading","error"])]),(0,i.Lk)("div",d,[(0,i.Lk)("div",{class:"name",textContent:(0,o.v_)(t.value.name)},null,8,u)]),(0,i.Lk)("div",r,[(0,i.bF)(f,{value:t.value.connected,disabled:t.loading,onInput:v.connect,onClick:e[0]||(e[0]=(0,a.D$)(()=>{},["stop"]))},null,8,["value","disabled","onInput"])])])])}var h=n(43483),v=n(73818),g=n(14897),f={name:"BluetoothService",components:{ToggleSwitch:h.A,EntityIcon:v["default"]},mixins:[g["default"]],methods:{async connect(t){t.stopPropagation(),this.$emit("loading",!0);const e="bluetooth."+(this.value.connected?"disconnect":"connect");try{await this.request(e,{device:this.parent.address,service_uuid:this.uuid})}finally{this.$emit("loading",!1)}},async disconnect(t){t.stopPropagation(),this.$emit("loading",!0);try{await this.request("bluetooth.disconnect",{device:this.parent.address})}finally{this.$emit("loading",!1)}}}},k=n(66262);const b=(0,k.A)(f,[["render",p],["__scopeId","data-v-5c801a06"]]);var y=b}}]);
//# sourceMappingURL=6752.04005c01.js.map