iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
3 lines • 17.3 kB
JavaScript
/*! For license information please see 28433.b51a1eb4289f2ea2.js.LICENSE.txt */
export const __webpack_ids__=["28433"];export const __webpack_modules__={92091:function(t,e,n){function i(t){return!!t&&(t instanceof Date&&!isNaN(t.valueOf()))}n.d(e,{Z:()=>i})},46467:function(t,e,n){n.a(t,(async function(t,i){try{n.d(e,{D_:()=>D,NC:()=>_,Nh:()=>v,U8:()=>F,WB:()=>h,mn:()=>c,p6:()=>u,ud:()=>f,yQ:()=>w});n(9359),n(1331);var a=n(16485),r=n(27486),o=n(20382),m=n(11104),s=t([a,m]);[a,m]=s.then?(await s)():s;(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,m.f)(t.time_zone,e)})));const u=(t,e,n)=>l(e,n.time_zone).format(t),l=(0,r.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,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),h=(t,e,n)=>{const i=y(e,n.time_zone);if(e.date_format===o.t6.language||e.date_format===o.t6.system)return i.format(t);const a=i.formatToParts(t),r=a.find((t=>"literal"===t.type))?.value,m=a.find((t=>"day"===t.type))?.value,s=a.find((t=>"month"===t.type))?.value,u=a.find((t=>"year"===t.type))?.value,l=a.at(a.length-1);let c="literal"===l?.type?l?.value:"";"bg"===e.language&&e.date_format===o.t6.YMD&&(c="");return{[o.t6.DMY]:`${m}${r}${s}${r}${u}${c}`,[o.t6.MDY]:`${s}${r}${m}${r}${u}${c}`,[o.t6.YMD]:`${u}${r}${s}${r}${m}${c}`}[e.date_format]},y=(0,r.Z)(((t,e)=>{const n=t.date_format===o.t6.system?void 0:t.language;return t.date_format===o.t6.language||(t.date_format,o.t6.system),new Intl.DateTimeFormat(n,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,m.f)(t.time_zone,e)})})),f=(t,e,n)=>g(e,n.time_zone).format(t),g=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:(0,m.f)(t.time_zone,e)}))),_=(t,e,n)=>p(e,n.time_zone).format(t),p=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),v=(t,e,n)=>b(e,n.time_zone).format(t),b=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",timeZone:(0,m.f)(t.time_zone,e)}))),w=(t,e,n)=>$(e,n.time_zone).format(t),$=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:(0,m.f)(t.time_zone,e)}))),D=(t,e,n)=>Z(e,n.time_zone).format(t),Z=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:(0,m.f)(t.time_zone,e)}))),F=(t,e,n)=>z(e,n.time_zone).format(t),z=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:(0,m.f)(t.time_zone,e)})));i()}catch(t){i(t)}}))},64214:function(t,e,n){n.a(t,(async function(t,i){try{n.d(e,{DG:()=>f,E8:()=>b,Fu:()=>v,NR:()=>$,W0:()=>h,o0:()=>c,yD:()=>_});var a=n(16485),r=n(27486),o=n(46467),m=n(33570),s=n(11104),u=n(16922),l=t([a,s,o,m]);[a,s,o,m]=l.then?(await l)():l;const c=(t,e,n)=>d(e,n.time_zone).format(t),d=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,u.y)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,u.y)(t)?"h12":"h23",timeZone:(0,s.f)(t.time_zone,e)}))),h=t=>y().format(t),y=(0,r.Z)((()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}))),f=(t,e,n)=>g(e,n.time_zone).format(t),g=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,u.y)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,u.y)(t)?"h12":"h23",timeZone:(0,s.f)(t.time_zone,e)}))),_=(t,e,n)=>p(e,n.time_zone).format(t),p=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,u.y)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,u.y)(t)?"h12":"h23",timeZone:(0,s.f)(t.time_zone,e)}))),v=(t,e,n)=>(new Date).getFullYear()===t.getFullYear()?_(t,e,n):f(t,e,n),b=(t,e,n)=>w(e,n.time_zone).format(t),w=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,u.y)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,u.y)(t)?"h12":"h23",timeZone:(0,s.f)(t.time_zone,e)}))),$=(t,e,n)=>`${(0,o.WB)(t,e,n)}, ${(0,m.mr)(t,e,n)}`;i()}catch(t){i(t)}}))},54363:function(t,e,n){n.a(t,(async function(t,i){try{n.d(e,{$k:()=>u,K:()=>h,LU:()=>p,a_:()=>y,h6:()=>c});var a=n(16485),r=n(27486),o=n(34618),m=t([a]);a=(m.then?(await m)():m)[0];const s=t=>t<10?`0${t}`:t,u=(t,e)=>{const n=e.days||0,i=e.hours||0,a=e.minutes||0,r=e.seconds||0,o=e.milliseconds||0;return n>0?`${Intl.NumberFormat(t.language,{style:"unit",unit:"day",unitDisplay:"long"}).format(n)} ${i}:${s(a)}:${s(r)}`:i>0?`${i}:${s(a)}:${s(r)}`:a>0?`${a}:${s(r)}`:r>0?Intl.NumberFormat(t.language,{style:"unit",unit:"second",unitDisplay:"long"}).format(r):o>0?Intl.NumberFormat(t.language,{style:"unit",unit:"millisecond",unitDisplay:"long"}).format(o):null},l=(0,r.Z)((t=>new Intl.DurationFormat(t.language,{style:"long"}))),c=(t,e)=>l(t).format(e),d=(0,r.Z)((t=>new Intl.DurationFormat(t.language,{style:"digital",hoursDisplay:"auto"}))),h=(t,e)=>d(t).format(e),y=["min","h","d"],f=(0,r.Z)((t=>new Intl.DurationFormat(t.language,{style:"narrow",daysDisplay:"always"}))),g=(0,r.Z)((t=>new Intl.DurationFormat(t.language,{style:"narrow",hoursDisplay:"always"}))),_=(0,r.Z)((t=>new Intl.DurationFormat(t.language,{style:"narrow",minutesDisplay:"always"}))),p=(t,e,n,i)=>{const a=void 0!==i?(0,o.N)(parseFloat(e),i):parseFloat(e);switch(n){case"d":{const e=Math.floor(a),n={days:e,hours:Math.floor(24*(a-e))};return f(t).format(n)}case"h":{const e=Math.floor(a),n={hours:e,minutes:Math.floor(60*(a-e))};return g(t).format(n)}case"min":{const e=Math.floor(a),n={minutes:e,seconds:Math.floor(60*(a-e))};return _(t).format(n)}default:throw new Error("Invalid duration unit")}};i()}catch(t){i(t)}}))},33570:function(t,e,n){n.a(t,(async function(t,i){try{n.d(e,{Vu:()=>c,Zs:()=>f,mr:()=>u,xO:()=>h});var a=n(16485),r=n(27486),o=n(11104),m=n(16922),s=t([a,o]);[a,o]=s.then?(await s)():s;const u=(t,e,n)=>l(e,n.time_zone).format(t),l=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,m.y)(t)?"h12":"h23",timeZone:(0,o.f)(t.time_zone,e)}))),c=(t,e,n)=>d(e,n.time_zone).format(t),d=(0,r.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,o.f)(t.time_zone,e)}))),h=(t,e,n)=>y(e,n.time_zone).format(t),y=(0,r.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,o.f)(t.time_zone,e)}))),f=(t,e,n)=>g(e,n.time_zone).format(t),g=(0,r.Z)(((t,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,o.f)(t.time_zone,e)})));i()}catch(t){i(t)}}))},11104:function(t,e,n){n.a(t,(async function(t,i){try{n.d(e,{Q:()=>s,f:()=>u});var a=n(16485),r=n(20382),o=t([a]);a=(o.then?(await o)():o)[0];const m=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,s=m??"UTC",u=(t,e)=>t===r.c_.local&&m?s:e;i()}catch(t){i(t)}}))},16922:function(t,e,n){n.d(e,{y:()=>r});var i=n(27486),a=n(20382);const r=(0,i.Z)((t=>{if(t.time_format===a.zt.language||t.time_format===a.zt.system){const e=t.time_format===a.zt.language?t.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(e).includes("10")}return t.time_format===a.zt.am_pm}))},25904:function(t,e,n){n.a(t,(async function(t,i){try{n.d(e,{computeAttributeNameDisplay:()=>p,computeAttributeValueDisplay:()=>_});n(9359),n(70104),n(52924);var a=n(59519),r=n(49319),o=n(92091),m=n(46467),s=n(64214),u=n(50602),l=n(87733),c=n(28281),d=n(41404),h=n(87974),y=n(73850),f=n(59847),g=t([u,a,s,m]);[u,a,s,m]=g.then?(await g)():g;const _=(t,e,n,i,l,g,p)=>{const v=void 0!==p?p:e.attributes[g];if(null==v)return t("state.default.unknown");if("number"==typeof v){const t=(0,f.N)(e),o=a.Ht[t]?.[g],m=o?o(v,n):(0,u.uf)(v,n);let s=a.F_[t]?.[g];return"weather"===t?s=(0,r.pv)(i,e,g):a.ig.has(g)&&(s=i.unit_system.temperature),s?`${m}${(0,h.L)(s,n)}${s}`:m}if("string"==typeof v&&(0,c.J)(v,!0)){if((0,d.W)(v)){const t=new Date(v);if((0,o.Z)(t))return(0,s.E8)(t,n,i)}const t=new Date(v);if((0,o.Z)(t))return(0,m.p6)(t,n,i)}if(Array.isArray(v)&&v.some((t=>t instanceof Object))||!Array.isArray(v)&&v instanceof Object)return JSON.stringify(v);if(Array.isArray(v))return v.map((a=>_(t,e,n,i,l,g,a))).join(", ");const b=e.entity_id,w=(0,y.M)(b),$=e.attributes.device_class,D=l[b],Z=D?.translation_key;return Z&&t(`component.${D.platform}.entity.${w}.${Z}.state_attributes.${g}.state.${v}`)||$&&t(`component.${w}.entity_component.${$}.state_attributes.${g}.state.${v}`)||t(`component.${w}.entity_component._.state_attributes.${g}.state.${v}`)||v},p=(t,e,n,i)=>{const a=e.entity_id,r=e.attributes.device_class,o=(0,y.M)(a),m=n[a],s=m?.translation_key;return s&&t(`component.${m.platform}.entity.${o}.${s}.state_attributes.${i}.name`)||r&&t(`component.${o}.entity_component.${r}.state_attributes.${i}.name`)||t(`component.${o}.entity_component._.state_attributes.${i}.name`)||(0,l.f)(i.replace(/_/g," ").replace(/\bid\b/g,"ID").replace(/\bip\b/g,"IP").replace(/\bmac\b/g,"MAC").replace(/\bgps\b/g,"GPS"))};i()}catch(t){i(t)}}))},59847:function(t,e,n){n.d(e,{N:()=>a});var i=n(73850);const a=t=>(0,i.M)(t.entity_id)},75278:function(t,e,n){n.d(e,{e:()=>i});const i=(t,e)=>a(t.attributes,e),a=(t,e)=>!!(t.supported_features&e)},50602:function(t,e,n){n.a(t,(async function(t,i){try{n.d(e,{SL:()=>s,l4:()=>d,sJ:()=>u,uf:()=>c});var a=n(16485),r=n(20382),o=n(34618),m=t([a]);a=(m.then?(await m)():m)[0];const s=t=>u(t.attributes),u=(t,e)=>!!t.unit_of_measurement||!!t.state_class||(e||[]).includes(t.device_class||""),l=t=>{switch(t.number_format){case r.y4.comma_decimal:return["en-US","en"];case r.y4.decimal_comma:return["de","es","it"];case r.y4.space_comma:return["fr","sv","cs"];case r.y4.system:return;default:return t.language}},c=(t,e,n)=>{const i=e?l(e):void 0;return Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},e?.number_format===r.y4.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||e?.number_format!==r.y4.none?"string"==typeof t?t:`${(0,o.N)(t,n?.maximumFractionDigits).toString()}${"currency"===n?.style?` ${n.currency}`:""}`:new Intl.NumberFormat("en-US",h(t,{...n,useGrouping:!1})).format(Number(t)):new Intl.NumberFormat(i,h(t,n)).format(Number(t))},d=(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},h=(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};i()}catch(t){i(t)}}))},34618:function(t,e,n){n.d(e,{N:()=>i});const i=(t,e=2)=>Math.round(t*10**e)/10**e},87733:function(t,e,n){n.d(e,{f:()=>i});const i=t=>t.charAt(0).toUpperCase()+t.slice(1)},28281:function(t,e,n){n.d(e,{J:()=>o});const i="^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])",a=new RegExp(i+"$"),r=new RegExp(i),o=(t,e=!1)=>e?r.test(t):a.test(t)},41404:function(t,e,n){n.d(e,{W:()=>a});const i=/^\d{4}-(0[1-9]|1[0-2])-([12]\d|0[1-9]|3[01])[T| ](((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)(\8[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)$/,a=t=>i.test(t)},45061:function(t,e,n){n.d(e,{K:()=>i});const i=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:()=>a});var i=n(45061);const a=(t,e)=>"°"===t?"":e&&"%"===t?(0,i.K)(e):" "},37583:function(t,e,n){n.r(e),n.d(e,{HaSvgIcon:()=>o});var i=n(44249),a=n(57243),r=n(15093);let o=(0,i.Z)([(0,r.Mo)("ha-svg-icon")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,r.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"secondaryPath",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"viewBox",value:void 0},{kind:"method",key:"render",value:function(){return a.YP` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?a.YP`<path class="primary-path" d="${this.path}"></path>`:a.Ld} ${this.secondaryPath?a.YP`<path class="secondary-path" d="${this.secondaryPath}"></path>`:a.Ld} </g> </svg>`}},{kind:"field",static:!0,key:"styles",value:()=>a.iv`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`}]}}),a.oi)},59519:function(t,e,n){n.a(t,(async function(t,i){try{n.d(e,{F_:()=>s,Ht:()=>u,ig:()=>m,wk:()=>o});n(92519),n(42179),n(89256),n(24931),n(88463),n(57449),n(19814);var a=n(54363),r=t([a]);a=(r.then?(await r)():r)[0];const o=["entity_id","assumed_state","attribution","custom_ui_more_info","custom_ui_state_card","device_class","editable","emulated_hue_name","emulated_hue","entity_picture","event_types","friendly_name","haaska_hidden","haaska_name","icon","initial_state","last_reset","restored","state_class","supported_features","unit_of_measurement","available_tones"],m=new Set(["temperature","current_temperature","target_temperature","target_temp_temp","target_temp_high","target_temp_low","target_temp_step","min_temp","max_temp"]),s={climate:{humidity:"%",current_humidity:"%",target_humidity_low:"%",target_humidity_high:"%",target_humidity_step:"%",min_humidity:"%",max_humidity:"%"},cover:{current_position:"%",current_tilt_position:"%"},fan:{percentage:"%"},humidifier:{humidity:"%",current_humidity:"%",min_humidity:"%",max_humidity:"%"},light:{color_temp:"mired",max_mireds:"mired",min_mireds:"mired",color_temp_kelvin:"K",min_color_temp_kelvin:"K",max_color_temp_kelvin:"K",brightness:"%"},sun:{azimuth:"°",elevation:"°"},vacuum:{battery_level:"%"},valve:{current_position:"%"},sensor:{battery_level:"%"},media_player:{volume_level:"%"}},u={light:{brightness:t=>Math.round(t/255*100).toString()},media_player:{volume_level:t=>Math.round(100*t).toString(),media_duration:(t,e)=>{const n=Math.floor(t/3600),i=Math.floor(t%3600/60),r=t%60;return(0,a.K)(e,{hours:n,minutes:i,seconds:r})}}};i()}catch(t){i(t)}}))},16485:function(t,e,n){n.a(t,(async function(t,e){try{n(92745);var i=n(61449),a=n(40574),r=n(30532),o=n(41674),m=n(49722),s=n(76632),u=n(7884),l=n(35185),c=n(60933),d=n(44180),h=n(49447);const t=async()=>{const t=(0,d.sS)(),e=[];(0,r.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,i.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("68250")]).then(n.bind(n,80561)).then((()=>(0,h.H)()))),(0,c.shouldPolyfill)()&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("65578")]).then(n.bind(n,97995))),(0,a.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("59826")]).then(n.bind(n,31514))),(0,o.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("23649")]).then(n.bind(n,93840))),(0,s.shouldPolyfill)(t)&&e.push(Promise.all([n.e("83895"),n.e("75297"),n.e("42831")]).then(n.bind(n,29559))),(0,u.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,l.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,h.n)(t)))};await t(),e()}catch(t){e(t)}}),1)},11386:function(t,e,n){n.d(e,{V:()=>m});n(9359),n(31526),n(48136),n(92519),n(42179),n(89256),n(24931),n(88463),n(57449),n(19814);var i=n(2841),a=n(45779);const r="important",o=" !"+r,m=(0,a.XM)(class extends a.Xe{constructor(t){var e;if(super(t),t.type!==a.pX.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,n)=>{const i=t[n];return null==i?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ht){this.ht=new Set;for(const t in e)this.ht.add(t);return this.render(e)}this.ht.forEach((t=>{null==e[t]&&(this.ht.delete(t),t.includes("-")?n.removeProperty(t):n[t]="")}));for(const t in e){const i=e[t];if(null!=i){this.ht.add(t);const e="string"==typeof i&&i.endsWith(o);t.includes("-")||e?n.setProperty(t,e?i.slice(0,-11):i,e?r:""):n[t]=i}}return i.Jb}})},69634:function(t,e,n){n.d(e,{V:()=>i.V});var i=n(11386)}};
//# sourceMappingURL=28433.b51a1eb4289f2ea2.js.map