iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 6.25 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[76612],{21220:function(t,i,s){s.a(t,async function(t,n){try{s.d(i,{t:function(){return r},v:function(){return h}});var o=s(71727),e=s(68246),a=s(85694),c=t([a]);const h={label:"",iconPath:(a=(c.then?(await c)():c)[0]).Gn},r=(t,i,s)=>{var n;const a=(0,o.m)(s),c=(0,e.Y)(s),h=null===(n=i[a])||void 0===n?void 0:n[c];return t(`component.${a}.services.${c}.name`,null==h?void 0:h.description_placeholders)||(null==h?void 0:h.name)||s};n()}catch(h){n(h)}})},96779:function(t,i,s){s.d(i,{q:function(){return o}});var n=s(45435);class o{get info(){return this._info}update(t,i){var s;this._hass=t,i!==this._subscribedPath&&(null===(s=this._unsub)||void 0===s||s.call(this),this._unsub=void 0,this._subscribedPath=i,i?this._unsub=(0,n.sy)(t,i,t=>{this._info=t,this._host.requestUpdate()}):this._info=n.Mw)}hostConnected(){if(this._hass&&this._subscribedPath&&!this._unsub){const t=this._subscribedPath;this._subscribedPath=void 0,this.update(this._hass,t)}}hostDisconnected(){var t;null===(t=this._unsub)||void 0===t||t.call(this),this._unsub=void 0}constructor(t){this._info=n.Mw,this._host=t,t.addController(this)}}},56505:function(t,i,s){s.a(t,async function(t,n){try{s.d(i,{G:function(){return _}});var o=s(35211),e=s(71727),a=s(21220),c=s(22792),h=s(85694),r=t([h,a]);[h,a]=r.then?(await r)():r;class _{_consume(t,i){new o.G(this._host,{context:t,subscribe:!0,callback:t=>{i(t),this._resolve()}})}get info(){return this._info}hostConnected(){this._resolve()}updateService(t){t!==this._service&&(this._service=t,this._resolve())}_resolve(){if(!(this._connection&&this._config&&this._services&&this._i18n))return;const t=this._service,i=this._i18n.language,s=t!==this._resolvedService,n=i!==this._resolvedLanguage;if(!s&&!n)return;if(this._resolvedService=t,this._resolvedLanguage=i,!t)return this._info=a.v,void this._host.requestUpdate();const o=(0,e.m)(t);this._info={label:(0,a.t)(this._i18n.localize,this._services,t),iconPath:s?h.l[o]||h.Gn:this._info.iconPath,icon:s?void 0:this._info.icon},this._host.requestUpdate(),this._i18n.loadBackendTranslation("services",o).then(s=>{this._resolvedService===t&&this._resolvedLanguage===i&&this._services&&(this._info=Object.assign(Object.assign({},this._info),{},{label:(0,a.t)(s,this._services,t)}),this._host.requestUpdate())}),s&&(0,h.f$)(this._connection,this._config,t).then(i=>{this._resolvedService===t&&(this._info=Object.assign(Object.assign({},this._info),{},{icon:i}),this._host.requestUpdate())})}constructor(t){this._info=a.v,this._host=t,t.addController(this),this._consume(c.Wq,t=>{this._connection=t.connection}),this._consume(c.WF,t=>{this._config=t.config}),this._consume(c.yk,t=>{this._services=t}),this._consume(c.D5,t=>{this._i18n=t})}}n()}catch(_){n(_)}})},32175:function(t,i,s){s.a(t,async function(t,n){try{s.r(i),s.d(i,{HuiShortcutBadge:function(){return y}});s(3362),s(42762),s(62953);var o=s(40445),e=s(5124),a=s(67576),c=s(89784),h=s(78870),r=(s(24671),s(47680),s(67094),s(96779)),_=s(56505),l=s(53034),u=s(19037),d=s(22064),v=s(97176),f=t([_]);_=(f.then?(await f)():f)[0];let g,b,p,H,m=t=>t;class y extends e.WF{static async getConfigElement(){return await s.e(29764).then(s.bind(s,30831)),document.createElement("hui-shortcut-badge-editor")}static getStubConfig(){return{type:"shortcut",tap_action:{action:"navigate",navigation_path:"/home"}}}setConfig(t){this._config=Object.assign({tap_action:{action:"none"}},t)}willUpdate(t){if((t.has("hass")||t.has("_config"))&&this.hass){var i;const t=null===(i=this._config)||void 0===i?void 0:i.tap_action;this._navInfo.update(this.hass,"navigate"===(null==t?void 0:t.action)?t.navigation_path:void 0),this._serviceInfo.updateService("perform-action"===(null==t?void 0:t.action)||"call-service"===(null==t?void 0:t.action)?t.perform_action||t.service:void 0)}}_handleAction(t){(0,d.$)(this,this.hass,this._config,t.detail.action)}get _hasAction(){var t,i,s;return(0,v.h)(null===(t=this._config)||void 0===t?void 0:t.tap_action)||(0,v.h)(null===(i=this._config)||void 0===i?void 0:i.hold_action)||(0,v.h)(null===(s=this._config)||void 0===s?void 0:s.double_tap_action)}render(){if(!this._config||!this.hass)return e.s6;const t=(0,l.J)(this.hass,this._config.tap_action,this._navInfo.info,this._serviceInfo.info),i=(this._config.text||t.label).trim(),s=this._config.icon||t.icon,n=s?void 0:t.iconPath,o=this._config.color?(0,h.MP)(this._config.color):void 0,a=o?{"--badge-color":o}:{};return(0,e.qy)(g||(g=m` <ha-badge .type="${0}" .iconOnly="${0}" style="${0}" ="${0}" .actionHandler="${0}"> ${0} ${0} </ha-badge> `),this._hasAction?"button":"badge",!i,(0,c.W)(a),this._handleAction,(0,u.T)({hasHold:(0,v.h)(this._config.hold_action),hasDoubleClick:(0,v.h)(this._config.double_tap_action)}),s?(0,e.qy)(b||(b=m`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),s):(0,e.qy)(p||(p=m`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),n),i)}constructor(...t){super(...t),this._navInfo=new r.q(this),this._serviceInfo=new _.G(this)}}y.styles=(0,e.AH)(H||(H=m`ha-badge{--badge-color:var(--primary-color)}`)),(0,o.Cg)([(0,a.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,a.wk)()],y.prototype,"_config",void 0),y=(0,o.Cg)([(0,a.EM)("hui-shortcut-badge")],y),n()}catch(g){n(g)}})},53034:function(t,i,s){s.d(i,{J:function(){return o}});const n={label:"",iconPath:"M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z"},o=(t,i,s,o)=>{switch(null==i?void 0:i.action){case"navigate":return s;case"assist":return{label:t.localize("ui.panel.lovelace.editor.action-editor.actions.assist"),iconPath:"M12,2A3,3 0 0,1 15,5V11A3,3 0 0,1 12,14A3,3 0 0,1 9,11V5A3,3 0 0,1 12,2M19,11C19,14.53 16.39,17.44 13,17.93V21H11V17.93C7.61,17.44 5,14.53 5,11H7A5,5 0 0,0 12,16A5,5 0 0,0 17,11H19Z"};case"call-service":case"perform-action":return o;case"url":return{label:i.url_path||"",iconPath:"M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z"};default:return n}}}}]);