iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
24 lines (20 loc) • 7.64 kB
JavaScript
/*! For license information please see chunk.e9f932579d720876e683.js.LICENSE.txt */
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[9555,1823],{63207:(t,e,n)=>{"use strict";n(65660),n(15112);var r=n(9672),i=n(87156),o=n(50856),s=n(43437);(0,r.k)({_template:o.d`
<style>
:host {
@apply --layout-inline;
@apply --layout-center-center;
position: relative;
vertical-align: middle;
fill: var(--iron-icon-fill-color, currentcolor);
stroke: var(--iron-icon-stroke-color, none);
width: var(--iron-icon-width, 24px);
height: var(--iron-icon-height, 24px);
@apply --iron-icon;
}
:host([hidden]) {
display: none;
}
</style>
`,is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:s.XY.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(t){var e=(t||"").split(":");this._iconName=e.pop(),this._iconsetName=e.pop()||this._DEFAULT_ICONSET,this._updateIcon()},_srcChanged:function(t){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&(0,i.vz)(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&(this._iconset=this._meta.byKey(this._iconsetName),this._iconset?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&&this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,(0,i.vz)(this.root).appendChild(this._img))}})},15112:(t,e,n)=>{"use strict";n.d(e,{P:()=>i});n(43437);var r=n(9672);class i{constructor(t){i[" "](t),this.type=t&&t.type||"default",this.key=t&&t.key,t&&"value"in t&&(this.value=t.value)}get value(){var t=this.type,e=this.key;if(t&&e)return i.types[t]&&i.types[t][e]}set value(t){var e=this.type,n=this.key;e&&n&&(e=i.types[e]=i.types[e]||{},null==t?delete e[n]:e[n]=t)}get list(){if(this.type){var t=i.types[this.type];return t?Object.keys(t).map((function(t){return o[this.type][t]}),this):[]}}byKey(t){return this.key=t,this.value}}i[" "]=function(){},i.types={};var o=i.types;(0,r.k)({is:"iron-meta",properties:{type:{type:String,value:"default"},key:{type:String},value:{type:String,notify:!0},self:{type:Boolean,observer:"_selfChanged"},__meta:{type:Boolean,computed:"__computeMeta(type, key, value)"}},hostAttributes:{hidden:!0},__computeMeta:function(t,e,n){var r=new i({type:t,key:e});return void 0!==n&&n!==r.value?r.value=n:this.value!==r.value&&(this.value=r.value),r},get list(){return this.__meta&&this.__meta.list},_selfChanged:function(t){t&&(this.value=this)},byKey:function(t){return new i({type:this.type,key:t}).value}})},68928:(t,e,n)=>{"use strict";n.d(e,{WU:()=>b});var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,i="[1-9]\\d?",o="\\d\\d",s="[^\\s]+",a=/\[([^]*?)\]/gm;function u(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}var c=function(t){return function(e,n){var r=n[t].map((function(t){return t.toLowerCase()})).indexOf(e.toLowerCase());return r>-1?r:null}};function h(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var s in o)t[s]=o[s]}return t}var d=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"],l=u(m,3),f={dayNamesShort:u(d,3),dayNames:d,monthNamesShort:l,monthNames:m,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}},p=h({},f),g=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},y={D:function(t){return String(t.getDate())},DD:function(t){return g(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return g(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return g(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return g(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return g(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return g(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return g(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return g(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return g(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return g(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return g(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+g(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+g(Math.floor(Math.abs(e)/60),2)+":"+g(Math.abs(e)%60,2)}},_=function(t){return+t-1},v=[null,i],M=[null,s],S=["isPm",s,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],D=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?n:-n}return 0}],Y=(c("monthNamesShort"),c("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"}),b=function(t,e,n){if(void 0===e&&(e=Y.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var i=[];e=(e=Y[e]||e).replace(a,(function(t,e){return i.push(e),"@@@"}));var o=h(h({},p),n);return(e=e.replace(r,(function(e){return y[e](t,o)}))).replace(/@@@/g,(function(){return i.shift()}))}},58993:(t,e,n)=>{"use strict";n.d(e,{yh:()=>r,U2:()=>s,t8:()=>a,ZH:()=>u});class r{constructor(t="keyval-store",e="keyval"){this.storeName=e,this._dbp=new Promise(((n,r)=>{const i=indexedDB.open(t,1);i.onerror=()=>r(i.error),i.onsuccess=()=>n(i.result),i.onupgradeneeded=()=>{i.result.createObjectStore(e)}}))}_withIDBStore(t,e){return this._dbp.then((n=>new Promise(((r,i)=>{const o=n.transaction(this.storeName,t);o.oncomplete=()=>r(),o.onabort=o.onerror=()=>i(o.error),e(o.objectStore(this.storeName))}))))}}let i;function o(){return i||(i=new r),i}function s(t,e=o()){let n;return e._withIDBStore("readonly",(e=>{n=e.get(t)})).then((()=>n.result))}function a(t,e,n=o()){return n._withIDBStore("readwrite",(n=>{n.put(e,t)}))}function u(t=o()){return t._withIDBStore("readwrite",(t=>{t.clear()}))}}}]);
//# sourceMappingURL=chunk.e9f932579d720876e683.js.map