UNPKG

iobroker.lovelace

Version:

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

2 lines 12.8 kB
export const __webpack_ids__=["13762"];export const __webpack_modules__={92636:function(t,e,n){n.d(e,{z:()=>a});const a=t=>(e,n)=>t.includes(e,n)},46467:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{D_:()=>Z,NC:()=>_,Nh:()=>D,U8:()=>b,WB:()=>y,mn:()=>c,p6:()=>l,ud:()=>g,yQ:()=>$});n(9359),n(1331);var i=n(16485),o=n(27486),r=n(20382),m=n(11104),u=t([i,m]);[i,m]=u.then?(await u)():u;(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,m.f)(t.time_zone,e)})));const l=(t,e,n)=>s(e,n.time_zone).format(t),s=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),c=(t,e,n)=>f(e,n.time_zone).format(t),f=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),y=(t,e,n)=>{const a=d(e,n.time_zone);if(e.date_format===r.t6.language||e.date_format===r.t6.system)return a.format(t);const i=a.formatToParts(t),o=i.find((t=>"literal"===t.type))?.value,m=i.find((t=>"day"===t.type))?.value,u=i.find((t=>"month"===t.type))?.value,l=i.find((t=>"year"===t.type))?.value,s=i.at(i.length-1);let c="literal"===s?.type?s?.value:"";"bg"===e.language&&e.date_format===r.t6.YMD&&(c="");return{[r.t6.DMY]:`${m}${o}${u}${o}${l}${c}`,[r.t6.MDY]:`${u}${o}${m}${o}${l}${c}`,[r.t6.YMD]:`${l}${o}${u}${o}${m}${c}`}[e.date_format]},d=(0,o.Z)(((t,e)=>{const n=t.date_format===r.t6.system?void 0:t.language;return t.date_format===r.t6.language||(t.date_format,r.t6.system),new Intl.DateTimeFormat(n,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,m.f)(t.time_zone,e)})})),g=(t,e,n)=>h(e,n.time_zone).format(t),h=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:(0,m.f)(t.time_zone,e)}))),_=(t,e,n)=>w(e,n.time_zone).format(t),w=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),D=(t,e,n)=>p(e,n.time_zone).format(t),p=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",timeZone:(0,m.f)(t.time_zone,e)}))),$=(t,e,n)=>z(e,n.time_zone).format(t),z=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),Z=(t,e,n)=>F(e,n.time_zone).format(t),F=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:(0,m.f)(t.time_zone,e)}))),b=(t,e,n)=>v(e,n.time_zone).format(t),v=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:(0,m.f)(t.time_zone,e)})));a()}catch(t){a(t)}}))},64214:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{DG:()=>g,E8:()=>p,Fu:()=>D,NR:()=>z,W0:()=>y,o0:()=>c,yD:()=>_});var i=n(16485),o=n(27486),r=n(46467),m=n(33570),u=n(11104),l=n(16922),s=t([i,u,r,m]);[i,u,r,m]=s.then?(await s)():s;const c=(t,e,n)=>f(e,n.time_zone).format(t),f=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.y)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.y)(t)?"h12":"h23",timeZone:(0,u.f)(t.time_zone,e)}))),y=t=>d().format(t),d=(0,o.Z)((()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}))),g=(t,e,n)=>h(e,n.time_zone).format(t),h=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,l.y)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.y)(t)?"h12":"h23",timeZone:(0,u.f)(t.time_zone,e)}))),_=(t,e,n)=>w(e,n.time_zone).format(t),w=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,l.y)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.y)(t)?"h12":"h23",timeZone:(0,u.f)(t.time_zone,e)}))),D=(t,e,n)=>(new Date).getFullYear()===t.getFullYear()?_(t,e,n):g(t,e,n),p=(t,e,n)=>$(e,n.time_zone).format(t),$=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.y)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,l.y)(t)?"h12":"h23",timeZone:(0,u.f)(t.time_zone,e)}))),z=(t,e,n)=>`${(0,r.WB)(t,e,n)}, ${(0,m.mr)(t,e,n)}`;a()}catch(t){a(t)}}))},54363:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{$k:()=>l,K:()=>y,LU:()=>w,a_:()=>d,h6:()=>c});var i=n(16485),o=n(27486),r=n(34618),m=t([i]);i=(m.then?(await m)():m)[0];const u=t=>t<10?`0${t}`:t,l=(t,e)=>{const n=e.days||0,a=e.hours||0,i=e.minutes||0,o=e.seconds||0,r=e.milliseconds||0;return n>0?`${Intl.NumberFormat(t.language,{style:"unit",unit:"day",unitDisplay:"long"}).format(n)} ${a}:${u(i)}:${u(o)}`:a>0?`${a}:${u(i)}:${u(o)}`:i>0?`${i}:${u(o)}`:o>0?Intl.NumberFormat(t.language,{style:"unit",unit:"second",unitDisplay:"long"}).format(o):r>0?Intl.NumberFormat(t.language,{style:"unit",unit:"millisecond",unitDisplay:"long"}).format(r):null},s=(0,o.Z)((t=>new Intl.DurationFormat(t.language,{style:"long"}))),c=(t,e)=>s(t).format(e),f=(0,o.Z)((t=>new Intl.DurationFormat(t.language,{style:"digital",hoursDisplay:"auto"}))),y=(t,e)=>f(t).format(e),d=["min","h","d"],g=(0,o.Z)((t=>new Intl.DurationFormat(t.language,{style:"narrow",daysDisplay:"always"}))),h=(0,o.Z)((t=>new Intl.DurationFormat(t.language,{style:"narrow",hoursDisplay:"always"}))),_=(0,o.Z)((t=>new Intl.DurationFormat(t.language,{style:"narrow",minutesDisplay:"always"}))),w=(t,e,n,a)=>{const i=void 0!==a?(0,r.N)(parseFloat(e),a):parseFloat(e);switch(n){case"d":{const e=Math.floor(i),n={days:e,hours:Math.floor(24*(i-e))};return g(t).format(n)}case"h":{const e=Math.floor(i),n={hours:e,minutes:Math.floor(60*(i-e))};return h(t).format(n)}case"min":{const e=Math.floor(i),n={minutes:e,seconds:Math.floor(60*(i-e))};return _(t).format(n)}default:throw new Error("Invalid duration unit")}};a()}catch(t){a(t)}}))},33570:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{Vu:()=>c,Zs:()=>g,mr:()=>l,xO:()=>y});var i=n(16485),o=n(27486),r=n(11104),m=n(16922),u=t([i,r]);[i,r]=u.then?(await u)():u;const l=(t,e,n)=>s(e,n.time_zone).format(t),s=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,m.y)(t)?"h12":"h23",timeZone:(0,r.f)(t.time_zone,e)}))),c=(t,e,n)=>f(e,n.time_zone).format(t),f=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{hour:(0,m.y)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,m.y)(t)?"h12":"h23",timeZone:(0,r.f)(t.time_zone,e)}))),y=(t,e,n)=>d(e,n.time_zone).format(t),d=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",hour:(0,m.y)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,m.y)(t)?"h12":"h23",timeZone:(0,r.f)(t.time_zone,e)}))),g=(t,e,n)=>h(e,n.time_zone).format(t),h=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,r.f)(t.time_zone,e)})));a()}catch(t){a(t)}}))},11104:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{Q:()=>u,f:()=>l});var i=n(16485),o=n(20382),r=t([i]);i=(r.then?(await r)():r)[0];const m=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,u=m??"UTC",l=(t,e)=>t===o.c_.local&&m?u:e;a()}catch(t){a(t)}}))},16922:function(t,e,n){n.d(e,{y:()=>o});var a=n(27486),i=n(20382);const o=(0,a.Z)((t=>{if(t.time_format===i.zt.language||t.time_format===i.zt.system){const e=t.time_format===i.zt.language?t.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(e).includes("10")}return t.time_format===i.zt.am_pm}))},97547:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{c:()=>g,computeStateDisplay:()=>d});var i=n(96194),o=n(20382),r=n(54363),m=n(46467),u=n(64214),l=n(33570),s=n(50602),c=n(87974),f=n(73850),y=t([r,s,m,l,u]);[r,s,m,l,u]=y.then?(await y)():y;const d=(t,e,n,a,i,o,r)=>{const m=o?.[e.entity_id];return g(t,n,a,i,m,e.entity_id,e.attributes,void 0!==r?r:e.state)},g=(t,e,n,a,y,d,g,h)=>{if(h===i.lz||h===i.nZ)return t(`state.default.${h}`);const _=(0,f.M)(d),w="counter"===_||"number"===_||"input_number"===_;if((0,s.sJ)(g,"sensor"===_?n:[])||w){if("duration"===g.device_class&&g.unit_of_measurement&&r.a_.includes(g.unit_of_measurement))try{return(0,r.LU)(e,h,g.unit_of_measurement,y?.display_precision)}catch(t){}if("monetary"===g.device_class)try{return(0,s.uf)(h,e,{style:"currency",currency:g.unit_of_measurement,minimumFractionDigits:2,...(0,s.l4)({state:h,attributes:g},y)})}catch(t){}const n=(0,s.uf)(h,e,(0,s.l4)({state:h,attributes:g},y)),a=y?.translation_key&&t(`component.${y.platform}.entity.${_}.${y.translation_key}.unit_of_measurement`)||g.unit_of_measurement;return a?`${n}${(0,c.L)(a,e)}${a}`:n}if(["date","input_datetime","time"].includes(_))try{const t=h.split(" ");if(2===t.length)return(0,u.o0)(new Date(t.join("T")),{...e,time_zone:o.c_.local},a);if(1===t.length){if(h.includes("-"))return(0,m.p6)(new Date(`${h}T00:00`),{...e,time_zone:o.c_.local},a);if(h.includes(":")){const t=new Date;return(0,l.mr)(new Date(`${t.toISOString().split("T")[0]}T${h}`),{...e,time_zone:o.c_.local},a)}}return h}catch(t){return h}if(["button","conversation","event","image","input_button","notify","scene","stt","tag","tts","wake_word","datetime"].includes(_)||"sensor"===_&&"timestamp"===g.device_class)try{return(0,u.o0)(new Date(h),e,a)}catch(t){return h}return y?.translation_key&&t(`component.${y.platform}.entity.${_}.${y.translation_key}.state.${h}`)||g.device_class&&t(`component.${_}.entity_component.${g.device_class}.state.${h}`)||t(`component.${_}.entity_component._.state.${h}`)||h};a()}catch(t){a(t)}}))},50602:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{SL:()=>u,l4:()=>f,sJ:()=>l,uf:()=>c});var i=n(16485),o=n(20382),r=n(34618),m=t([i]);i=(m.then?(await m)():m)[0];const u=t=>l(t.attributes),l=(t,e)=>!!t.unit_of_measurement||!!t.state_class||(e||[]).includes(t.device_class||""),s=t=>{switch(t.number_format){case o.y4.comma_decimal:return["en-US","en"];case o.y4.decimal_comma:return["de","es","it"];case o.y4.space_comma:return["fr","sv","cs"];case o.y4.system:return;default:return t.language}},c=(t,e,n)=>{const a=e?s(e):void 0;return Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},e?.number_format===o.y4.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||e?.number_format!==o.y4.none?"string"==typeof t?t:`${(0,r.N)(t,n?.maximumFractionDigits).toString()}${"currency"===n?.style?` ${n.currency}`:""}`:new Intl.NumberFormat("en-US",y(t,{...n,useGrouping:!1})).format(Number(t)):new Intl.NumberFormat(a,y(t,n)).format(Number(t))},f=(t,e)=>{const n=e?.display_precision;return null!=n?{maximumFractionDigits:n,minimumFractionDigits:n}:Number.isInteger(Number(t?.attributes?.step))&&Number.isInteger(Number(t?.state))?{maximumFractionDigits:0}:void 0},y=(t,e)=>{const n={maximumFractionDigits:2,...e};if("string"!=typeof t)return n;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;n.minimumFractionDigits=e,n.maximumFractionDigits=e}return n};a()}catch(t){a(t)}}))},34618:function(t,e,n){n.d(e,{N:()=>a});const a=(t,e=2)=>Math.round(t*10**e)/10**e},45061:function(t,e,n){n.d(e,{K:()=>a});const a=t=>{switch(t.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},87974:function(t,e,n){n.d(e,{L:()=>i});var a=n(45061);const i=(t,e)=>"°"===t?"":e&&"%"===t?(0,a.K)(e):" "},96194:function(t,e,n){n.d(e,{ON:()=>r,PX:()=>m,V_:()=>u,lz:()=>o,nZ:()=>i,rk:()=>s});var a=n(92636);const i="unavailable",o="unknown",r="on",m="off",u=[i,o],l=[i,o,m],s=(0,a.z)(u);(0,a.z)(l)},16485:function(t,e,n){n.a(t,(async function(t,e){try{n(92745);var a=n(61449),i=n(40574),o=n(30532),r=n(41674),m=n(49722),u=n(76632),l=n(7884),s=n(35185),c=n(60933),f=n(44180),y=n(49447);const t=async()=>{const t=(0,f.sS)(),e=[];(0,o.shouldPolyfill)()&&await Promise.all([n.e("80210"),n.e("74055")]).then(n.bind(n,98133)),(0,m.shouldPolyfill)()&&await Promise.all([n.e("83895"),n.e("75297"),n.e("80210"),n.e("60251")]).then(n.bind(n,59095)),(0,a.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("68250")]).then(n.bind(n,80561)).then((()=>(0,y.H)()))),(0,c.shouldPolyfill)()&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("65578")]).then(n.bind(n,97995))),(0,i.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("59826")]).then(n.bind(n,31514))),(0,r.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("23649")]).then(n.bind(n,93840))),(0,u.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("42831")]).then(n.bind(n,29559))),(0,l.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("57377")]).then(n.bind(n,39030)).then((()=>n.e("61236").then(n.t.bind(n,4121,23))))),(0,s.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("13870")]).then(n.bind(n,74546))),0!==e.length&&await Promise.all(e).then((()=>(0,y.n)(t)))};await t(),e()}catch(t){e(t)}}),1)}}; //# sourceMappingURL=13762.bd6ac6e830ae395f.js.map