UNPKG

iobroker.lovelace

Version:

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

1 lines 6.71 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[64522],{26571:function(i,e,t){t.d(e,{Al:function(){return n},KY:function(){return o},PN:function(){return a},dG:function(){return l},jm:function(){return d},m7:function(){return v},sR:function(){return h},t1:function(){return c},t2:function(){return _},x:function(){return f},yu:function(){return u}});var s=t(95350);const o=["bluetooth","dhcp","discovery","esphome","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],n=66649!=t.j?["reauth"]:null,r={"HA-Frontend-Base":`${location.protocol}//${location.host}`},c=(i,e,t)=>i.callApi("POST","config/config_entries/flow",{handler:e,entry_id:t},r),a=(i,e)=>i.callApi("GET",`config/config_entries/flow/${e}`,void 0,r),d=(i,e,t)=>i.callApi("POST",`config/config_entries/flow/${e}`,t,r),l=(i,e,t)=>i.callWS({type:"config_entries/ignore_flow",flow_id:e,title:t}),h=(i,e)=>i.callApi("DELETE",`config/config_entries/flow/${e}`),u=(i,e)=>i.callApi("GET","config/config_entries/flow_handlers"+(e?`?type=${e}`:"")),_=i=>i.sendMessagePromise({type:"config_entries/flow/progress"}),f=(i,e)=>i.connection.subscribeMessage(i=>e(i),{type:"config_entries/flow/subscribe"}),v=(i,e)=>e.context.title_placeholders&&0!==Object.keys(e.context.title_placeholders).length?i(`component.${e.handler}.config.flow_title`,e.context.title_placeholders)||("name"in e.context.title_placeholders?e.context.title_placeholders.name:(0,s.p$)(i,e.handler)):(0,s.p$)(i,e.handler)},54706:function(i,e,t){t.d(e,{E:function(){return n}});t(74423),t(18111),t(13579),t(3362),t(62953);var s=t(40445),o=t(67576);const n=i=>{class e extends i{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const i=this.__unsubs.pop();i instanceof Promise?i.then(i=>i()):i()}this.__unsubs=void 0}}updated(i){if(super.updated(i),i.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of i.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var i;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(i=this.hassSubscribeRequiredHostProps)&&void 0!==i&&i.some(i=>void 0===this[i])||(this.__unsubs=this.hassSubscribe())}}return(0,s.Cg)([(0,o.MZ)({attribute:!1})],e.prototype,"hass",void 0),e}},76559:function(i,e,t){t.d(e,{X:function(){return o},n:function(){return n}});t(3362),t(62953);var s=t(1087);const o=(i,e)=>{(0,s.r)(i,"show-dialog",{dialogTag:"dialog-add-integration",dialogImport:()=>Promise.all([t.e(92769),t.e(50672)]).then(t.bind(t,60051)),dialogParams:e})},n=(i,e)=>{(0,s.r)(i,"show-dialog",{dialogTag:"dialog-yaml-integration",dialogImport:()=>t.e(24096).then(t.bind(t,95683)),dialogParams:e})}},38865:function(i,e,t){t.r(e),t.d(e,{HuiDiscoveredDevicesCard:function(){return g}});t(49255),t(74423),t(44114),t(18111),t(22489),t(7588),t(3362),t(62953);var s=t(40445),o=t(5124),n=t(67576),r=t(1087),c=(t(76776),t(22573),t(80933),t(32248),t(26571)),a=t(54706),d=t(76559),l=t(22064),h=t(97176),u=t(51989);let _,f,v=i=>i;class g extends((0,a.E)(o.WF)){hassSubscribe(){var i;return null!==(i=this.hass.user)&&void 0!==i&&i.is_admin?[(0,c.x)(this.hass,i=>{if(0===i.length)return void(this._discoveredFlows=[]);let e=!1;const t=[];if(i.forEach(i=>{if("removed"===i.type){const e=Array.isArray(this._discoveredFlows)?this._discoveredFlows:[];return void(this._discoveredFlows=e.filter(e=>e.flow_id!==i.flow_id))}null!==i.type&&"added"!==i.type||(null===i.type&&(e=!0),c.KY.includes(i.flow.context.source)&&t.push(i.flow))}),!t.length&&!e)return;const s=e||!Array.isArray(this._discoveredFlows)?[]:this._discoveredFlows;this._discoveredFlows=[...s,...t]})]:(this._discoveredFlows=[],[])}setConfig(i){this._config=i}getCardSize(){var i;return null!==(i=this._config)&&void 0!==i&&i.vertical?2:1}getGridOptions(){var i;let e=6,t=1;return null!==(i=this._config)&&void 0!==i&&i.vertical&&(t++,e=3),{columns:6,rows:t,min_columns:e,min_rows:t}}async _handleAction(i){var e;if("tap"===i.detail.action&&!(0,h.h)(null===(e=this._config)||void 0===e?void 0:e.tap_action))return await this.hass.loadFragmentTranslation("config"),void(0,d.X)(this,{brand:"_discovered"});(0,l.$)(this,this.hass,this._config,i.detail.action)}get _hasCardAction(){var i,e,t,s;return!(null!==(i=this._config)&&void 0!==i&&i.tap_action)||(0,h.h)(null===(e=this._config)||void 0===e?void 0:e.tap_action)||(0,h.h)(null===(t=this._config)||void 0===t?void 0:t.hold_action)||(0,h.h)(null===(s=this._config)||void 0===s?void 0:s.double_tap_action)}willUpdate(i){var e;if(super.willUpdate(i),!this._config||!this.hass)return;const t=Boolean(!(null!==(e=this.hass.user)&&void 0!==e&&e.is_admin)||this._config.hide_empty&&this._discoveredFlows&&0===this._discoveredFlows.length);t!==this.hidden&&(this.style.display=t?"none":"",this.toggleAttribute("hidden",t),(0,r.r)(this,"card-visibility-changed",{value:!t}))}render(){if(!this._config||!this.hass||this.hidden)return o.s6;const i=Array.isArray(this._discoveredFlows)?this._discoveredFlows.length:0,e=this.hass.localize("ui.card.discovered-devices.title"),t=i>0?this.hass.localize("ui.card.discovered-devices.count_devices",{count:i}):this.hass.localize("ui.card.discovered-devices.no_devices"),s=!this._discoveredFlows;return(0,o.qy)(_||(_=v` <ha-card> <ha-tile-container .vertical="${0}" .interactive="${0}" .actionHandlerOptions="${0}" @action="${0}"> <ha-tile-icon slot="icon" .iconPath="${0}"></ha-tile-icon> <ha-tile-info slot="info" .primary="${0}" .secondary="${0}" .secondaryLoading="${0}"></ha-tile-info> </ha-tile-container> </ha-card> `),Boolean(this._config.vertical),this._hasCardAction,{hasHold:(0,h.h)(this._config.hold_action),hasDoubleClick:(0,h.h)(this._config.double_tap_action)},this._handleAction,"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",e,t,s)}constructor(...i){super(...i),this.connectedWhileHidden=!0}}g.styles=[u.c,(0,o.AH)(f||(f=v`:host{--tile-color:var(--info-color)}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,s.Cg)([(0,n.wk)()],g.prototype,"_config",void 0),(0,s.Cg)([(0,n.wk)()],g.prototype,"_discoveredFlows",void 0),g=(0,s.Cg)([(0,n.EM)("hui-discovered-devices-card")],g)}}]);