UNPKG

iobroker.lovelace

Version:

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

2 lines 1.8 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["95349"],{80898:function(e,t,n){n.a(e,(async function(e,a){try{n.r(t),n.d(t,{AreaViewStrategy:()=>h});var r=n(61701),s=(n(52247),n(71695),n(92745),n(9359),n(70104),n(40251),n(47021),n(57243)),i=n(50778),o=n(34593),d=n(45538),c=e([d]);d=(c.then?(await c)():c)[0];const p=(e,t)=>({type:"heading",heading:e,icon:t});let h=(0,r.Z)([(0,i.Mo)("area-view-strategy")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",static:!0,key:"generate",value:async function(e,t){if(!e.area)throw new Error("Area not provided");const n=t.areas[e.area];if(!n)throw new Error("Unknown area");const a=[],r=[];n.temperature_entity_id&&r.push({entity:n.temperature_entity_id,type:"entity",color:"red"}),n.humidity_entity_id&&r.push({entity:n.humidity_entity_id,type:"entity",color:"indigo"});const s=(0,d.yE)(e.area,t,e.groups_options),i=(0,d.cK)(t,n.name,!0),{lights:c,climate:h,media_players:y,security:u,others:l}=s;c.length>0&&a.push({type:"grid",cards:[p(d.Ge.lights,d.d$.lights),...c.map(i)]}),h.length>0&&a.push({type:"grid",cards:[p(d.Ge.climate,d.d$.climate),...h.map(i)]}),y.length>0&&a.push({type:"grid",cards:[p(d.Ge.media_players,d.d$.media_players),...y.map(i)]}),u.length>0&&a.push({type:"grid",cards:[p(d.Ge.security,d.d$.security),...u.map(i)]}),l.length>0&&a.push({type:"grid",cards:[p(d.Ge.others,d.d$.others),...l.map(i)]});const m=(0,o.u)(a.length,2,3);return 1===a.length&&(a[0].column_span=2),{type:"sections",header:{badges_position:"bottom",layout:"responsive",card:{type:"markdown",text_only:!0,content:`## ${n.name}`}},max_columns:m,sections:a,badges:r}}}]}}),s.fl);a()}catch(p){a(p)}}))}}]); //# sourceMappingURL=95349.9a4dfe013d83935d.js.map