UNPKG

iobroker.lovelace

Version:

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

2 lines 1.72 kB
export const __webpack_ids__=["95349"];export const __webpack_modules__={80898:function(e,t,n){n.a(e,(async function(e,r){try{n.r(t),n.d(t,{AreaViewStrategy:()=>y});var a=n(44249),i=(n(92745),n(9359),n(70104),n(57243)),s=n(15093),o=n(34593),c=n(45538),d=e([c]);c=(d.then?(await d)():d)[0];const p=(e,t)=>({type:"heading",heading:e,icon:t});let y=(0,a.Z)([(0,s.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 r=[],a=[];n.temperature_entity_id&&a.push({entity:n.temperature_entity_id,type:"entity",color:"red"}),n.humidity_entity_id&&a.push({entity:n.humidity_entity_id,type:"entity",color:"indigo"});const i=(0,c.yE)(e.area,t,e.groups_options),s=(0,c.cK)(t,n.name,!0),{lights:d,climate:y,media_players:h,security:u,others:l}=i;d.length>0&&r.push({type:"grid",cards:[p(c.Ge.lights,c.d$.lights),...d.map(s)]}),y.length>0&&r.push({type:"grid",cards:[p(c.Ge.climate,c.d$.climate),...y.map(s)]}),h.length>0&&r.push({type:"grid",cards:[p(c.Ge.media_players,c.d$.media_players),...h.map(s)]}),u.length>0&&r.push({type:"grid",cards:[p(c.Ge.security,c.d$.security),...u.map(s)]}),l.length>0&&r.push({type:"grid",cards:[p(c.Ge.others,c.d$.others),...l.map(s)]});const _=(0,o.u)(r.length,2,3);return 1===r.length&&(r[0].column_span=2),{type:"sections",header:{badges_position:"bottom",layout:"responsive",card:{type:"markdown",text_only:!0,content:`## ${n.name}`}},max_columns:_,sections:r,badges:a}}}]}}),i.fl);r()}catch(e){r(e)}}))}}; //# sourceMappingURL=95349.a7e913307cc8f16b.js.map