UNPKG

iobroker.lovelace

Version:

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

1 lines 16 kB
export const __rspack_esm_id=61149;export const __rspack_esm_ids=[61149];export const __webpack_modules__={4423(e,t,n){n.d(t,{B:()=>d,r:()=>a});n(44114),n(18111),n(13579),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var i=n(44537),r=n(71727),o=n(28455);const s=e=>{if(void 0!==e)return null===e?new Set([null]):new Set((0,i.e)(e))},a=(e,t)=>{const n=t.domain?new Set((0,i.e)(t.domain)):void 0,a=t.hidden_domains?new Set((0,i.e)(t.hidden_domains)):void 0,d=t.device_class?new Set((0,i.e)(t.device_class)):void 0,l=s(t.floor),c=s(t.area),h=s(t.device),u=t.entity_category?new Set((0,i.e)(t.entity_category)):void 0,m=t.label?new Set((0,i.e)(t.label)):void 0,g=t.hidden_platform?new Set((0,i.e)(t.hidden_platform)):void 0;return t=>{const i=e.states[t];if(!i)return!1;if(n||a){const e=(0,r.m)(t);if(n&&!n.has(e))return!1;if(a&&a.has(e))return!1}if(d){const e=i.attributes.device_class||"none";if(!d.has(e))return!1}const{area:s,floor:b,device:p,entity:y}=(0,o.ln)(i,e.entities,e.devices,e.areas,e.floors);if(y&&y.hidden)return!1;if(l){const e=b?.floor_id??null;if(!l.has(e))return!1}if(c){const e=s?.area_id??null;if(!c.has(e))return!1}if(h){const e=p?.id??null;if(!h.has(e))return!1}if(m){if(!y)return!1;if(!y.labels.some(e=>m.has(e)))return!1}if(u){const e=y?.entity_category||"none";if(!u.has(e))return!1}if(g){if(!y)return!1;if(y.platform&&g.has(y.platform))return!1}return!0}},d=(e,t)=>{const n=new Set,i=[];for(const r of t)for(const t of e)r(t)&&!n.has(t)&&(n.add(t),i.push(t));return i}},38395(e,t,n){n.d(t,{gh:()=>d,kU:()=>l,q:()=>a});var i=n(35518),r=n(62384),o=n(61557);function s(e){return document.cookie=`ingress_session=${e};path=/api/hassio_ingress/;SameSite=Strict${"https:"===location.protocol?";Secure":""}`,e}const a=async e=>{if((0,r.v)(e.config.version,2021,2,4)){return s((await e.callWS({type:"supervisor/api",endpoint:"/ingress/session",method:"post"})).session)}return s((await e.callApi("POST","hassio/ingress/session")).data.session)},d=e=>(0,i.X)(e,"_ingressPanelInfo",async e=>(await(0,o.uw)(e,{endpoint:"/ingress/panels"})).panels),l=async(e,t)=>{(0,r.v)(e.config.version,2021,2,4)?await e.callWS({type:"supervisor/api",endpoint:"/ingress/validate_session",method:"post",data:{session:t}}):await e.callApi("POST","hassio/ingress/validate_session",{session:t})}},28669(e,t,n){n.d(t,{TK:()=>a,_2:()=>l,eR:()=>r,hG:()=>d,hU:()=>o,kg:()=>s,wj:()=>i,xg:()=>c});n(44114),n(18111),n(61701);const i="system-admin",r="system-users",o=async e=>e.callWS({type:"config/auth/list"}),s=async(e,t,n,i)=>e.callWS({type:"config/auth/create",name:t,group_ids:n,local_only:i}),a=async(e,t,n)=>e.callWS({...n,type:"config/auth/update",user_id:t}),d=async(e,t)=>e.callWS({type:"config/auth/delete",user_id:t}),l=e=>e?e.trim().split(" ").slice(0,3).map(e=>e.substring(0,1)).join(""):"?",c=(e,t,n)=>{const i=[],r=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&i.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",r("is_owner")]),n&&t.system_generated&&i.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",r("is_system")]),t.local_only&&i.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",r("is_local")]),t.is_active||i.push(["M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",r("is_not_active")]),i}},8349(e,t,n){n.a(e,async function(e,i){try{n.d(t,{MJ:()=>w,dY:()=>P,te:()=>_});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var r=n(85240),o=n(97735),s=n(40205),a=n(45309),d=n(5253),l=n(63577),c=n(17747),h=n(203),u=n(68102),m=n(81643),g=n(89969),b=n(75201),p=n(34128),y=e([r,o,s,a,d,l,c,h,u,m,g,b]);[r,o,s,a,d,l,c,h,u,m,g,b]=y.then?(await y)():y;const f=new Set(["entity","entities","button","entity-button","glance","grid","section","light","sensor","thermostat","weather-forecast","tile","heading"]),v={"alarm-panel":()=>n.e(73842).then(n.bind(n,84329)),area:()=>n.e(50235).then(n.bind(n,17366)),calendar:()=>Promise.all([n.e(79996),n.e(10147),n.e(82752),n.e(83312),n.e(5012)]).then(n.bind(n,68159)),conditional:()=>n.e(77388).then(n.bind(n,51527)),"empty-state":()=>n.e(48285).then(n.bind(n,90476)),"energy-compare":()=>Promise.all([n.e(92610),n.e(77183),n.e(73618)]).then(n.bind(n,62284)),"energy-carbon-consumed-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(77735)]).then(n.bind(n,57545)),"energy-date-selection":()=>Promise.all([n.e(92610),n.e(80827),n.e(16704),n.e(77183),n.e(7256),n.e(71483)]).then(n.bind(n,56342)),"energy-devices-graph":()=>Promise.all([n.e(92610),n.e(37552),n.e(1872),n.e(5520),n.e(77183),n.e(19260),n.e(24404)]).then(n.bind(n,78231)),"energy-devices-detail-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(39565)]).then(n.bind(n,71209)),"energy-distribution":()=>Promise.all([n.e(92610),n.e(77183),n.e(46239)]).then(n.bind(n,30961)),"energy-gas-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(43881)]).then(n.bind(n,99389)),"energy-water-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(6171)]).then(n.bind(n,62743)),"energy-grid-neutrality-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(32527)]).then(n.bind(n,80449)),"energy-grid-balance":()=>Promise.all([n.e(92610),n.e(77183),n.e(75246)]).then(n.bind(n,76331)),"energy-solar-consumed-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(22629)]).then(n.bind(n,89979)),"energy-self-sufficiency-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(35546)]).then(n.bind(n,48196)),"energy-solar-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(76285)]).then(n.bind(n,32185)),"energy-sources-table":()=>Promise.all([n.e(92610),n.e(77183),n.e(97870)]).then(n.bind(n,24408)),"energy-usage-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(93507)]).then(n.bind(n,14207)),"energy-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(58597)]).then(n.bind(n,31396)),"water-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(85069)]).then(n.bind(n,41436)),"water-flow-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(37248)]).then(n.bind(n,34499)),"power-sources-graph":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(1872),n.e(9970),n.e(24060),n.e(77183),n.e(19260),n.e(24301),n.e(66471)]).then(n.bind(n,40235)),"power-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(67518)]).then(n.bind(n,59277)),"entity-filter":()=>n.e(99104).then(n.bind(n,6275)),error:()=>Promise.resolve().then(n.bind(n,4397)),"home-summary":()=>Promise.all([n.e(92610),n.e(77183),n.e(3650),n.e(18673)]).then(n.bind(n,51687)),shortcut:()=>n.e(73044).then(n.bind(n,30175)),"discovered-devices":()=>n.e(64522).then(n.bind(n,38865)),repairs:()=>n.e(31854).then(n.bind(n,84029)),updates:()=>n.e(8550).then(n.bind(n,71154)),gauge:()=>n.e(21727).then(n.bind(n,91874)),"history-graph":()=>Promise.all([n.e(37552),n.e(77072),n.e(53771),n.e(1872),n.e(9970),n.e(24060),n.e(19260),n.e(46866),n.e(83779)]).then(n.bind(n,41544)),"horizontal-stack":()=>n.e(175).then(n.bind(n,63218)),distribution:()=>n.e(19472).then(n.bind(n,62707)),humidifier:()=>n.e(38861).then(n.bind(n,86145)),iframe:()=>n.e(44722).then(n.bind(n,56393)),logbook:()=>Promise.all([n.e(82333),n.e(23954)]).then(n.bind(n,42526)),map:()=>Promise.all([n.e(87451),n.e(12122),n.e(21742)]).then(n.bind(n,22845)),markdown:()=>n.e(44619).then(n.bind(n,67334)),clock:()=>n.e(11546).then(n.bind(n,56833)),"media-control":()=>Promise.all([n.e(87941),n.e(37136)]).then(n.bind(n,92723)),"picture-elements":()=>Promise.all([n.e(99143),n.e(66990),n.e(37848)]).then(n.bind(n,63933)),"picture-entity":()=>Promise.all([n.e(99143),n.e(48412)]).then(n.bind(n,86063)),"picture-glance":()=>Promise.all([n.e(99143),n.e(37855)]).then(n.bind(n,78602)),picture:()=>n.e(85030).then(n.bind(n,30789)),"plant-status":()=>n.e(97524).then(n.bind(n,89759)),"recovery-mode":()=>Promise.all([n.e(86269),n.e(20295)]).then(n.bind(n,93132)),"toggle-group":()=>n.e(87764).then(n.bind(n,5023)),"todo-list":()=>n.e(31355).then(n.bind(n,62134)),"shopping-list":()=>Promise.all([n.e(31355),n.e(89235)]).then(n.bind(n,36606)),starting:()=>n.e(31946).then(n.bind(n,88785)),"statistics-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(24301),n.e(42568)]).then(n.bind(n,3515)),statistic:()=>Promise.all([n.e(92610),n.e(77183),n.e(69315)]).then(n.bind(n,89029)),"vertical-stack":()=>n.e(55989).then(n.bind(n,33204))},w=e=>(0,p.Vd)("card",e,f,v,void 0,void 0),_=e=>(0,p.Ue)("card",e,f,v,void 0,void 0),P=e=>(0,p.gh)(e,"card",f,v);i()}catch(e){i(e)}})},34128(e,t,n){n.d(t,{G9:()=>s,Ni:()=>o,Ue:()=>c,Vd:()=>h,gh:()=>u});n(74423);var i=n(1087),r=n(45291);const o=e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.resolve().then(n.bind(n,4397)),customElements.whenDefined("hui-error-card").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t},s=(e,t)=>({type:"error",error:e,origConfig:t}),a=(e,t)=>{const n=document.createElement(e);return n.setConfig(t),n},d=(e,t,i)=>"badge"===e?(e=>{const t=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?t.setConfig(e):(Promise.all([n.e(92769),n.e(3283),n.e(72130),n.e(85010),n.e(67218),n.e(58416),n.e(99788),n.e(22398),n.e(82134),n.e(26092),n.e(34310),n.e(59704),n.e(25322),n.e(90790),n.e(89747),n.e(59532),n.e(36332),n.e(77563),n.e(15862),n.e(99143),n.e(41344),n.e(12009),n.e(66990),n.e(3025),n.e(38108),n.e(66006),n.e(38260)]).then(n.bind(n,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(s(t,i)):"heading-badge"===e?(e=>{const t=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?t.setConfig(e):(Promise.all([n.e(92769),n.e(3283),n.e(72130),n.e(85010),n.e(67218),n.e(58416),n.e(99788),n.e(22398),n.e(82134),n.e(26092),n.e(34310),n.e(59704),n.e(25322),n.e(90790),n.e(89747),n.e(59532),n.e(36332),n.e(77563),n.e(15862),n.e(99143),n.e(41344),n.e(12009),n.e(66990),n.e(3025),n.e(38108),n.e(66006),n.e(21614)]).then(n.bind(n,13469)),customElements.whenDefined("hui-error-heading-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(((e,t)=>({type:"error",error:e,origConfig:t}))(t,i)):o({type:"error",message:t}),l=e=>(0,r.c8)(e)?(0,r.Iu)(e):void 0,c=(e,t,n,i,r,o)=>{try{return h(e,t,n,i,r,o)}catch(n){return console.error(e,t.type,n),d(e,n.message,t)}},h=(e,t,n,r,o,s)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||s||o&&"entity"in t))throw new Error("No card type configured");const c=t.type?l(t.type):void 0;if(c)return((e,t,n)=>{if(customElements.get(t))return a(t,n);const r=d(e,`Custom element doesn't exist: ${t}.`,n);if(!t.includes("-"))return r;r.style.display="None";const o=window.setTimeout(()=>{r.style.display=""},2e3);return customElements.whenDefined(t).then(()=>{clearTimeout(o),(0,i.r)(r,"ll-rebuild")}),r})(e,c,t);let h;if(o&&!t.type&&t.entity){h=`${o[t.entity.split(".",1)[0]]||o._domain_not_found}-entity`}else h=t.type||s;if(void 0===h)throw new Error("No type specified");const u=`hui-${h}-${e}`;if(r&&h in r)return r[h](),((e,t)=>{if(customElements.get(e))return a(e,t);const n=document.createElement(e);return customElements.whenDefined(e).then(()=>{try{customElements.upgrade(n),(0,i.r)(n,"ll-upgrade"),n.setConfig(t)}catch(e){(0,i.r)(n,"ll-rebuild")}}),n})(u,t);if(n&&n.has(h))return a(u,t);throw new Error(`Unknown type encountered: ${h}`)},u=async(e,t,n,i)=>{const r=l(e);if(r){const e=customElements.get(r);if(e)return e;if(!r.includes("-"))throw new Error(`Custom element not found: ${r}`);return new Promise((e,t)=>{setTimeout(()=>t(new Error(`Custom element not found: ${r}`)),2e3),customElements.whenDefined(r).then(()=>e(customElements.get(r)))})}const o=`hui-${e}-${t}`,s=customElements.get(o);if(n&&n.has(e))return s;if(i&&e in i)return s||i[e]().then(()=>customElements.get(o));throw new Error(`Unknown type: ${e}`)}},83938(e,t,n){n.d(t,{l:()=>s,x:()=>o});var i=n(34128);const r={picture:()=>n.e(17813).then(n.bind(n,97588)),buttons:()=>n.e(16700).then(n.bind(n,72791)),graph:()=>n.e(33427).then(n.bind(n,67806))},o=e=>(0,i.Ue)("header-footer",e,void 0,r,void 0,void 0),s=e=>(0,i.gh)(e,"header-footer",void 0,r)},94225(e,t,n){n.a(e,async function(e,i){try{n.d(t,{T:()=>v,t:()=>w});n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698);var r=n(99799),o=n(29003),s=n(92055),a=n(19396),d=n(74323),l=n(51199),c=n(43721),h=n(65509),u=n(21659),m=n(82525),g=n(34128),b=e([r,o,s,a,d,l,c,h,u,m]);[r,o,s,a,d,l,c,h,u,m]=b.then?(await b)():b;const p=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),y={"button-entity":()=>n.e(26846).then(n.bind(n,21869)),"climate-entity":()=>n.e(56995).then(n.bind(n,2798)),"cover-entity":()=>n.e(41243).then(n.bind(n,79734)),"date-entity":()=>n.e(17418).then(n.bind(n,75473)),"datetime-entity":()=>Promise.all([n.e(99194),n.e(81767)]).then(n.bind(n,69690)),"event-entity":()=>Promise.resolve().then(n.bind(n,99799)),"group-entity":()=>n.e(68827).then(n.bind(n,53110)),"input-button-entity":()=>n.e(19825).then(n.bind(n,46472)),"humidifier-entity":()=>n.e(378).then(n.bind(n,53537)),"input-datetime-entity":()=>n.e(71748).then(n.bind(n,1391)),"input-number-entity":()=>n.e(17600).then(n.bind(n,58723)),"input-select-entity":()=>n.e(44325).then(n.bind(n,54596)),"input-text-entity":()=>n.e(8086).then(n.bind(n,51765)),"lock-entity":()=>n.e(28245).then(n.bind(n,49748)),"number-entity":()=>n.e(71523).then(n.bind(n,57198)),"select-entity":()=>n.e(9374).then(n.bind(n,78157)),"text-entity":()=>n.e(67973).then(n.bind(n,58212)),"time-entity":()=>n.e(61331).then(n.bind(n,87550)),"timer-entity":()=>n.e(94097).then(n.bind(n,6344)),"update-entity":()=>n.e(80275).then(n.bind(n,38238)),"valve-entity":()=>n.e(96654).then(n.bind(n,46493)),conditional:()=>Promise.all([n.e(67218),n.e(77563),n.e(78490)]).then(n.bind(n,80725)),"weather-entity":()=>Promise.all([n.e(12009),n.e(77547)]).then(n.bind(n,80395)),divider:()=>n.e(45249).then(n.bind(n,38584)),section:()=>n.e(51255).then(n.bind(n,39082)),weblink:()=>n.e(69148).then(n.bind(n,65751)),cast:()=>n.e(10405).then(n.bind(n,96612)),buttons:()=>n.e(50777).then(n.bind(n,65728)),attribute:()=>Promise.resolve().then(n.bind(n,65509)),text:()=>n.e(95421).then(n.bind(n,3980))},f={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},v=e=>(0,g.Ue)("row",e,p,y,f,void 0),w=e=>(0,g.gh)(e,"row",p,y);i()}catch(e){i(e)}})}};