"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[5498],{6:function(e,n,t){t.d(n,{Z:function(){return h}});var i=t(6252),a=t(3577),r=t(9963),o=function(e){return(0,i.dD)("data-v-a6396ae8"),e=e(),(0,i.Cn)(),e},c=["checked"],u=o((function(){return(0,i._)("div",{class:"switch"},[(0,i._)("div",{class:"dot"})],-1)})),l={class:"label"};function s(e,n,t,o,s,d){return(0,i.wg)(),(0,i.iD)("div",{class:(0,a.C_)(["power-switch",{disabled:t.disabled}]),onClick:n[0]||(n[0]=(0,r.iM)((function(){return d.onInput&&d.onInput.apply(d,arguments)}),["stop"]))},[(0,i._)("input",{type:"checkbox",checked:t.value},null,8,c),(0,i._)("label",null,[u,(0,i._)("span",l,[(0,i.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=t(3744);const v=(0,p.Z)(d,[["render",s],["__scopeId","data-v-a6396ae8"]]);var h=v},5498:function(e,n,t){t.r(n),t.d(n,{default:function(){return b}});t(8309);var i=t(6252),a=t(3577),r=t(9963),o={class:"entity bluetooth-service-container"},c={class:"head"},u={class:"col-1 icon"},l={class:"col-9 label"},s=["textContent"],d={class:"col-2 connector pull-right"};function p(e,n,t,p,v,h){var f=(0,i.up)("EntityIcon"),g=(0,i.up)("ToggleSwitch");return(0,i.wg)(),(0,i.iD)("div",o,[(0,i._)("div",c,[(0,i._)("div",u,[(0,i.Wm)(f,{entity:e.value,loading:e.loading,error:e.error},null,8,["entity","loading","error"])]),(0,i._)("div",l,[(0,i._)("div",{class:"name",textContent:(0,a.zw)(e.value.name)},null,8,s)]),(0,i._)("div",d,[(0,i.Wm)(g,{value:e.value.connected,disabled:e.loading,onInput:h.connect,onClick:n[0]||(n[0]=(0,r.iM)((function(){}),["stop"]))},null,8,["value","disabled","onInput"])])])])}var v=t(8534),h=(t(5666),t(6)),f=t(1706),g=t(7909),m={name:"BluetoothService",components:{ToggleSwitch:h.Z,EntityIcon:f["default"]},mixins:[g["default"]],methods:{connect:function(e){var n=this;return(0,v.Z)(regeneratorRuntime.mark((function t(){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.stopPropagation(),n.$emit("loading",!0),i="bluetooth."+(n.value.connected?"disconnect":"connect"),t.prev=3,t.next=6,n.request(i,{device:n.parent.address,service_uuid:n.uuid});case 6:return t.prev=6,n.$emit("loading",!1),t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[3,,6,9]])})))()},disconnect:function(e){var n=this;return(0,v.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.stopPropagation(),n.$emit("loading",!0),t.prev=2,t.next=5,n.request("bluetooth.disconnect",{device:n.parent.address});case 5:return t.prev=5,n.$emit("loading",!1),t.finish(5);case 8:case"end":return t.stop()}}),t,null,[[2,,5,8]])})))()}}},w=t(3744);const _=(0,w.Z)(m,[["render",p],["__scopeId","data-v-5c801a06"]]);var b=_}}]);
//# sourceMappingURL=5498-legacy.8c82ec84.js.map