UNPKG

iobroker.lovelace

Version:

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

2 lines 17.6 kB
export const __webpack_ids__=["69518"];export const __webpack_modules__={46467:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{D_:()=>x,NC:()=>p,Nh:()=>b,U8:()=>S,WB:()=>m,mn:()=>u,p6:()=>c,ud:()=>g,yQ:()=>k});a(9359),a(1331);var n=a(16485),o=a(27486),r=a(20382),d=a(11104),s=e([n,d]);[n,d]=s.then?(await s)():s;(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,d.f)(e.time_zone,t)})));const c=(e,t,a)=>l(t,a.time_zone).format(e),l=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,d.f)(e.time_zone,t)}))),u=(e,t,a)=>h(t,a.time_zone).format(e),h=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,d.f)(e.time_zone,t)}))),m=(e,t,a)=>{const i=f(t,a.time_zone);if(t.date_format===r.t6.language||t.date_format===r.t6.system)return i.format(e);const n=i.formatToParts(e),o=n.find((e=>"literal"===e.type))?.value,d=n.find((e=>"day"===e.type))?.value,s=n.find((e=>"month"===e.type))?.value,c=n.find((e=>"year"===e.type))?.value,l=n.at(n.length-1);let u="literal"===l?.type?l?.value:"";"bg"===t.language&&t.date_format===r.t6.YMD&&(u="");return{[r.t6.DMY]:`${d}${o}${s}${o}${c}${u}`,[r.t6.MDY]:`${s}${o}${d}${o}${c}${u}`,[r.t6.YMD]:`${c}${o}${s}${o}${d}${u}`}[t.date_format]},f=(0,o.Z)(((e,t)=>{const a=e.date_format===r.t6.system?void 0:e.language;return e.date_format===r.t6.language||(e.date_format,r.t6.system),new Intl.DateTimeFormat(a,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,d.f)(e.time_zone,t)})})),g=(e,t,a)=>y(t,a.time_zone).format(e),y=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,d.f)(e.time_zone,t)}))),p=(e,t,a)=>_(t,a.time_zone).format(e),_=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,d.f)(e.time_zone,t)}))),b=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,d.f)(e.time_zone,t)}))),k=(e,t,a)=>w(t,a.time_zone).format(e),w=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,d.f)(e.time_zone,t)}))),x=(e,t,a)=>Z(t,a.time_zone).format(e),Z=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,d.f)(e.time_zone,t)}))),S=(e,t,a)=>z(t,a.time_zone).format(e),z=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,d.f)(e.time_zone,t)})));i()}catch(e){i(e)}}))},33570:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{Vu:()=>u,Zs:()=>g,mr:()=>c,xO:()=>m});var n=a(16485),o=a(27486),r=a(11104),d=a(16922),s=e([n,r]);[n,r]=s.then?(await s)():s;const c=(e,t,a)=>l(t,a.time_zone).format(e),l=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,r.f)(e.time_zone,t)}))),u=(e,t,a)=>h(t,a.time_zone).format(e),h=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,d.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,r.f)(e.time_zone,t)}))),m=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,d.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,r.f)(e.time_zone,t)}))),g=(e,t,a)=>y(t,a.time_zone).format(e),y=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,r.f)(e.time_zone,t)})));i()}catch(e){i(e)}}))},16922:function(e,t,a){a.d(t,{y:()=>o});var i=a(27486),n=a(20382);const o=(0,i.Z)((e=>{if(e.time_format===n.zt.language||e.time_format===n.zt.system){const t=e.time_format===n.zt.language?e.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(t).includes("10")}return e.time_format===n.zt.am_pm}))},87733:function(e,t,a){a.d(t,{f:()=>i});const i=e=>e.charAt(0).toUpperCase()+e.slice(1)},89133:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{u:()=>s,z:()=>d});var n=a(16485),o=a(27486),r=e([n]);n=(r.then?(await r)():r)[0];const d=(e,t)=>c(e).format(t),s=(e,t)=>l(e).format(t),c=(0,o.Z)((e=>new Intl.ListFormat(e.language,{style:"long",type:"conjunction"}))),l=(0,o.Z)((e=>new Intl.ListFormat(e.language,{style:"long",type:"disjunction"})));i()}catch(e){i(e)}}))},54977:function(e,t,a){var i=a(44249),n=a(57243),o=a(15093);(0,i.Z)([(0,o.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"raised",value:()=>!1},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`},{kind:"method",key:"render",value:function(){return n.dy` ${this.header?n.dy`<h1 class="card-header">${this.header}</h1>`:n.Ld} <slot></slot> `}}]}}),n.oi)},62801:function(e,t,a){var i=a(44249),n=a(72621),o=(a(9359),a(56475),a(22139),a(57243)),r=a(15093),d=a(36522);(0,i.Z)([(0,r.Mo)("ha-sortable")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:"_sortable",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"no-style"})],key:"noStyle",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"draggable-selector"})],key:"draggableSelector",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"handle-selector"})],key:"handleSelector",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"filter"})],key:"filter",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String})],key:"group",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"invert-swap"})],key:"invertSwap",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"options",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"rollback",value:()=>!0},{kind:"method",key:"updated",value:function(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}},{kind:"field",key:"_shouldBeDestroy",value:()=>!1},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._shouldBeDestroy=!0,setTimeout((()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)}),1)}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return this.noStyle?o.Ld:o.dy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:4px;opacity:.4}.sortable-drag{border-radius:4px;opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}},{kind:"method",key:"_createSortable",value:async function(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([a.e("34153"),a.e("467")]).then(a.bind(a,59807))).default,i={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(i.draggable=this.draggableSelector),this.handleSelector&&(i.handle=this.handleSelector),void 0!==this.invertSwap&&(i.invertSwap=this.invertSwap),this.group&&(i.group=this.group),this.filter&&(i.filter=this.filter),this._sortable=new t(e,i)}},{kind:"field",key:"_handleUpdate",value(){return e=>{(0,d.B)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})}}},{kind:"field",key:"_handleAdd",value(){return e=>{(0,d.B)(this,"item-added",{index:e.newIndex,data:e.item.sortableData})}}},{kind:"field",key:"_handleRemove",value(){return e=>{(0,d.B)(this,"item-removed",{index:e.oldIndex})}}},{kind:"field",key:"_handleEnd",value(){return async e=>{(0,d.B)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)}}},{kind:"field",key:"_handleStart",value(){return()=>{(0,d.B)(this,"drag-start")}}},{kind:"field",key:"_handleChoose",value(){return e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}},{kind:"method",key:"_destroySortable",value:function(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}}]}}),o.oi)},51223:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=a(57243),o=a(15093),r=a(94571),d=a(59847),s=a(45729),c=(a(65981),a(37583),e([s]));s=(c.then?(await c)():c)[0];(0,i.Z)([(0,o.Mo)("ha-state-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"stateValue",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){const e=this.icon||this.stateObj&&this.hass?.entities[this.stateObj.entity_id]?.icon||this.stateObj?.attributes.icon;if(e)return n.dy`<ha-icon .icon="${e}"></ha-icon>`;if(!this.stateObj)return n.Ld;if(!this.hass)return this._renderFallback();const t=(0,s.gD)(this.hass,this.stateObj,this.stateValue).then((e=>e?n.dy`<ha-icon .icon="${e}"></ha-icon>`:this._renderFallback()));return n.dy`${(0,r.C)(t)}`}},{kind:"method",key:"_renderFallback",value:function(){const e=(0,d.N)(this.stateObj);return n.dy` <ha-svg-icon .path="${s.Ls[e]||s.Rb}"></ha-svg-icon> `}}]}}),n.oi);t()}catch(e){t(e)}}))},14473:function(e,t,a){a.d(t,{B$:()=>d,EQ:()=>y,Es:()=>l,Gd:()=>c,HF:()=>k,Ip:()=>v,J8:()=>Z,Kc:()=>b,Pl:()=>w,SC:()=>u,SQ:()=>f,W9:()=>_,Xm:()=>x,Yc:()=>s,r4:()=>m,sq:()=>g});a(92745),a(9359),a(31526),a(70104);var i=a(83523),n=a(95262),o=a(68418),r=a(58776);const d="single",s=10,c=e=>{if("condition"in e&&Array.isArray(e.condition))return{condition:"and",conditions:e.condition};for(const t of["and","or","not"])if(t in e)return{condition:t,conditions:e[t]};return e},l=(e,t)=>{e.callService("automation","trigger",{entity_id:t,skip_condition:!0})},u=(e,t)=>e.callApi("DELETE",`config/automation/config/${t}`);let h;const m=(e,t)=>e.callApi("GET",`config/automation/config/${t}`),f=(e,t)=>e.callWS({type:"automation/config",entity_id:t}),g=(e,t,a)=>e.callApi("POST",`config/automation/config/${t}`,a),y=e=>{e=p(e);for(const t of["triggers","conditions","actions"]){const a=e[t];a&&!Array.isArray(a)&&(e[t]=[a])}return e},p=e=>("trigger"in e&&("triggers"in e||(e.triggers=e.trigger),delete e.trigger),"condition"in e&&("conditions"in e||(e.conditions=e.condition),delete e.condition),"action"in e&&("actions"in e||(e.actions=e.action),delete e.action),e.triggers&&(e.triggers=_(e.triggers)),e.actions&&(e.actions=(0,o.eR)(e.actions)),e),_=e=>e?Array.isArray(e)?e.map(_):("triggers"in e&&e.triggers&&(e.triggers=_(e.triggers)),"platform"in e&&("trigger"in e||(e.trigger=e.platform),delete e.platform),e):e,b=e=>{if(!e)return[];const t=[];return(0,n.r)(e).forEach((e=>{"triggers"in e?e.triggers&&t.push(...b(e.triggers)):t.push(e)})),t},v=(e,t)=>{h=e;const a=t?`?${(0,r.ou)({expanded:"1"})}`:"";(0,i.c)(`/config/automation/edit/new${a}`)},k=e=>{v({...e,id:void 0,alias:void 0})},w=()=>{const e=h;return h=void 0,e},x=(e,t,a,i)=>e.connection.subscribeMessage(t,{type:"subscribe_trigger",trigger:a,variables:i}),Z=(e,t,a)=>e.callWS({type:"test_condition",condition:t,variables:a})},99650:function(e,t,a){if(a.d(t,{B:()=>b,Ch:()=>c,Lr:()=>m,Mw:()=>p,T9:()=>f,Xn:()=>y,i4:()=>u,jU:()=>s,kU:()=>d,nk:()=>l,ou:()=>k,qW:()=>r,r:()=>g,sF:()=>o,z9:()=>w,zj:()=>v}),66977!=a.j)var i=a(86190);var n=a(43546);const o=66977!=a.j?[1,2,3,4,6,8]:null,r=2,d="hls",s="web_rtc",c=(e,t,a)=>`${e}&width=${t}&height=${a}`,l=e=>`/api/camera_proxy_stream/${e.entity_id}?token=${e.attributes.access_token}`,u=async(e,t,a,n)=>{const o=await(0,i.U)("_cameraTmbUrl",9e3,h,e,t);return c(o,a,n)},h=async(e,t)=>{const a=await(0,n.iI)(e,`/api/camera_proxy/${t}`);return e.hassUrl(a.path)},m=async(e,t,a)=>{const i={type:"camera/stream",entity_id:t};a&&(i.format=a);const n=await e.callWS(i);return n.url=e.hassUrl(n.url),n},f=(e,t,a,i)=>e.connection.subscribeMessage(i,{type:"camera/webrtc/offer",entity_id:t,offer:a}),g=(e,t,a,i)=>e.callWS({type:"camera/webrtc/candidate",entity_id:t,session_id:a,candidate:i}),y=(e,t)=>e.callWS({type:"camera/get_prefs",entity_id:t}),p=(e,t,a)=>e.callWS({type:"camera/update_prefs",entity_id:t,...a}),_="media-source://camera/",b=e=>e.startsWith(_),v=e=>e.substring(22),k=async(e,t)=>e.callWS({type:"camera/capabilities",entity_id:t}),w=async(e,t)=>e.callWS({type:"camera/webrtc/get_client_config",entity_id:t})},96194:function(e,t,a){a.d(t,{ON:()=>r,PX:()=>d,V_:()=>s,lz:()=>o,nZ:()=>n,rk:()=>l});var i=a(92636);const n="unavailable",o="unknown",r="on",d="off",s=[n,o],c=[n,o,d],l=(0,i.z)(s);(0,i.z)(c)},68418:function(e,t,a){a.d(t,{EH:()=>c,FI:()=>w,Kx:()=>h,Pw:()=>x,TL:()=>m,eM:()=>v,eR:()=>S,kC:()=>g,oE:()=>b,oR:()=>p,rg:()=>k,rq:()=>y,sf:()=>Z,vA:()=>l});a(9359),a(70104);var i=a(62900),n=a(92636),o=a(83523),r=a(14473);if(66977!=a.j)var d=a(97969);var s=a(58776);const c=99387==a.j?["single","restart","queued","parallel"]:null,l=(0,n.z)(["queued","parallel"]),u=(0,i.Ry)({alias:(0,i.jt)((0,i.Z_)()),continue_on_error:(0,i.jt)((0,i.O7)()),enabled:(0,i.jt)((0,i.O7)())}),h=(0,i.Ry)({entity_id:(0,i.jt)((0,i.G0)([(0,i.Z_)(),(0,i.IX)((0,i.Z_)())])),device_id:(0,i.jt)((0,i.G0)([(0,i.Z_)(),(0,i.IX)((0,i.Z_)())])),area_id:(0,i.jt)((0,i.G0)([(0,i.Z_)(),(0,i.IX)((0,i.Z_)())])),floor_id:(0,i.jt)((0,i.G0)([(0,i.Z_)(),(0,i.IX)((0,i.Z_)())])),label_id:(0,i.jt)((0,i.G0)([(0,i.Z_)(),(0,i.IX)((0,i.Z_)())]))}),m=(0,i.f0)(u,(0,i.Ry)({action:(0,i.jt)((0,i.Z_)()),service_template:(0,i.jt)((0,i.Z_)()),entity_id:(0,i.jt)((0,i.Z_)()),target:(0,i.jt)(h),data:(0,i.jt)((0,i.Ry)()),response_variable:(0,i.jt)((0,i.Z_)()),metadata:(0,i.jt)((0,i.Ry)())})),f=(0,i.f0)(u,(0,i.Ry)({action:(0,i.i0)("media_player.play_media"),target:(0,i.jt)((0,i.Ry)({entity_id:(0,i.jt)((0,i.Z_)())})),entity_id:(0,i.jt)((0,i.Z_)()),data:(0,i.Ry)({media_content_id:(0,i.Z_)(),media_content_type:(0,i.Z_)()}),metadata:(0,i.Ry)()})),g=(e,t,a)=>e.callService("script",t,a),y=e=>"off"===e.state||!!("on"===e.state&&l(e.attributes.mode)&&e.attributes.current<e.attributes.max),p=(e,t)=>e.callApi("DELETE",`config/script/config/${t}`);let _;const b=(e,t)=>e.callApi("GET",`config/script/config/${t}`),v=(e,t)=>e.callWS({type:"script/config",entity_id:t}),k=(e,t)=>{_=e;const a=t?`?${(0,s.ou)({expanded:"1"})}`:"";(0,o.c)(`/config/script/edit/new${a}`)},w=()=>{const e=_;return _=void 0,e},x=e=>"delay"in e?"delay":"wait_template"in e?"wait_template":["condition","and","or","not"].some((t=>t in e))?"check_condition":"event"in e?"fire_event":"device_id"in e?"device_action":"repeat"in e?"repeat":"choose"in e?"choose":"if"in e?"if":"wait_for_trigger"in e?"wait_for_trigger":"variables"in e?"variables":"stop"in e?"stop":"sequence"in e?"sequence":"parallel"in e?"parallel":"set_conversation_response"in e?"set_conversation_response":"action"in e||"service"in e?"metadata"in e&&(0,i.is)(e,f)?"play_media":"service":"unknown",Z=(e,t)=>{const a=e.services.script[(0,d.p)(t)]?.fields;return void 0!==a&&Object.keys(a).length>0},S=e=>{if(!e)return e;if(Array.isArray(e))return e.map(S);if("service"in e&&("action"in e||(e.action=e.service),delete e.service),"scene"in e&&(e.action="scene.turn_on",e.target={entity_id:e.scene},delete e.scene),"sequence"in e)for(const t of e.sequence)S(t);const t=x(e);if("parallel"===t){S(e.parallel)}if("choose"===t){const t=e;if(Array.isArray(t.choose))for(const e of t.choose)S(e.sequence);else t.choose&&S(t.choose.sequence);t.default&&S(t.default)}if("repeat"===t){S(e.repeat.sequence)}if("if"===t){const t=e;S(t.then),t.else&&S(t.else)}if("wait_for_trigger"===t){const t=e;(0,r.W9)(t.wait_for_trigger)}return e}}}; //# sourceMappingURL=69518.a8b304c9f2b649af.js.map