UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

1 lines 5.56 kB
export const __rspack_esm_id=76612;export const __rspack_esm_ids=[76612];export const __webpack_modules__={21220(t,i,s){s.a(t,async function(t,e){try{s.d(i,{t:()=>r,v:()=>h});var o=s(71727),n=s(68246),a=s(85694),c=t([a]);const h={label:"",iconPath:(a=(c.then?(await c)():c)[0]).Gn},r=(t,i,s)=>{const e=(0,o.m)(s),a=(0,n.Y)(s),c=i[e]?.[a];return t(`component.${e}.services.${a}.name`,c?.description_placeholders)||c?.name||s};e()}catch(t){e(t)}})},96779(t,i,s){s.d(i,{q:()=>o});var e=s(45435);class o{get info(){return this._info}update(t,i){this._hass=t,i!==this._subscribedPath&&(this._unsub?.(),this._unsub=void 0,this._subscribedPath=i,i?this._unsub=(0,e.sy)(t,i,t=>{this._info=t,this._host.requestUpdate()}):this._info=e.Mw)}hostConnected(){if(this._hass&&this._subscribedPath&&!this._unsub){const t=this._subscribedPath;this._subscribedPath=void 0,this.update(this._hass,t)}}hostDisconnected(){this._unsub?.(),this._unsub=void 0}constructor(t){this._info=e.Mw,this._host=t,t.addController(this)}}},56505(t,i,s){s.a(t,async function(t,e){try{s.d(i,{G:()=>_});var o=s(35211),n=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,e=i!==this._resolvedLanguage;if(!s&&!e)return;if(this._resolvedService=t,this._resolvedLanguage=i,!t)return this._info=a.v,void this._host.requestUpdate();const o=(0,n.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={...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={...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})}}e()}catch(t){e(t)}})},32175(t,i,s){s.a(t,async function(t,e){try{s.r(i),s.d(i,{HuiShortcutBadge:()=>g});var o=s(62826),n=s(5124),a=s(22441),c=s(89784),h=s(78870),r=(s(24671),s(47680),s(67094),s(96779)),_=s(56505),l=s(53034),d=s(19037),u=s(22064),v=s(97176),f=t([_]);_=(f.then?(await f)():f)[0];class g extends n.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={tap_action:{action:"none"},...t}}willUpdate(t){if((t.has("hass")||t.has("_config"))&&this.hass){const t=this._config?.tap_action;this._navInfo.update(this.hass,"navigate"===t?.action?t.navigation_path:void 0),this._serviceInfo.updateService("perform-action"===t?.action||"call-service"===t?.action?t.perform_action||t.service:void 0)}}_handleAction(t){(0,u.$)(this,this.hass,this._config,t.detail.action)}get _hasAction(){return(0,v.h)(this._config?.tap_action)||(0,v.h)(this._config?.hold_action)||(0,v.h)(this._config?.double_tap_action)}render(){if(!this._config||!this.hass)return n.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,e=s?void 0:t.iconPath,o=this._config.color?(0,h.MP)(this._config.color):void 0,a=o?{"--badge-color":o}:{};return n.qy` <ha-badge .type="${this._hasAction?"button":"badge"}" .iconOnly="${!i}" style="${(0,c.W)(a)}" @action="${this._handleAction}" .actionHandler="${(0,d.T)({hasHold:(0,v.h)(this._config.hold_action),hasDoubleClick:(0,v.h)(this._config.double_tap_action)})}"> ${s?n.qy`<ha-icon slot="icon" .icon="${s}"></ha-icon>`:n.qy`<ha-svg-icon slot="icon" .path="${e}"></ha-svg-icon>`} ${i} </ha-badge> `}constructor(...t){super(...t),this._navInfo=new r.q(this),this._serviceInfo=new _.G(this)}}g.styles=n.AH`ha-badge{--badge-color:var(--primary-color)}`,(0,o.Cg)([(0,a.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,a.wk)()],g.prototype,"_config",void 0),g=(0,o.Cg)([(0,a.EM)("hui-shortcut-badge")],g),e()}catch(t){e(t)}})},53034(t,i,s){s.d(i,{J:()=>o});const e={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(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 e}}}};