iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 5 kB
JavaScript
export const __webpack_ids__=["63519"];export const __webpack_modules__={84255:function(t,e,i){i.r(e);var n=i(44249),a=i(72621),o=(i(9359),i(56475),i(70104),i(57243)),s=i(15093),r=i(82393),d=i(36522),c=i(28816),u=i(47194),h=(i(54977),i(37583),i(3967)),l=i(69223),p=i(93331),g=i(62577);const f={moisture:"M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",temperature:"M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V8H11V5A1 1 0 0 1 12 4Z",brightness:"M3.55 19.09L4.96 20.5L6.76 18.71L5.34 17.29M12 6C8.69 6 6 8.69 6 12S8.69 18 12 18 18 15.31 18 12C18 8.68 15.31 6 12 6M20 13H23V11H20M17.24 18.71L19.04 20.5L20.45 19.09L18.66 17.29M20.45 5L19.04 3.6L17.24 5.39L18.66 6.81M13 1H11V4H13M6.76 5.39L4.96 3.6L3.55 5L5.34 6.81L6.76 5.39M1 13H4V11H1M13 20H11V23H13",conductivity:"M2,22V20C2,20 7,18 12,18C17,18 22,20 22,20V22H2M11.3,9.1C10.1,5.2 4,6.1 4,6.1C4,6.1 4.2,13.9 9.9,12.7C9.5,9.8 8,9 8,9C10.8,9 11,12.4 11,12.4V17C11.3,17 11.7,17 12,17C12.3,17 12.7,17 13,17V12.8C13,12.8 13,8.9 16,7.9C16,7.9 14,10.9 14,12.9C21,13.6 21,4 21,4C21,4 12.1,3 11.3,9.1Z",battery:void 0};(0,n.Z)([(0,s.Mo)("hui-plant-status-card")],(function(t,e){class n extends e{constructor(...e){super(...e),t(this)}}return{F:n,d:[{kind:"method",static:!0,key:"getConfigElement",value:async function(){return await i.e("24145").then(i.bind(i,27665)),document.createElement("hui-plant-status-card-editor")}},{kind:"method",static:!0,key:"getStubConfig",value:function(t,e,i){return{type:"plant-status",entity:(0,l.j)(t,1,e,i,["plant"])[0]||""}}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_config",value:void 0},{kind:"method",key:"getCardSize",value:function(){return 3}},{kind:"method",key:"setConfig",value:function(t){if(!t.entity||"plant"!==t.entity.split(".")[0])throw new Error("Specify an entity from within the plant domain");this._config=t}},{kind:"method",key:"shouldUpdate",value:function(t){return(0,p.G2)(this,t)}},{kind:"method",key:"updated",value:function(t){if((0,a.Z)(n,"updated",this,3)([t]),!this._config||!this.hass)return;const e=t.get("hass"),i=t.get("_config");e&&i&&e.themes===this.hass.themes&&i.theme===this._config.theme||(0,r.R)(this,this.hass.themes,this._config.theme)}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return o.Ld;const t=this.hass.states[this._config.entity];return t?o.dy` <ha-card class="${t.attributes.entity_picture?"has-plant-image":""}"> <div class="banner" style="background-image:url(${t.attributes.entity_picture})"> <div class="header"> ${this._config.name||(0,u.C)(t)} </div> </div> <div class="content"> ${this._computeAttributes(t).map((e=>o.dy` <div class="attributes" ="${this._handleMoreInfo}" .actionHandler="${(0,h.K)()}" tabindex="0" .value="${e}"> <div class="icon"> ${"battery"===e?o.dy`<ha-icon .icon="${(0,c.U)(t.attributes.battery)}"></ha-icon>`:o.dy`<ha-svg-icon .path="${f[e]}"></ha-svg-icon>`} </div> <div class="${-1===t.attributes.problem.indexOf(e)?"":"problem"}"> ${t.attributes[e]} </div> <div class="uom"> ${t.attributes.unit_of_measurement_dict[e]||""} </div> </div> `))} </div> </ha-card> `:o.dy` <hui-warning> ${(0,g.i)(this.hass,this._config.entity)} </hui-warning> `}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`ha-card{height:100%;box-sizing:border-box}.banner{display:flex;align-items:flex-end;background-repeat:no-repeat;background-size:cover;background-position:center;padding-top:12px}.has-plant-image .banner{padding-top:30%}.header{font-family:Roboto,Noto,sans-serif;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-size:24px;font-weight:400;letter-spacing:-.012em;line-height:40px;padding:8px 16px}.has-plant-image .header{font-size:16px;font-weight:500;line-height:16px;padding:16px;color:#fff;width:100%;background:rgba(0,0,0,var(--dark-secondary-opacity))}.content{display:flex;justify-content:space-between;padding:16px 32px 24px 32px}.has-plant-image .content{padding-bottom:16px}.icon{margin-bottom:8px}ha-icon,ha-svg-icon{color:var(--paper-item-icon-color)}.attributes{cursor:pointer}.attributes:focus{outline:0;background:var(--divider-color);border-radius:100%}.attributes div{text-align:center}.problem{color:var(--error-color);font-weight:700}.uom{color:var(--secondary-text-color)}`},{kind:"method",key:"_computeAttributes",value:function(t){return Object.keys(f).filter((e=>e in t.attributes))}},{kind:"method",key:"_handleMoreInfo",value:function(t){const e=t.currentTarget,i=this.hass.states[this._config.entity];e.value&&(0,d.B)(this,"hass-more-info",{entityId:i.attributes.sensors[e.value]})}}]}}),o.oi)}};
//# sourceMappingURL=63519.7f47fd583ce33a80.js.map