UNPKG

iobroker.lovelace

Version:

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

2 lines 5.22 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["63519"],{84255:function(t,e,i){i.r(e);var n=i(61701),a=i(72621),s=(i(52247),i(71695),i(9359),i(56475),i(70104),i(40251),i(47021),i(57243)),o=i(50778),r=i(82393),d=i(36522),c=i(28816),h=i(47194),u=(i(54977),i(37583),i(3967)),l=i(69223),p=i(93331),f=i(62577);let g,m,b,v,y,k,x=t=>t;const C={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,o.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,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.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 s.Ld;const t=this.hass.states[this._config.entity];return t?(0,s.dy)(m||(m=x` <ha-card class="${0}"> <div class="banner" style="background-image:url(${0})"> <div class="header"> ${0} </div> </div> <div class="content"> ${0} </div> </ha-card> `),t.attributes.entity_picture?"has-plant-image":"",t.attributes.entity_picture,this._config.name||(0,h.C)(t),this._computeAttributes(t).map((e=>(0,s.dy)(b||(b=x` <div class="attributes" @action="${0}" .actionHandler="${0}" tabindex="0" .value="${0}"> <div class="icon"> ${0} </div> <div class="${0}"> ${0} </div> <div class="uom"> ${0} </div> </div> `),this._handleMoreInfo,(0,u.K)(),e,"battery"===e?(0,s.dy)(v||(v=x`<ha-icon .icon="${0}"></ha-icon>`),(0,c.U)(t.attributes.battery)):(0,s.dy)(y||(y=x`<ha-svg-icon .path="${0}"></ha-svg-icon>`),C[e]),-1===t.attributes.problem.indexOf(e)?"":"problem",t.attributes[e],t.attributes.unit_of_measurement_dict[e]||"")))):(0,s.dy)(g||(g=x` <hui-warning> ${0} </hui-warning> `),(0,f.i)(this.hass,this._config.entity))}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(k||(k=x`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(C).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]})}}]}}),s.oi)}}]); //# sourceMappingURL=63519.0a8763ccc926c1d0.js.map