UNPKG

iobroker.lovelace

Version:

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

15 lines 17.7 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[58938],{77090:function(t,e,i){i.d(e,{s:function(){return a}});const a=t=>!(!t.detail.selected||"property"!==t.detail.source)&&(t.currentTarget.selected=!1,!0)},14693:function(t,e,i){i.a(t,async function(t,a){try{i.d(e,{r:function(){return A}});i(62953);var o=i(40445),s=i(35211),n=i(5124),r=i(67576),l=i(71769),d=i(22792),h=i(99611),p=(i(76538),i(26300)),c=i(72554),u=t([h,p,c]);[h,p,c]=u.then?(await u)():u;let m,g,v,y,b,_,f,C,x,$,w,M=t=>t;const L="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",H="(max-width: 870px), (max-height: 500px)";class A extends n.WF{connectedCallback(){super.connectedCallback(),this._unsubMediaQuery=(0,l.m)(H,t=>{this._modeSet&&!this.allowModeChange||(this.mode=t?"bottom-sheet":"dialog",this._modeSet=!0)})}get _defaultAriaLabelledBy(){return this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)}_renderCloseButton(t){var e,i,a;return this.hideCloseButton?(0,n.qy)(m||(m=M`<span slot="${0}"></span>`),t):(0,n.qy)(g||(g=M` <slot name="headerNavigationIcon" slot="${0}"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> `),t,null!==(e=null===(i=this._i18n)||void 0===i||null===(a=i.localize)||void 0===a?void 0:a.call(i,"ui.common.close"))&&void 0!==e?e:"Close",L)}_renderHeaderContent(){return(0,n.qy)(v||(v=M` <ha-dialog-header .subtitlePosition="${0}"> ${0} ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> `),this.headerSubtitlePosition,this._renderCloseButton("navigationIcon"),void 0!==this.headerTitle?(0,n.qy)(y||(y=M`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,n.qy)(b||(b=M`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,n.qy)(_||(_=M`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,n.qy)(f||(f=M`<slot name="headerSubtitle" slot="subtitle"></slot>`)))}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._unsubMediaQuery)||void 0===t||t.call(this),this._unsubMediaQuery=void 0,this._modeSet=!1}render(){return"bottom-sheet"===this.mode?(0,n.qy)(C||(C=M` <ha-bottom-sheet .ariaLabelledBy="${0}" .ariaDescribedBy="${0}" .flexContent="${0}" .open="${0}" .preventScrimClose="${0}"> ${0} <slot></slot> <slot name="footer" slot="footer"></slot> </ha-bottom-sheet> `),this._defaultAriaLabelledBy,this.ariaDescribedBy,this.flexContent,this.open,this.preventScrimClose,this.withoutHeader?n.s6:(0,n.qy)(x||(x=M` <slot name="header" slot="header">${0}</slot> `),this._renderHeaderContent())):(0,n.qy)($||($=M` <ha-dialog .open="${0}" .type="${0}" .width="${0}" .preventScrimClose="${0}" .ariaLabelledBy="${0}" .ariaDescribedBy="${0}" .headerTitle="${0}" .headerSubtitle="${0}" .headerSubtitlePosition="${0}" .flexContent="${0}" .withoutHeader="${0}"> ${0} <slot name="headerTitle" slot="headerTitle"></slot> <slot name="headerSubtitle" slot="headerSubtitle"></slot> <slot name="headerActionItems" slot="headerActionItems"></slot> <slot></slot> <slot name="footer" slot="footer"></slot> </ha-dialog> `),this.open,this.type,this.width,this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this.headerTitle,this.headerSubtitle,this.headerSubtitlePosition,this.flexContent,this.withoutHeader,this._renderCloseButton("headerNavigationIcon"))}static get styles(){return[(0,n.AH)(w||(w=M`ha-bottom-sheet{--ha-bottom-sheet-border-radius:var(--ha-border-radius-2xl);--ha-bottom-sheet-surface-background:var( --ha-dialog-surface-background, var(--card-background-color, var(--ha-color-surface-default)) );--ha-bottom-sheet-padding:0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left);--ha-bottom-sheet-content-padding:var( --dialog-content-padding, 0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6) )}`))]}constructor(...t){super(...t),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.allowModeChange=!1,this.withoutHeader=!1,this.hideCloseButton=!1,this.flexContent=!1,this.mode="dialog",this._modeSet=!1}}(0,o.Cg)([(0,r.MZ)({attribute:"aria-labelledby"})],A.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"aria-describedby"})],A.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],A.prototype,"open",void 0),(0,o.Cg)([(0,r.MZ)({reflect:!0})],A.prototype,"type",void 0),(0,o.Cg)([(0,r.MZ)({type:String,reflect:!0,attribute:"width"})],A.prototype,"width",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],A.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"header-title"})],A.prototype,"headerTitle",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"header-subtitle"})],A.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"header-subtitle-position"})],A.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"allow-mode-change"})],A.prototype,"allowModeChange",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"without-header"})],A.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"hide-close-button"})],A.prototype,"hideCloseButton",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],A.prototype,"flexContent",void 0),(0,o.Cg)([(0,r.wk)()],A.prototype,"mode",void 0),(0,o.Cg)([(0,r.wk)(),(0,s.Fg)({context:d.D5,subscribe:!0})],A.prototype,"_i18n",void 0),A=(0,o.Cg)([(0,r.EM)("ha-adaptive-dialog")],A),a()}catch(m){a(m)}})},43661:function(t,e,i){i.r(e),i.d(e,{HaIconNext:function(){return r}});i(62953);var a=i(40445),o=i(67576),s=i(63091),n=i(67094);class r extends n.HaSvgIcon{constructor(...t){super(...t),this.path="rtl"===s.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,a.Cg)([(0,o.MZ)()],r.prototype,"path",void 0),r=(0,a.Cg)([(0,o.EM)("ha-icon-next")],r)},28732:function(t,e,i){var a=i(40445),o=i(27686),s=i(7731),n=i(5124),r=i(67576);let l,d,h,p=t=>t;class c extends o.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[s.R,(0,n.AH)(l||(l=p`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,n.AH)(d||(d=p`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,n.AH)(h||(h=p``))]}}c=(0,a.Cg)([(0,r.EM)("ha-list-item")],c)},67505:function(t,e,i){var a=i(40445),o=i(5124),s=i(67576),n=i(93421);i(67094);let r,l,d=t=>t;class h extends o.WF{render(){return this._localize?(0,o.qy)(r||(r=d` <ha-svg-icon .path="${0}"></ha-svg-icon> <span class="prefix">${0}</span> <span class="text"><slot></slot></span> `),"M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z",this._localize("ui.panel.config.tips.tip")):o.s6}}h.styles=(0,o.AH)(l||(l=d`:host{display:block;text-align:center}.text{direction:var(--direction);margin-left:2px;margin-inline-start:2px;margin-inline-end:initial;color:var(--secondary-text-color)}.prefix{font-weight:var(--ha-font-weight-medium)}`)),(0,a.Cg)([(0,s.wk)(),(0,n.IW)()],h.prototype,"_localize",void 0),h=(0,a.Cg)([(0,s.EM)("ha-tip")],h)},35891:function(t,e,i){i.d(e,{Bs:function(){return n},Jp:function(){return o},Tk:function(){return s},Xg:function(){return a},oz:function(){return l},x1:function(){return r}});i(74423);const a=(t,e)=>t.callWS({type:"blueprint/list",domain:e}),o=(t,e)=>t.callWS({type:"blueprint/import",url:e}),s=(t,e,i,a,o,s)=>t.callWS({type:"blueprint/save",domain:e,path:i,yaml:a,source_url:o,allow_override:s}),n=(t,e,i)=>t.callWS({type:"blueprint/delete",domain:e,path:i}),r=t=>{const e=t.metadata.source_url;return e?e.includes("github.com/home-assistant")?"homeassistant":"community":"local"},l=(t,e,i,a)=>t.callWS({type:"blueprint/substitute",domain:e,path:i,input:a})},59502:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(26910),i(18111),i(22489),i(61701),i(3362),i(9391),i(62953);var o=i(40445),s=i(78648),n=i(5124),r=i(67576),l=i(22786),d=i(1087),h=i(77090),p=i(52220),c=i(14693),u=(i(43661),i(8630),i(28732),i(65829)),m=(i(67505),i(36866)),g=i(88249),v=i(35891),y=i(84025),b=i(59653),_=i(53580),f=i(14503),C=i(36918),x=t([c,u,m]);[c,u,m]=x.then?(await x)():x;let $,w,M,L,H,A,B,S,k,Z=t=>t;const q="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",V="M14.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z",T="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",z={local:"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",community:"M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z",homeassistant:_.mdiHomeAssistant},I=[{name:"name",weight:10},{name:"description",weight:7},{name:"author",weight:5},{name:"sourceType",weight:3}];class W extends n.WF{showDialog(t){this._params=t,this._open=!0,this._mode=(null==t?void 0:t.mode)||"automation",this._filter="",this.blueprints=void 0,this._loadingBlueprints=!0,(0,v.Xg)(this.hass,this._mode).then(t=>{this.blueprints=t}).finally(()=>{this._loadingBlueprints=!1})}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this.blueprints=void 0,this._loadingBlueprints=!1,this._filter="",(0,d.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params)return n.s6;const t=this._processedBlueprints(this.blueprints),e=this._filteredBlueprints(t,this._filter);return(0,n.qy)($||($=Z` <ha-adaptive-dialog .open="${0}" flexcontent header-title="${0}" @closed="${0}"> <div class="content-wrapper"> ${0} <ha-list> <ha-list-item hasmeta twoline graphic="icon" @request-selected="${0}"> <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> ${0} <span slot="secondary"> ${0} </span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </ha-list> <div class="blueprints-container"> <div class="blueprints-list ha-scrollbar"> ${0} </div> </div> </div> </ha-adaptive-dialog> `),this._open,this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.header`),this._dialogClosed,t.length>5?(0,n.qy)(w||(w=Z`<ha-input-search appearance="outlined" autofocus .value="${0}" .placeholder="${0}" @input="${0}"></ha-input-search>`),this._filter,this.hass.localize("ui.common.search"),this._handleSearchChange):n.s6,this._blank,V,this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.create_empty`),this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.create_empty_description`),this._loadingBlueprints?(0,n.qy)(M||(M=Z`<div class="spinner"> <ha-spinner></ha-spinner> </div>`)):(0,n.qy)(L||(L=Z` <ha-list> ${0} </ha-list> ${0} ${0} `),e.map(t=>(0,n.qy)(H||(H=Z` <ha-list-item hasmeta twoline graphic="icon" @request-selected="${0}" .path="${0}"> <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> ${0} <span slot="secondary"> ${0} </span> <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> `),this._blueprint,t.path,z[t.sourceType],t.name,t.author?this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.blueprint_source.author`,{author:t.author}):this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.blueprint_source.${t.sourceType}`))),0===t.length?(0,n.qy)(A||(A=Z` <a href="${0}" target="_blank" rel="noreferrer noopener" class="item"> <ha-list-item hasmeta twoline graphic="icon"> <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> ${0} <span slot="secondary"> ${0} </span> <ha-svg-icon slot="meta" path="${0}"></ha-svg-icon> </ha-list-item> </a> `),(0,C.o)(this.hass,"/get-blueprints"),T,this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.create_blueprint`),this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.create_blueprint_description`),q):0===e.length?(0,n.qy)(B||(B=Z` <div class="empty-search"> ${0} </div> `),this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.no_blueprints_match_search`)):n.s6,t.length>0?(0,n.qy)(S||(S=Z` <ha-tip> <a href="${0}" target="_blank" rel="noreferrer noopener"> ${0} </a> </ha-tip> `),(0,C.o)(this.hass,"/get-blueprints"),this.hass.localize(`ui.panel.config.${this._mode}.dialog_new.discover_blueprint_tip`)):n.s6))}_handleSearchChange(t){var e;this._filter=null!==(e=t.target.value)&&void 0!==e?e:""}async _blueprint(t){if(!(0,h.s)(t))return;const e=t.currentTarget.path;"script"===this._mode?(0,y.AM)({use_blueprint:{path:e}}):(0,g.mX)({use_blueprint:{path:e}})}async _blank(t){(0,h.s)(t)&&("script"===this._mode?(0,y.AM)():(0,g.mX)())}static get styles(){return[f.RF,f.nA,(0,n.AH)(k||(k=Z`ha-adaptive-dialog{--dialog-content-padding:0;--ha-dialog-min-height:min( 720px, calc( 100dvh - max( var(--safe-area-inset-bottom), var(--ha-space-4) ) - max(var(--safe-area-inset-top), var(--ha-space-4)) ) );--ha-dialog-max-height:var(--ha-dialog-min-height)}:host{--ha-bottom-sheet-height:min(85vh, 85dvh);--ha-bottom-sheet-max-height:min(85vh, 85dvh)}@media all and (min-width:550px){ha-adaptive-dialog{--mdc-dialog-min-width:500px}}.content-wrapper{display:flex;flex-direction:column;min-height:0;height:100%}.blueprints-container{display:flex;flex-direction:column;flex:1;min-height:0;border-top:1px solid var(--divider-color)}ha-input-search{padding:0 var(--ha-space-3)}.blueprints-list{overflow-y:auto;min-height:0;padding-bottom:var(--ha-space-2)}.spinner{display:flex;justify-content:center;padding:var(--ha-space-8) 0}ha-icon-next{width:24px}ha-tip{margin:var(--ha-space-2) var(--ha-space-4)}.empty-search{color:var(--secondary-text-color);padding:var(--ha-space-4)}a.item{text-decoration:unset}`))]}constructor(...t){super(...t),this._open=!1,this._mode="automation",this._loadingBlueprints=!1,this._filter="",this._processedBlueprints=(0,l.A)(t=>{if(!t)return[];return Object.entries(t).filter(t=>!("error"in t[1])).map(([t,e])=>{const i=(0,v.x1)(e);return Object.assign(Object.assign({},e.metadata),{},{sourceType:i,path:t})}).sort((t,e)=>(0,p.xL)(t.name,e.name,this.hass.locale.language))}),this._blueprintFuseIndex=(0,l.A)(t=>s.A.createIndex(I,t)),this._filteredBlueprints=(0,l.A)((t,e)=>(0,b.C)(t,e,I,this._blueprintFuseIndex(t)))}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],W.prototype,"hass",void 0),(0,o.Cg)([(0,r.wk)()],W.prototype,"_open",void 0),(0,o.Cg)([(0,r.wk)()],W.prototype,"_params",void 0),(0,o.Cg)([(0,r.wk)()],W.prototype,"_mode",void 0),(0,o.Cg)([(0,r.wk)()],W.prototype,"blueprints",void 0),(0,o.Cg)([(0,r.wk)()],W.prototype,"_loadingBlueprints",void 0),(0,o.Cg)([(0,r.wk)()],W.prototype,"_filter",void 0),W=(0,o.Cg)([(0,r.EM)("ha-dialog-new-automation")],W),a()}catch($){a($)}})}}]);