iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
4 lines • 11.8 kB
JavaScript
export const __rspack_esm_id=31295;export const __rspack_esm_ids=[31295];export const __webpack_modules__={90248(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaIconButtonArrowPrev:()=>l});var o=i(62826),s=i(5124),n=i(22441),r=i(63091),h=i(26300),d=t([h]);h=(d.then?(await d)():d)[0];const c="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",p="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class l extends s.WF{render(){return s.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===r.G.document.dir?p:c}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],l.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)()],l.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)()],l.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],l.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],l.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],l.prototype,"download",void 0),(0,o.Cg)([(0,n.wk)()],l.prototype,"_icon",void 0),l=(0,o.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],l),a()}catch(t){a(t)}})},26300(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaIconButton:()=>c});var o=i(62826),s=i(5124),n=i(22441),r=i(63672),h=i(18350),d=(i(67094),t([h]));h=(d.then?(await d)():d)[0];class c extends s.WF{render(){return s.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,r.J)(this.label)}" title="${(0,r.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,r.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?s.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:s.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}c.shadowRootOptions={mode:"open",delegatesFocus:!0},c.styles=s.AH`: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} (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`,(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],c.prototype,"path",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],c.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],c.prototype,"ariaHasPopup",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],c.prototype,"hideTitle",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],c.prototype,"selected",void 0),(0,o.Cg)([(0,n.MZ)()],c.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],c.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],c.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],c.prototype,"download",void 0),c=(0,o.Cg)([(0,n.EM)("ha-icon-button")],c),a()}catch(t){a(t)}})},2054(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),o=i(5124),s=i(22441),n=i(1087),r=i(44249),h=i(26300),d=t([h]);h=(d.then?(await d)():d)[0];const c="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class p 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 o.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${c}" ="${this._toggleMenu}"></ha-icon-button> ${t?o.qy`<div class="dot"></div>`:""} `}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,i=t.has("narrow")?t.get("narrow"):this.narrow,a=!1===e?.kioskMode&&(i||"always_hidden"===e?.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}}p.styles=o.AH`: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})],p.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,s.wk)()],p.prototype,"_hasNotifications",void 0),(0,a.Cg)([(0,s.wk)()],p.prototype,"_show",void 0),p=(0,a.Cg)([(0,s.EM)("ha-menu-button")],p),e()}catch(t){e(t)}})},67094(t,e,i){i.r(e),i.d(e,{HaSvgIcon:()=>n});var a=i(62826),o=i(5124),s=i(22441);class n extends o.WF{render(){return o.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?o.JW`<path class="primary-path" d="${this.path}"></path>`:o.s6} ${this.secondaryPath?o.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:o.s6} </g> </svg>`}}n.styles=o.AH`: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)()],n.prototype,"path",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],n.prototype,"secondaryPath",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],n.prototype,"viewBox",void 0),n=(0,a.Cg)([(0,s.EM)("ha-svg-icon")],n)},44249(t,e,i){i.d(e,{V:()=>a});const a=(t,e)=>{const i=new o,a=t.subscribeMessage(t=>e(i.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{a.then(t=>t?.())}};class o{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},90322(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{ZHAAddGroupPage:()=>g});i(18111),i(61701);var o=i(62826),s=i(5124),n=i(22441),r=i(91926),h=i(18350),d=(i(76776),i(91485)),c=i(84621),p=i(81310),l=i(92834),u=t([h,d,p,l]);[h,d,p,l]=u.then?(await u)():u;class g 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 s.qy` <hass-subpage .hass="${this.hass}" .narrow="${this.narrow}" .header="${this.hass.localize("ui.panel.config.zha.groups.create_group")}" back-path="/config/zha/groups"> <div class="container"> <ha-card class="details-card"> <div class="card-header"> ${this.hass.localize("ui.panel.config.zha.groups.group_info")} </div> <div class="card-content"> <ha-input type="text" .value="${this._groupName}" ="${this._handleNameChange}" .placeholder="${this.hass.localize("ui.panel.config.zha.groups.group_name_placeholder")}"></ha-input> <ha-input type="number" .value="${this._groupId}" ="${this._handleGroupIdChange}" .placeholder="${this.hass.localize("ui.panel.config.zha.groups.group_id_placeholder")}"></ha-input> </div> </ha-card> <section> <h2> ${this.hass.localize("ui.panel.config.zha.groups.add_members")} </h2> <zha-device-endpoint-list scrollable show-device-link .deviceEndpoints="${this.deviceEndpoints}" .narrow="${this.narrow}" .emptyText="${this.hass.localize("ui.panel.config.zha.groups.no_devices_to_add")}" selectable -changed="${this._handleAddSelectionChanged}"> </zha-device-endpoint-list> <div class="buttons"> <ha-button .disabled="${!this._groupName||""===this._groupName||this._processingAdd}" ="${this._createGroup}" .loading="${this._processingAdd}"> ${this.hass.localize("ui.panel.config.zha.groups.create")}</ha-button> </div> </section> </div> </hass-subpage> `}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 e=t.split("_");return{ieee:e[0],endpoint_id:e[1]}}),e=this._groupId?parseInt(this._groupId,10):void 0,i=await(0,c.$)(this.hass,this._groupName,e,t);this._selectedDevicesToAdd=[],this._processingAdd=!1,this._groupName="",this._zhaDeviceEndpointList.clearSelection(),(0,r.oo)(`/config/zha/group/${i.group_id}`,{replace:!0})}_handleGroupIdChange(t){this._groupId=t.target.value}_handleNameChange(t){this._groupName=t.target.value||""}static get styles(){return[s.AH`.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} (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})],g.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"deviceEndpoints",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_processingAdd",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_groupName",void 0),(0,o.Cg)([(0,n.wk)()],g.prototype,"_groupId",void 0),(0,o.Cg)([(0,n.P)("zha-device-endpoint-list",!0)],g.prototype,"_zhaDeviceEndpointList",void 0),g=(0,o.Cg)([(0,n.EM)("zha-add-group-page")],g),a()}catch(t){a(t)}})}};