iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 3.87 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[50777],{27722:function(t,e,a){a.d(e,{d:function(){return o}});var i=a(28978);function n(t,e,a,i){if(!a||!a.action||"none"===a.action)return"";let n=i?t.localize("ui.panel.lovelace.cards.picture-elements.hold"):t.localize("ui.panel.lovelace.cards.picture-elements.tap");switch(a.action){case"navigate":n+=` ${t.localize("ui.panel.lovelace.cards.picture-elements.navigate_to",{location:a.navigation_path})}`;break;case"url":n+=` ${t.localize("ui.panel.lovelace.cards.picture-elements.url",{url_path:a.url_path})}`;break;case"toggle":n+=` ${t.localize("ui.panel.lovelace.cards.picture-elements.toggle",{name:e})}`;break;case"call-service":n+=`${t.localize("ui.panel.lovelace.cards.picture-elements.perform_action",{name:a.service})}`;break;case"more-info":n+=`${t.localize("ui.panel.lovelace.cards.picture-elements.more_info",{name:e})}`}return n}const o=(t,e)=>{if(null===e.title)return"";if(e.title)return e.title;let a="";if(e.entity&&(a=e.entity in t.states?(0,i.u)(t.states[e.entity]):e.entity),!e.tap_action&&!e.hold_action)return a;const o=e.tap_action?n(t,a,e.tap_action,!1):"",s=e.hold_action?n(t,a,e.hold_action,!0):"";return o+(o&&s?"\n":"")+s}},96314:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(61701);var i=a(40445),n=a(5124),o=a(67576),s=a(28978),c=a(74281),l=a(27722),r=a(19037),h=a(22064),u=a(97176),d=(a(34296),a(5745),a(14503)),p=t([c]);c=(p.then?(await p)():p)[0];let g,f,m,b,_=t=>t;class v extends n.WF{render(){return(0,n.qy)(g||(g=_` <ha-chip-set class="ha-scrollbar"> ${0} </ha-chip-set> `),(this.configEntities||[]).map(t=>{const e=this.hass.states[t.entity],a=t.show_name&&e||t.name&&!1!==t.show_name?t.name||(0,s.u)(e):"";return(0,n.qy)(f||(f=_` <ha-assist-chip filled @action="${0}" .actionHandler="${0}" .config="${0}" tabindex="0" .label="${0}"> ${0} </ha-assist-chip> `),this._handleAction,(0,r.T)({hasHold:(0,u.h)(t.hold_action),hasDoubleClick:(0,u.h)(t.double_tap_action)}),t,a,!1!==t.show_icon?(0,n.qy)(m||(m=_` <state-badge title="${0}" .hass="${0}" .stateObj="${0}" .overrideIcon="${0}" .overrideImage="${0}" .stateColor="${0}" slot="icon"></state-badge> `),(0,l.d)(this.hass,t),this.hass,e,t.icon,t.image,!0):"")}))}_handleAction(t){(0,h.$)(this,this.hass,t.currentTarget.config,t.detail.action)}static get styles(){return[d.dp,(0,n.AH)(b||(b=_`.ha-scrollbar{padding:12px;padding-top:var(--padding-top,8px);padding-bottom:var(--padding-bottom,8px);width:100%;overflow-x:auto;overflow-y:hidden;white-space:nowrap;box-sizing:border-box;display:flex;flex-wrap:wrap}state-badge{display:inline-flex;line-height:inherit;color:var(--secondary-text-color);align-items:center;justify-content:center}@media all and (max-width:450px),all and (max-height:500px){.ha-scrollbar{flex-wrap:nowrap}}`))]}}(0,i.Cg)([(0,o.wk)()],v.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"configEntities",void 0),v=(0,i.Cg)([(0,o.EM)("hui-buttons-base")],v),e()}catch(g){e(g)}})},65728:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HuiButtonsRow:function(){return g}});a(18111),a(61701);var n=a(40445),o=a(5124),s=a(67576),c=a(46190),l=a(71727),r=a(20939),h=a(96314),u=t([h]);h=(u.then?(await u)():u)[0];let d,p=t=>t;class g extends o.WF{static getStubConfig(){return{entities:[]}}setConfig(t){this._configEntities=(0,r.L)(t.entities).map(t=>Object.assign({tap_action:{action:t.entity&&c.FD.has((0,l.m)(t.entity))?"toggle":"more-info"},hold_action:{action:"more-info"}},t))}render(){return(0,o.qy)(d||(d=p` <hui-buttons-base .hass="${0}" .configEntities="${0}"></hui-buttons-base> `),this.hass,this._configEntities)}}(0,n.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,n.Cg)([(0,s.wk)()],g.prototype,"_configEntities",void 0),g=(0,n.Cg)([(0,s.EM)("hui-buttons-row")],g),i()}catch(d){i(d)}})}}]);