UNPKG

iobroker.lovelace

Version:

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

1 lines 6.72 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[8969],{380:function(t,n,e){e.a(t,async function(t,i){try{e.d(n,{D:function(){return m},P:function(){return s}});e(74423);var r=e(74487),o=e(27734),a=e(46927),u=e(96029),c=t([r]);r=(c.then?(await c)():c)[0];const s=t=>t.first_weekday===a.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,o.S)(t.language)%7:u.Z.includes(t.first_weekday)?u.Z.indexOf(t.first_weekday):1,m=t=>{const n=s(t);return u.Z[n]};i()}catch(s){i(s)}})},30162:function(t,n,e){e.a(t,async function(t,i){try{e.d(n,{LW:function(){return y},Xs:function(){return f},fU:function(){return s},ie:function(){return l}});var r=e(74487),o=e(22786),a=e(8480),u=e(69543),c=t([r,a]);[r,a]=c.then?(await c)():c;const s=(t,n,e)=>m(n,e.time_zone).format(t),m=(0,o.A)((t,n)=>new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,u.J)(t)?"h12":"h23",timeZone:(0,a.wj)(t.time_zone,n)})),l=(t,n,e)=>d(n,e.time_zone).format(t),d=(0,o.A)((t,n)=>new Intl.DateTimeFormat(t.language,{hour:(0,u.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,u.J)(t)?"h12":"h23",timeZone:(0,a.wj)(t.time_zone,n)})),f=(t,n,e)=>g(n,e.time_zone).format(t),g=(0,o.A)((t,n)=>new Intl.DateTimeFormat(t.language,{weekday:"long",hour:(0,u.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,u.J)(t)?"h12":"h23",timeZone:(0,a.wj)(t.time_zone,n)})),y=(t,n,e)=>_(n,e.time_zone).format(t),_=(0,o.A)((t,n)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,a.wj)(t.time_zone,n)}));i()}catch(s){i(s)}})},8480:function(t,n,e){e.a(t,async function(t,i){try{e.d(n,{fL:function(){return f},n2:function(){return g},wj:function(){return y}});var r,o,a,u=e(74487),c=e(29079),s=e(46927),m=t([u]);u=(m.then?(await m)():m)[0];const l=null===(r=Intl.DateTimeFormat)||void 0===r||null===(o=(a=r.call(Intl)).resolvedOptions)||void 0===o?void 0:o.call(a).timeZone,d=l&&("UTC"===l||"Etc/UTC"===l||l in c)?l:void 0,f=14881==e.j?void 0!==d:null,g=null!=d?d:"UTC",y=(t,n)=>t===s.Wj.local&&d?g:n;i()}catch(l){i(l)}})},69543:function(t,n,e){e.d(n,{J:function(){return o}});e(74423);var i=e(22786),r=e(46927);const o=(0,i.A)(t=>{if(t.time_format===r.Hg.language||t.time_format===r.Hg.system){const n=t.time_format===r.Hg.language?t.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(n).includes("10")}return t.time_format===r.Hg.am_pm})},96029:function(t,n,e){e.d(n,{Tq:function(){return a},Z:function(){return r},ZV:function(){return i},sj:function(){return o}});const i=["sun","mon","tue","wed","thu","fri","sat"],r=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],o={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},a={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},20058:function(t,n,e){e.a(t,async function(t,i){try{e.d(n,{QL:function(){return l},ZQ:function(){return d},ZV:function(){return m},ty:function(){return c},x:function(){return u}});var r=e(74487),o=(e(74423),e(18111),e(61701),e(46927)),a=t([r]);r=(a.then?(await a)():a)[0];const u=t=>c(t.attributes),c=(t,n)=>!!t.unit_of_measurement||!!t.state_class||(n||[]).includes(t.device_class||""),s=t=>{switch(t.number_format){case o.jG.comma_decimal:return["en-US","en"];case o.jG.decimal_comma:return["de","es","it"];case o.jG.space_comma:return["fr","sv","cs"];case o.jG.quote_decimal:return["de-CH"];case o.jG.system:return;default:return t.language}},m=(t,n,e)=>l(t,n,e).map(t=>t.value).join(""),l=(t,n,e)=>{const i=n?s(n):void 0;return(null==n?void 0:n.number_format)===o.jG.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||(null==n?void 0:n.number_format)!==o.jG.none?[{type:"literal",value:t}]:new Intl.NumberFormat("en-US",f(t,Object.assign(Object.assign({},e),{},{useGrouping:!1}))).formatToParts(Number(t)):new Intl.NumberFormat(i,f(t,e)).formatToParts(Number(t))},d=(t,n)=>{var e;const i=null==n?void 0:n.display_precision;return null!=i?{maximumFractionDigits:i,minimumFractionDigits:i}:Number.isInteger(Number(null==t||null===(e=t.attributes)||void 0===e?void 0:e.step))&&Number.isInteger(Number(null==t?void 0:t.state))?{maximumFractionDigits:0}:void 0},f=(t,n)=>{const e=Object.assign({maximumFractionDigits:2},n);if("string"!=typeof t)return e;if(!n||void 0===n.minimumFractionDigits&&void 0===n.maximumFractionDigits){const n=t.indexOf(".")>-1?t.split(".")[1].length:0;e.minimumFractionDigits=n,e.maximumFractionDigits=n}return e};i()}catch(u){i(u)}})},94129:function(t,n,e){e.d(n,{b:function(){return r},e:function(){return i}});const i="energy_dashboard",r="energy_dashboard_now"},7936:function(t,n,e){e.d(n,{V:function(){return r}});e(18111),e(61701),e(13579),e(45367),e(92731),e(62953);var i=e(28455);function r(t,n,e){if(!t.some(t=>t.included_in_stat))return!0;const r=new Map(t.map(t=>[t.stat_consumption,t]));for(const o of t){if(!o.included_in_stat)continue;const t=r.get(o.included_in_stat);if(!t)continue;const a=e(o),u=e(t);if(!a||!u)continue;const c=(0,i.EX)(a,n.entities,n.devices),s=(0,i.EX)(u,n.entities,n.devices);if(c&&s&&c!==s)return!1}return!0}},88615:function(t,n,e){e.a(t,async function(t,i){try{e.r(n),e.d(n,{WaterViewStrategy:function(){return l}});e(44114),e(18111),e(13579),e(3362);var r=e(40445),o=e(5124),a=e(67576),u=e(38114),c=e(94129),s=e(7936),m=t([u]);u=(m.then?(await m)():m)[0];class l extends o.mN{static async generate(t,n){var e;const i=t.collection_key||c.e,r={type:"sections",max_columns:3,sections:[{type:"grid",cards:[],column_span:3}],footer:{card:{type:"energy-date-selection",collection_key:i,opening_direction:"right",vertical_opening_direction:"up"}}},o=(0,u.tb)(n,{key:i});o.prefs||await o.refresh();const a=o.prefs,m=null==a?void 0:a.energy_sources.some(t=>"water"===t.type),l=null==a||null===(e=a.device_consumption_water)||void 0===e?void 0:e.length;if(!a||!l&&!m)return r;const d=r.sections[0];if(d.cards.push({type:"energy-compare",collection_key:i,grid_options:{columns:36}}),m&&(d.cards.push({title:n.localize("ui.panel.energy.cards.energy_water_graph_title"),type:"energy-water-graph",collection_key:i,grid_options:{columns:24}}),d.cards.push({title:n.localize("ui.panel.energy.cards.energy_sources_table_title"),type:"energy-sources-table",collection_key:i,types:["water"],grid_options:{columns:12}})),l){const t=(0,s.V)(a.device_consumption_water,n,t=>t.stat_consumption);d.cards.push({title:n.localize("ui.panel.energy.cards.water_sankey_title"),type:"water-sankey",collection_key:i,group_by_floor:t,group_by_area:t,grid_options:{columns:24}})}return r}}l=(0,r.Cg)([(0,a.EM)("water-view-strategy")],l),i()}catch(l){i(l)}})}}]);