iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 14.5 kB
JavaScript
webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["13762"],{92636:function(t,e,n){n.d(e,{z:()=>a});n(19083),n(61006);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_:()=>$,NC:()=>_,Nh:()=>w,U8:()=>z,WB:()=>f,mn:()=>c,p6:()=>l,ud:()=>g,yQ:()=>b});n(63434),n(9359),n(1331),n(96829);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)=>d(e,n.time_zone).format(t),d=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),f=(t,e,n)=>{var a,i,o,m;const u=y(e,n.time_zone);if(e.date_format===r.t6.language||e.date_format===r.t6.system)return u.format(t);const l=u.formatToParts(t),s=null===(a=l.find((t=>"literal"===t.type)))||void 0===a?void 0:a.value,c=null===(i=l.find((t=>"day"===t.type)))||void 0===i?void 0:i.value,d=null===(o=l.find((t=>"month"===t.type)))||void 0===o?void 0:o.value,f=null===(m=l.find((t=>"year"===t.type)))||void 0===m?void 0:m.value,g=l.at(l.length-1);let h="literal"===(null==g?void 0:g.type)?null==g?void 0:g.value:"";"bg"===e.language&&e.date_format===r.t6.YMD&&(h="");return{[r.t6.DMY]:`${c}${s}${d}${s}${f}${h}`,[r.t6.MDY]:`${d}${s}${c}${s}${f}${h}`,[r.t6.YMD]:`${f}${s}${d}${s}${c}${h}`}[e.date_format]},y=(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)=>v(e,n.time_zone).format(t),v=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),w=(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)}))),b=(t,e,n)=>D(e,n.time_zone).format(t),D=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),$=(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)}))),z=(t,e,n)=>Z(e,n.time_zone).format(t),Z=(0,o.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:(0,m.f)(t.time_zone,e)})));a()}catch(l){a(l)}}))},64214:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{DG:()=>g,E8:()=>p,Fu:()=>w,NR:()=>D,W0:()=>f,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)=>d(e,n.time_zone).format(t),d=(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)}))),f=t=>y().format(t),y=(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)=>v(e,n.time_zone).format(t),v=(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)}))),w=(t,e,n)=>(new Date).getFullYear()===t.getFullYear()?_(t,e,n):g(t,e,n),p=(t,e,n)=>b(e,n.time_zone).format(t),b=(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)}))),D=(t,e,n)=>`${(0,r.WB)(t,e,n)}, ${(0,m.mr)(t,e,n)}`;a()}catch(c){a(c)}}))},54363:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{$k:()=>l,K:()=>f,LU:()=>v,a_:()=>y,h6:()=>c});n(52247),n(95078);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),d=(0,o.Z)((t=>new Intl.DurationFormat(t.language,{style:"digital",hoursDisplay:"auto"}))),f=(t,e)=>d(t).format(e),y=["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"}))),v=(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(u){a(u)}}))},33570:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{Vu:()=>c,Zs:()=>g,mr:()=>l,xO:()=>f});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)=>d(e,n.time_zone).format(t),d=(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)}))),f=(t,e,n)=>y(e,n.time_zone).format(t),y=(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(l){a(l)}}))},11104:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{Q:()=>c,f:()=>d});var i,o,r,m=n(16485),u=n(20382),l=t([m]);m=(l.then?(await l)():l)[0];const s=null===(i=Intl.DateTimeFormat)||void 0===i||null===(o=(r=i.call(Intl)).resolvedOptions)||void 0===o?void 0:o.call(r).timeZone,c=null!=s?s:"UTC",d=(t,e)=>t===u.c_.local&&s?c:e;a()}catch(s){a(s)}}))},16922:function(t,e,n){n.d(e,{y:()=>o});n(19083),n(61006);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:()=>y});n(19083),n(19423),n(61006);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),d=n(73850),f=t([r,s,m,l,u]);[r,s,m,l,u]=f.then?(await f)():f;const y=(t,e,n,a,i,o,r)=>{const m=null==o?void 0: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,f,y,g,h)=>{if(h===i.lz||h===i.nZ)return t(`state.default.${h}`);const _=(0,d.M)(y),v="counter"===_||"number"===_||"input_number"===_;if((0,s.sJ)(g,"sensor"===_?n:[])||v){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,null==f?void 0:f.display_precision)}catch(w){}if("monetary"===g.device_class)try{return(0,s.uf)(h,e,Object.assign({style:"currency",currency:g.unit_of_measurement,minimumFractionDigits:2},(0,s.l4)({state:h,attributes:g},f)))}catch(w){}const n=(0,s.uf)(h,e,(0,s.l4)({state:h,attributes:g},f)),a=(null==f?void 0:f.translation_key)&&t(`component.${f.platform}.entity.${_}.${f.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")),Object.assign(Object.assign({},e),{},{time_zone:o.c_.local}),a);if(1===t.length){if(h.includes("-"))return(0,m.p6)(new Date(`${h}T00:00`),Object.assign(Object.assign({},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}`),Object.assign(Object.assign({},e),{},{time_zone:o.c_.local}),a)}}return h}catch(p){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(w){return h}return(null==f?void 0:f.translation_key)&&t(`component.${f.platform}.entity.${_}.${f.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(y){a(y)}}))},50602:function(t,e,n){n.a(t,(async function(t,a){try{n.d(e,{SL:()=>u,l4:()=>d,sJ:()=>l,uf:()=>c});var i=n(16485),o=(n(19083),n(19423),n(11740),n(61006),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)},(null==e?void 0:e.number_format)===o.y4.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||(null==e?void 0:e.number_format)!==o.y4.none?"string"==typeof t?t:`${(0,r.N)(t,null==n?void 0:n.maximumFractionDigits).toString()}${"currency"===(null==n?void 0:n.style)?` ${n.currency}`:""}`:new Intl.NumberFormat("en-US",f(t,Object.assign(Object.assign({},n),{},{useGrouping:!1}))).format(Number(t)):new Intl.NumberFormat(a,f(t,n)).format(Number(t))},d=(t,e)=>{var n;const a=null==e?void 0:e.display_precision;return null!=a?{maximumFractionDigits:a,minimumFractionDigits:a}:Number.isInteger(Number(null==t||null===(n=t.attributes)||void 0===n?void 0:n.step))&&Number.isInteger(Number(null==t?void 0:t.state))?{maximumFractionDigits:0}:void 0},f=(t,e)=>{const n=Object.assign({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(u){a(u)}}))},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(71695),n(92745),n(40251),n(47021);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(65401),d=n(44180),f=n(49447);const t=async()=>{const t=(0,d.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("2142"),n.e("75297"),n.e("80210"),n.e("60251")]).then(n.bind(n,59095)),(0,a.shouldPolyfill)(t)&&e.push(Promise.all([n.e("2142"),n.e("75297"),n.e("68250")]).then(n.bind(n,80561)).then((()=>(0,f.H)()))),(0,c.shouldPolyfill)()&&e.push(Promise.all([n.e("2142"),n.e("75297"),n.e("65578")]).then(n.bind(n,97995))),(0,i.shouldPolyfill)(t)&&e.push(Promise.all([n.e("2142"),n.e("75297"),n.e("59826")]).then(n.bind(n,31514))),(0,r.shouldPolyfill)(t)&&e.push(Promise.all([n.e("2142"),n.e("75297"),n.e("23649")]).then(n.bind(n,93840))),(0,u.shouldPolyfill)(t)&&e.push(Promise.all([n.e("2142"),n.e("75297"),n.e("42831")]).then(n.bind(n,29559))),(0,l.shouldPolyfill)(t)&&e.push(Promise.all([n.e("2142"),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("2142"),n.e("75297"),n.e("13870")]).then(n.bind(n,74546))),0!==e.length&&await Promise.all(e).then((()=>(0,f.n)(t)))};await t(),e()}catch(y){e(y)}}),1)},96526:function(t,e,n){var a=n(1569),i=n(29660),o=n(72878),r=n(72616),m=n(36888).trim,u=n(91430),l=o("".charAt),s=a.parseFloat,c=a.Symbol,d=c&&c.iterator,f=1/s(u+"-0")!=-1/0||d&&!i((function(){s(Object(d))}));t.exports=f?function(t){var e=m(r(t)),n=s(e);return 0===n&&"-"===l(e,0)?-0:n}:s},63434:function(t,e,n){var a=n(40810),i=n(12360),o=n(13053),r=n(88045),m=n(35709);a({target:"Array",proto:!0},{at:function(t){var e=i(this),n=o(e),a=r(t),m=a>=0?a:n+a;return m<0||m>=n?void 0:e[m]}}),m("at")},95078:function(t,e,n){var a=n(40810),i=n(96526);a({global:!0,forced:parseFloat!==i},{parseFloat:i})},96829:function(t,e,n){var a=n(40810),i=n(72878),o=n(95011),r=n(88045),m=n(72616),u=n(29660),l=i("".charAt);a({target:"String",proto:!0,forced:u((function(){return"\ud842"!=="𠮷".at(-2)}))},{at:function(t){var e=m(o(this)),n=e.length,a=r(t),i=a>=0?a:n+a;return i<0||i>=n?void 0:l(e,i)}})}}]);
//# sourceMappingURL=13762.82cd3acec7bd4bfb.js.map
;(self.