iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 12.8 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[81804],{45100:function(e,t,i){i.a(e,async function(e,n){try{i.r(t),i.d(t,{HaIconButtonPrev:function(){return f}});i(62953);var o=i(40445),a=i(5124),s=i(67576),c=i(63091),l=i(26300),r=e([l]);l=(r.then?(await r)():r)[0];let h,d=e=>e;const g="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",u="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z";class f extends a.WF{render(){var e;return(0,a.qy)(h||(h=d` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...e){super(...e),this.disabled=!1,this._icon="rtl"===c.G.document.dir?u:g}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],f.prototype,"disabled",void 0),(0,o.Cg)([(0,s.MZ)()],f.prototype,"label",void 0),(0,o.Cg)([(0,s.MZ)()],f.prototype,"href",void 0),(0,o.Cg)([(0,s.MZ)()],f.prototype,"target",void 0),(0,o.Cg)([(0,s.MZ)()],f.prototype,"rel",void 0),(0,o.Cg)([(0,s.MZ)()],f.prototype,"download",void 0),(0,o.Cg)([(0,s.wk)()],f.prototype,"_icon",void 0),f=(0,o.Cg)([(0,s.EM)("ha-icon-button-prev")],f),n()}catch(h){n(h)}})},9169:function(e,t,i){i.d(t,{j:function(){return n}});const n=["relative","total","date","time","datetime"]},82743:function(e,t,i){i.a(e,async function(e,n){try{i.d(t,{j:function(){return f}});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var o=i(98743),a=(i(16732),i(9578)),s=i(51007),c=i(37696),l=i(10792),r=i(14097),h=i(34128),d=e([o,a,s,c,l,r]);[o,a,s,c,l,r]=d.then?(await d)():d;const g=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),u={},f=e=>(0,h.gh)("action-button"===e?"service-button":e,"element",g,u);n()}catch(g){n(g)}})},98809:function(e,t,i){i.a(e,async function(e,t){try{i(74423),i(18111),i(22489),i(61701),i(62953);var n=i(40445),o=i(5124),a=i(67576),s=i(22786),c=i(63533),l=i(1087),r=i(71727),h=i(52763),d=i(20507),g=e([h]);h=(g.then?(await g)():g)[0];let u,f=e=>e;const m={none:{},"entity-id":{},"last-changed":{},"last-updated":{},"last-triggered":{domains:["automation","script"]},area:{},position:{domains:["cover"]},state:{},"tilt-position":{domains:["cover"]},brightness:{domains:["light"]}};class p extends o.WF{setConfig(e){(0,c.vA)(e,d.l),this._config=e}render(){if(!this.hass||!this._config)return o.s6;const e=this.schema||this._schema(this._config.entity,this.hass.localize);return(0,o.qy)(u||(u=f` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" -changed="${0}"></ha-form> `),this.hass,this._config,e,this._computeLabelCallback,this._valueChanged)}_valueChanged(e){(0,l.r)(this,"config-changed",{config:e.detail.value})}constructor(...e){super(...e),this._schema=(0,s.A)((e,t)=>{const i=(0,r.m)(e);return[{name:"entity",required:!0,selector:{entity:{}}},{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{name:"icon",selector:{icon:{}},context:{icon_entity:"entity"}},{name:"secondary_info",selector:{select:{options:Object.keys(m).filter(e=>!("domains"in m[e])||"domains"in m[e]&&m[e].domains.includes(i)).map(e=>({value:e,label:t(`ui.panel.lovelace.editor.card.entities.secondary_info_values.${e}`)}))}}}]}),this._computeLabelCallback=e=>"secondary_info"===e.name?this.hass.localize(`ui.panel.lovelace.editor.card.entity-row.${e.name}`):this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}(0,n.Cg)([(0,a.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,n.Cg)([(0,a.MZ)({attribute:!1})],p.prototype,"schema",void 0),(0,n.Cg)([(0,a.wk)()],p.prototype,"_config",void 0),p=(0,n.Cg)([(0,a.EM)("hui-generic-entity-row-editor")],p),t()}catch(u){t(u)}})},88528:function(e,t,i){i.a(e,async function(e,t){try{i(3362);var n=i(40445),o=i(67576),a=i(94225),s=i(63277),c=i(98809),l=e([c,s,a]);[c,s,a]=l.then?(await l)():l;const r="generic-row";class h extends s.U{get configElementType(){var e,t,i;return null!==(e=this.value)&&void 0!==e&&e.type||!("entity"in this.value)?"perform-action"===(null===(t=this.value)||void 0===t?void 0:t.type)?"call-service":null===(i=this.value)||void 0===i?void 0:i.type:r}async getConfigElement(){if(this.configElementType===r)return document.createElement("hui-generic-entity-row-editor");const e=await(0,a.t)(this.configElementType);return e&&e.getConfigElement?e.getConfigElement():void 0}}h=(0,n.Cg)([(0,o.EM)("hui-row-element-editor")],h),t()}catch(r){t(r)}})},10903:function(e,t,i){i.a(e,async function(e,t){try{i(3362);var n=i(40445),o=i(67576),a=i(13174),s=i(63277),c=e([s,a]);[s,a]=c.then?(await c)():c;class l extends s.U{async getConfigElement(){const e=await(0,a.h)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}async getConfigForm(){const e=await(0,a.h)(this.configElementType);if(e&&e.getConfigForm)return e.getConfigForm()}}l=(0,n.Cg)([(0,o.EM)("hui-card-feature-element-editor")],l),t()}catch(l){t(l)}})},49288:function(e,t,i){i.a(e,async function(e,t){try{i(3362);var n=i(40445),o=i(67576),a=i(83938),s=i(63277),c=e([s]);s=(c.then?(await c)():c)[0];class l extends s.U{async getConfigElement(){const e=await(0,a.l)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}}l=(0,n.Cg)([(0,o.EM)("hui-headerfooter-element-editor")],l),t()}catch(l){t(l)}})},6870:function(e,t,i){i.a(e,async function(e,t){try{i(3362);var n=i(40445),o=i(67576),a=i(72669),s=i(63277),c=e([s,a]);[s,a]=c.then?(await c)():c;class l extends s.U{get configElementType(){var e;return(null===(e=this.value)||void 0===e?void 0:e.type)||"entity"}async getConfigElement(){const e=await(0,a.U)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}async getConfigForm(){const e=await(0,a.U)(this.configElementType);if(e&&e.getConfigForm)return e.getConfigForm()}}l=(0,n.Cg)([(0,o.EM)("hui-heading-badge-element-editor")],l),t()}catch(l){t(l)}})},98161:function(e,t,i){i.a(e,async function(e,t){try{i(3362);var n=i(40445),o=i(67576),a=i(91322),s=e([a]);a=(s.then?(await s)():s)[0];class c extends a.m{async getConfigForm(){return this.form}updated(e){if(super.updated(e),e.has("form")&&this._configElement){const{schema:e,assertConfig:t,computeLabel:i,computeHelper:n}=this.form;this._configElement.schema=e,i&&(this._configElement.computeLabel=i),n&&(this._configElement.computeHelper=n),t&&(this._configElement.assertConfig=t)}}}(0,n.Cg)([(0,o.MZ)({attribute:!1})],c.prototype,"form",void 0),c=(0,n.Cg)([(0,o.EM)("hui-form-element-editor")],c),t()}catch(c){t(c)}})},81287:function(e,t,i){i.a(e,async function(e,n){try{i.r(t),i.d(t,{HuiSubElementEditor:function(){return k}});i(62953);var o=i(40445),a=i(5124),s=i(67576),c=i(1087),l=i(26300),r=i(45100),h=i(88528),d=i(10903),g=i(49288),u=i(6870),f=i(98161),m=i(3548),p=e([l,r,h,d,g,u,f,m]);[l,r,h,d,g,u,f,m]=p.then?(await p)():p;let y,v,C,_,b,M,$,E,w=e=>e;const H="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",V="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z";class k extends a.WF{render(){var e,t;const i=this.config.elementConfig&&"type"in this.config.elementConfig?this.config.elementConfig.type:"";return(0,a.qy)(y||(y=w` <div class="header"> <div class="back-title"> <ha-icon-button-prev .label="${0}" ="${0}"></ha-icon-button-prev> <span slot="title"> ${0} </span> </div> <ha-icon-button class="gui-mode-button" ="${0}" .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> </div> ${0} `),this.hass.localize("ui.common.back"),this._goBack,"element"===(null===(e=this.config)||void 0===e?void 0:e.type)?this.hass.localize("ui.panel.lovelace.editor.sub-element-editor.types.element_type",{type:this.hass.localize(`ui.panel.lovelace.editor.card.picture-elements.element_types.${i}`)||i}):this.hass.localize(`ui.panel.lovelace.editor.sub-element-editor.types.${null===(t=this.config)||void 0===t?void 0:t.type}`),this._toggleMode,!this._guiModeAvailable,this.hass.localize(this._guiMode?"ui.panel.lovelace.editor.edit_card.show_code_editor":"ui.panel.lovelace.editor.edit_card.show_visual_editor"),this._guiMode?H:V,this._renderEditor())}_renderEditor(){const e=this.config.type;if(this.form)return(0,a.qy)(v||(v=w` <hui-form-element-editor class="editor" .hass="${0}" .value="${0}" .form="${0}" .context="${0}" -changed="${0}"></hui-form-element-editor> `),this.hass,this.config.elementConfig,this.form,this.config.context,this._handleConfigChanged);switch(e){case"row":return(0,a.qy)(C||(C=w` <hui-row-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-row-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);case"header":case"footer":return(0,a.qy)(_||(_=w` <hui-headerfooter-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-headerfooter-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);case"element":return(0,a.qy)(b||(b=w` <hui-picture-element-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-picture-element-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);case"feature":return(0,a.qy)(M||(M=w` <hui-card-feature-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-card-feature-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);case"heading-badge":return(0,a.qy)($||($=w` <hui-heading-badge-element-editor class="editor" .hass="${0}" .value="${0}" .context="${0}" -changed="${0}" -changed="${0}"></hui-heading-badge-element-editor> `),this.hass,this.config.elementConfig,this.config.context,this._handleConfigChanged,this._handleGUIModeChanged);default:return a.s6}}_goBack(){(0,c.r)(this,"go-back")}_toggleMode(){var e;null===(e=this._editorElement)||void 0===e||e.toggleMode()}_handleGUIModeChanged(e){e.stopPropagation(),this._guiMode=e.detail.guiMode,this._guiModeAvailable=e.detail.guiModeAvailable}_handleConfigChanged(e){this._guiModeAvailable=e.detail.guiModeAvailable}constructor(...e){super(...e),this._guiModeAvailable=!0,this._guiMode=!0}}k.styles=(0,a.AH)(E||(E=w`.header{display:flex;justify-content:space-between;align-items:center}.back-title{display:flex;align-items:center;font-size:var(--ha-font-size-l)}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],k.prototype,"config",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],k.prototype,"form",void 0),(0,o.Cg)([(0,s.wk)()],k.prototype,"_guiModeAvailable",void 0),(0,o.Cg)([(0,s.wk)()],k.prototype,"_guiMode",void 0),(0,o.Cg)([(0,s.P)(".editor")],k.prototype,"_editorElement",void 0),k=(0,o.Cg)([(0,s.EM)("hui-sub-element-editor")],k),n()}catch(y){n(y)}})},3548:function(e,t,i){i.a(e,async function(e,t){try{i(3362);var n=i(40445),o=i(67576),a=i(63277),s=i(82743),c=e([a,s]);[a,s]=c.then?(await c)():c;class l extends a.U{get configElementType(){var e,t;return"action-button"===(null===(e=this.value)||void 0===e?void 0:e.type)?"service-button":null===(t=this.value)||void 0===t?void 0:t.type}async getConfigElement(){const e=await(0,s.j)(this.configElementType);if(e&&e.getConfigElement)return e.getConfigElement()}}l=(0,n.Cg)([(0,o.EM)("hui-picture-element-element-editor")],l),t()}catch(l){t(l)}})},20507:function(e,t,i){i.d(t,{l:function(){return c},z:function(){return l}});var n=i(63533),o=i(9169),a=i(91408),s=i(44155);const c=(0,n.KC)([(0,n.Ik)({entity:(0,n.Yj)(),name:(0,n.lq)(s.q),icon:(0,n.lq)((0,n.Yj)()),image:(0,n.lq)((0,n.Yj)()),secondary_info:(0,n.lq)((0,n.Yj)()),format:(0,n.lq)((0,n.vP)(o.j)),state_color:(0,n.lq)((0,n.zM)()),tap_action:(0,n.lq)(a.kn),hold_action:(0,n.lq)(a.kn),double_tap_action:(0,n.lq)(a.kn),confirmation:(0,n.lq)(a.dk),show_last_changed:(0,n.lq)((0,n.zM)()),show_state:(0,n.lq)((0,n.zM)())}),(0,n.Yj)()]),l=(0,n.KC)([(0,n.Ik)({entity:(0,n.Yj)(),name:(0,n.lq)(s.q),color:(0,n.lq)((0,n.Yj)())}),(0,n.Yj)()])}}]);