UNPKG

iobroker.lovelace

Version:

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

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