UNPKG

iobroker.lovelace

Version:

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

1 lines 6.98 kB
export const __rspack_esm_id=41243;export const __rspack_esm_ids=[41243];export const __webpack_modules__={48548(t,i,s){s.d(i,{R:()=>a,i:()=>e});const e=t=>{switch(t.attributes.device_class){case"awning":case"door":case"gate":case"curtain":return"M9,11H15V8L19,12L15,16V13H9V16L5,12L9,8V11M2,20V4H4V20H2M20,20V4H22V20H20Z";default:return"M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z"}},a=t=>{switch(t.attributes.device_class){case"awning":case"door":case"gate":case"curtain":return"M13,20V4H15.03V20H13M10,20V4H12.03V20H10M5,8L9.03,12L5,16V13H2V11H5V8M20,16L16,12L20,8V11H23V13H20V16Z";default:return"M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z"}}},7962(t,i,s){s.a(t,async function(t,i){try{var e=s(62826),a=s(5124),n=s(22441),o=s(6412),r=s(48548),c=s(82286),h=s(98079),l=s(26300),u=t([l]);l=(u.then?(await u)():u)[0];const _="M18,18H6V6H18V18Z";class p extends a.WF{render(){return this.stateObj?a.qy` <div class="state"> <ha-icon-button class="${(0,o.H)({hidden:!(0,c.$)(this.stateObj,h.Jp.OPEN)})}" .label="${this.hass.localize("ui.card.cover.open_cover")}" @click="${this._onOpenTap}" .disabled="${!(0,h.pc)(this.stateObj)}" .path="${(0,r.i)(this.stateObj)}"> </ha-icon-button> <ha-icon-button class="${(0,o.H)({hidden:!(0,c.$)(this.stateObj,h.Jp.STOP)})}" .label="${this.hass.localize("ui.card.cover.stop_cover")}" .path="${_}" @click="${this._onStopTap}" .disabled="${!(0,h.lg)(this.stateObj)}"></ha-icon-button> <ha-icon-button class="${(0,o.H)({hidden:!(0,c.$)(this.stateObj,h.Jp.CLOSE)})}" .label="${this.hass.localize("ui.card.cover.close_cover")}" @click="${this._onCloseTap}" .disabled="${!(0,h.hJ)(this.stateObj)}" .path="${(0,r.R)(this.stateObj)}"> </ha-icon-button> </div> `:a.s6}_onOpenTap(t){t.stopPropagation(),this.hass.callService("cover","open_cover",{entity_id:this.stateObj.entity_id})}_onCloseTap(t){t.stopPropagation(),this.hass.callService("cover","close_cover",{entity_id:this.stateObj.entity_id})}_onStopTap(t){t.stopPropagation(),this.hass.callService("cover","stop_cover",{entity_id:this.stateObj.entity_id})}}p.styles=a.AH`.state{white-space:nowrap}.hidden{visibility:hidden!important}`,(0,e.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,e.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"stateObj",void 0),p=(0,e.Cg)([(0,n.EM)("ha-cover-controls")],p),i()}catch(t){i(t)}})},69001(t,i,s){s.a(t,async function(t,i){try{var e=s(62826),a=s(5124),n=s(22441),o=s(6412),r=s(82286),c=s(98079),h=s(26300),l=t([h]);h=(l.then?(await l)():l)[0];const u="M19,6.41L17.59,5L7,15.59V9H5V19H15V17H8.41L19,6.41Z",_="M5,17.59L15.59,7H9V5H19V15H17V8.41L6.41,19L5,17.59Z",p="M18,18H6V6H18V18Z";class d extends a.WF{render(){return this.stateObj?a.qy` <ha-icon-button class="${(0,o.H)({invisible:!(0,r.$)(this.stateObj,c.Jp.OPEN_TILT)})}" .label="${this.hass.localize("ui.card.cover.open_tilt_cover")}" .path="${_}" @click="${this._onOpenTiltTap}" .disabled="${!(0,c.uB)(this.stateObj)}"></ha-icon-button> <ha-icon-button class="${(0,o.H)({invisible:!(0,r.$)(this.stateObj,c.Jp.STOP_TILT)})}" .label="${this.hass.localize("ui.card.cover.stop_cover")}" .path="${p}" @click="${this._onStopTiltTap}" .disabled="${!(0,c.UE)(this.stateObj)}"></ha-icon-button> <ha-icon-button class="${(0,o.H)({invisible:!(0,r.$)(this.stateObj,c.Jp.CLOSE_TILT)})}" .label="${this.hass.localize("ui.card.cover.close_tilt_cover")}" .path="${u}" @click="${this._onCloseTiltTap}" .disabled="${!(0,c.Yx)(this.stateObj)}"></ha-icon-button>`:a.s6}_onOpenTiltTap(t){t.stopPropagation(),this.hass.callService("cover","open_cover_tilt",{entity_id:this.stateObj.entity_id})}_onCloseTiltTap(t){t.stopPropagation(),this.hass.callService("cover","close_cover_tilt",{entity_id:this.stateObj.entity_id})}_onStopTiltTap(t){t.stopPropagation(),this.hass.callService("cover","stop_cover_tilt",{entity_id:this.stateObj.entity_id})}}d.styles=a.AH`:host{white-space:nowrap}.invisible{visibility:hidden!important}`,(0,e.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,e.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"stateObj",void 0),d=(0,e.Cg)([(0,n.EM)("ha-cover-tilt-controls")],d),i()}catch(t){i(t)}})},98079(t,i,s){s.d(i,{Av:()=>h,Et:()=>r,Jp:()=>o,MF:()=>u,UE:()=>O,Yx:()=>v,dx:()=>c,hJ:()=>p,lg:()=>d,nX:()=>l,ns:()=>T,pc:()=>_,uB:()=>b});var e=s(47129),a=s(82286),n=s(22675),o=function(t){return t[t.OPEN=1]="OPEN",t[t.CLOSE=2]="CLOSE",t[t.SET_POSITION=4]="SET_POSITION",t[t.STOP=8]="STOP",t[t.OPEN_TILT=16]="OPEN_TILT",t[t.CLOSE_TILT=32]="CLOSE_TILT",t[t.STOP_TILT=64]="STOP_TILT",t[t.SET_TILT_POSITION=128]="SET_TILT_POSITION",t}({});const r=[0,25,75,100],c=t=>(0,a.$)(t,4),h=t=>(0,a.$)(t,128),l=t=>c(t)||h(t);function u(t){const i=(0,a.$)(t,1)||(0,a.$)(t,2)||(0,a.$)(t,8);return((0,a.$)(t,16)||(0,a.$)(t,32)||(0,a.$)(t,64))&&!i}function _(t){if(t.state===n.Hh)return!1;return!0===t.attributes.assumed_state||!function(t){return void 0!==t.attributes.current_position?100===t.attributes.current_position:"open"===t.state}(t)&&!function(t){return"opening"===t.state}(t)}function p(t){if(t.state===n.Hh)return!1;return!0===t.attributes.assumed_state||!function(t){return void 0!==t.attributes.current_position?0===t.attributes.current_position:"closed"===t.state}(t)&&!function(t){return"closing"===t.state}(t)}function d(t){return t.state!==n.Hh}function b(t){if(t.state===n.Hh)return!1;return!0===t.attributes.assumed_state||!function(t){return 100===t.attributes.current_tilt_position}(t)}function v(t){if(t.state===n.Hh)return!1;return!0===t.attributes.assumed_state||!function(t){return 0===t.attributes.current_tilt_position}(t)}function O(t){return t.state!==n.Hh}function T(t,i,s){const a=(0,e.a)(t)?t.attributes.current_position??t.attributes.current_tilt_position:void 0,n=s??a;return n&&100!==n?i.formatEntityAttributeValue(t,"current_position",Math.round(n)):""}},79734(t,i,s){s.a(t,async function(t,e){try{s.r(i);var a=s(62826),n=s(5124),o=s(22441),r=s(7962),c=s(69001),h=s(98079),l=s(784),u=s(79757),_=s(85979),p=t([r,c,u,_]);[r,c,u,_]=p.then?(await p)():p;class d extends n.WF{setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}shouldUpdate(t){return(0,l.LX)(this,t)}render(){if(!this._config||!this.hass)return n.s6;const t=this.hass.states[this._config.entity];return t?n.qy` <hui-generic-entity-row .hass="${this.hass}" .config="${this._config}"> ${(0,h.MF)(t)?n.qy` <ha-cover-tilt-controls .hass="${this.hass}" .stateObj="${t}"></ha-cover-tilt-controls> `:n.qy` <ha-cover-controls .hass="${this.hass}" .stateObj="${t}"></ha-cover-controls> `} </hui-generic-entity-row> `:n.qy` <hui-warning .hass="${this.hass}"> ${(0,_.j)(this.hass,this._config.entity)} </hui-warning> `}}d.styles=n.AH`ha-cover-controls,ha-cover-tilt-controls{margin-right:-.57em;margin-inline-end:-.57em;margin-inline-start:initial}`,(0,a.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,a.Cg)([(0,o.wk)()],d.prototype,"_config",void 0),d=(0,a.Cg)([(0,o.EM)("hui-cover-entity-row")],d),e()}catch(t){e(t)}})}};