UNPKG

iobroker.lovelace

Version:

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

4 lines 12.4 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[31295],{90248:function(t,i,e){e.a(t,async function(t,a){try{e.r(i),e.d(i,{HaIconButtonArrowPrev:function(){return g}});e(62953);var o=e(40445),s=e(5124),n=e(67576),r=e(63091),h=e(26300),d=t([h]);h=(d.then?(await d)():d)[0];let c,p=t=>t;const l="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",u="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class g extends s.WF{render(){var t;return(0,s.qy)(c||(c=p` <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===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===r.G.document.dir?u:l}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)()],g.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)()],g.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],g.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],g.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],g.prototype,"download",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_icon",void 0),g=(0,o.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],g),a()}catch(c){a(c)}})},26300:function(t,i,e){e.a(t,async function(t,a){try{e.r(i),e.d(i,{HaIconButton:function(){return v}});e(62953);var o=e(40445),s=e(5124),n=e(67576),r=e(63672),h=e(18350),d=(e(67094),t([h]));h=(d.then?(await d)():d)[0];let c,p,l,u,g=t=>t;class v extends s.WF{render(){return(0,s.qy)(c||(c=g` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,r.J)(this.label),(0,r.J)(this.hideTitle?void 0:this.label),(0,r.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,s.qy)(p||(p=g`<ha-svg-icon aria-hidden="true" .path="${0}"></ha-svg-icon>`),this.path):(0,s.qy)(l||(l=g`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}v.shadowRootOptions={mode:"open",delegatesFocus:!0},v.styles=(0,s.AH)(u||(u=g`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var( --ha-icon-button-padding-inline, --ha-space-2 );--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],v.prototype,"path",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],v.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],v.prototype,"ariaHasPopup",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],v.prototype,"hideTitle",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"selected",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"download",void 0),v=(0,o.Cg)([(0,n.EM)("ha-icon-button")],v),a()}catch(c){a(c)}})},2054:function(t,i,e){e.a(t,async function(t,i){try{e(16280),e(62953);var a=e(40445),o=e(5124),s=e(67576),n=e(1087),r=e(44249),h=e(26300),d=t([h]);h=(d.then?(await d)():d)[0];let c,p,l,u=t=>t;const g="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class v extends o.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return o.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,o.qy)(c||(c=u` <ha-icon-button .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),g,this._toggleMenu,t?(0,o.qy)(p||(p=u`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const i=t.has("hass")?t.get("hass"):this.hass,e=t.has("narrow")?t.get("narrow"):this.narrow,a=!1===(null==i?void 0:i.kioskMode)&&(e||"always_hidden"===(null==i?void 0:i.dockedSidebar)),o=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&a===o||(this._show=o||this._alwaysVisible,o?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,r.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}v.styles=(0,o.AH)(l||(l=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,a.Cg)([(0,s.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,a.Cg)([(0,s.wk)()],v.prototype,"_hasNotifications",void 0),(0,a.Cg)([(0,s.wk)()],v.prototype,"_show",void 0),v=(0,a.Cg)([(0,s.EM)("ha-menu-button")],v),i()}catch(c){i(c)}})},67094:function(t,i,e){e.r(i),e.d(i,{HaSvgIcon:function(){return p}});var a=e(40445),o=e(5124),s=e(67576);let n,r,h,d,c=t=>t;class p extends o.WF{render(){return(0,o.JW)(n||(n=c` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,o.JW)(r||(r=c`<path class="primary-path" d="${0}"></path>`),this.path):o.s6,this.secondaryPath?(0,o.JW)(h||(h=c`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):o.s6)}}p.styles=(0,o.AH)(d||(d=c`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`)),(0,a.Cg)([(0,s.MZ)()],p.prototype,"path",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],p.prototype,"secondaryPath",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],p.prototype,"viewBox",void 0),p=(0,a.Cg)([(0,s.EM)("ha-svg-icon")],p)},44249:function(t,i,e){e.d(i,{V:function(){return a}});e(62953);const a=(t,i)=>{const e=new o,a=t.subscribeMessage(t=>i(e.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{a.then(t=>null==t?void 0:t())}};class o{processMessage(t){if("removed"===t.type)for(const i of Object.keys(t.notifications))delete this.notifications[i];else this.notifications=Object.assign(Object.assign({},this.notifications),t.notifications);return Object.values(this.notifications)}constructor(){this.notifications={}}}},90322:function(t,i,e){e.a(t,async function(t,a){try{e.r(i),e.d(i,{ZHAAddGroupPage:function(){return f}});e(18111),e(61701),e(3362),e(62953);var o=e(40445),s=e(5124),n=e(67576),r=e(91926),h=e(18350),d=(e(76776),e(91485)),c=e(84621),p=e(81310),l=e(92834),u=t([h,d,p,l]);[h,d,p,l]=u.then?(await u)():u;let g,v,b=t=>t;class f extends s.WF{connectedCallback(){super.connectedCallback(),this.hass&&this._firstUpdatedCalled&&this._fetchData()}firstUpdated(t){super.firstUpdated(t),this.hass&&this._fetchData(),this._firstUpdatedCalled=!0}render(){return(0,s.qy)(g||(g=b` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}" back-path="/config/zha/groups"> <div class="container"> <ha-card class="details-card"> <div class="card-header"> ${0} </div> <div class="card-content"> <ha-input type="text" .value="${0}" @change="${0}" .placeholder="${0}"></ha-input> <ha-input type="number" .value="${0}" @change="${0}" .placeholder="${0}"></ha-input> </div> </ha-card> <section> <h2> ${0} </h2> <zha-device-endpoint-list scrollable show-device-link .deviceEndpoints="${0}" .narrow="${0}" .emptyText="${0}" selectable @selection-changed="${0}"> </zha-device-endpoint-list> <div class="buttons"> <ha-button .disabled="${0}" @click="${0}" .loading="${0}"> ${0}</ha-button> </div> </section> </div> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.zha.groups.create_group"),this.hass.localize("ui.panel.config.zha.groups.group_info"),this._groupName,this._handleNameChange,this.hass.localize("ui.panel.config.zha.groups.group_name_placeholder"),this._groupId,this._handleGroupIdChange,this.hass.localize("ui.panel.config.zha.groups.group_id_placeholder"),this.hass.localize("ui.panel.config.zha.groups.add_members"),this.deviceEndpoints,this.narrow,this.hass.localize("ui.panel.config.zha.groups.no_devices_to_add"),this._handleAddSelectionChanged,!this._groupName||""===this._groupName||this._processingAdd,this._createGroup,this._processingAdd,this.hass.localize("ui.panel.config.zha.groups.create"))}async _fetchData(){this.deviceEndpoints=await(0,c.zt)(this.hass)}_handleAddSelectionChanged(t){this._selectedDevicesToAdd=t.detail.value}async _createGroup(){this._processingAdd=!0;const t=this._selectedDevicesToAdd.map(t=>{const i=t.split("_");return{ieee:i[0],endpoint_id:i[1]}}),i=this._groupId?parseInt(this._groupId,10):void 0,e=await(0,c.$)(this.hass,this._groupName,i,t);this._selectedDevicesToAdd=[],this._processingAdd=!1,this._groupName="",this._zhaDeviceEndpointList.clearSelection(),(0,r.oo)(`/config/zha/group/${e.group_id}`,{replace:!0})}_handleGroupIdChange(t){this._groupId=t.target.value}_handleNameChange(t){this._groupName=t.target.value||""}static get styles(){return[(0,s.AH)(v||(v=b`.container{box-sizing:border-box;max-width:720px;margin:0 auto;padding:var(--ha-space-4) var(--ha-space-4) calc(var(--ha-space-20) + var(--safe-area-inset-bottom,0px))}.card-header{padding:var(--ha-space-4) var(--ha-space-4) 0;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-condensed)}.card-content{display:grid;gap:var(--ha-space-4);padding:var(--ha-space-4)}section{margin-top:var(--ha-space-8)}h2{margin:0 0 var(--ha-space-3);font-family:var(--ha-font-family-body);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-condensed)}zha-device-endpoint-list{display:block;min-width:0}.buttons{display:flex;justify-content:flex-end;padding:var(--ha-space-4) 0 0}@media (max-width:600px){.container{padding-inline:var(--ha-space-2)}}`))]}constructor(...t){super(...t),this.narrow=!1,this.deviceEndpoints=[],this._processingAdd=!1,this._groupName="",this._firstUpdatedCalled=!1,this._selectedDevicesToAdd=[]}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],f.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"deviceEndpoints",void 0),(0,o.Cg)([(0,n.wk)()],f.prototype,"_processingAdd",void 0),(0,o.Cg)([(0,n.wk)()],f.prototype,"_groupName",void 0),(0,o.Cg)([(0,n.wk)()],f.prototype,"_groupId",void 0),(0,o.Cg)([(0,n.P)("zha-device-endpoint-list",!0)],f.prototype,"_zhaDeviceEndpointList",void 0),f=(0,o.Cg)([(0,n.EM)("zha-add-group-page")],f),a()}catch(g){a(g)}})}}]);