UNPKG

iobroker.lovelace

Version:

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

2 lines 7.98 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["50764"],{46631:function(t,e,i){i.d(e,{o:()=>s,q:()=>n});const n=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"}},s=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"}}},80588:function(t,e,i){var n=i(61701),s=(i(71695),i(47021),i(57243)),o=i(50778),a=i(35359),r=i(46631),c=i(75278),u=i(78304);i(23334);let l,h,d=t=>t;(0,n.Z)([(0,o.Mo)("ha-cover-controls")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(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:"method",key:"render",value:function(){return this.stateObj?(0,s.dy)(l||(l=d` <div class="state"> <ha-icon-button class="${0}" .label="${0}" @click="${0}" .disabled="${0}" .path="${0}"> </ha-icon-button> <ha-icon-button class="${0}" .label="${0}" .path="${0}" @click="${0}" .disabled="${0}"></ha-icon-button> <ha-icon-button class="${0}" .label="${0}" @click="${0}" .disabled="${0}" .path="${0}"> </ha-icon-button> </div> `),(0,a.$)({hidden:!(0,c.e)(this.stateObj,u.mk.OPEN)}),this.hass.localize("ui.card.cover.open_cover"),this._onOpenTap,!(0,u.g6)(this.stateObj),(0,r.q)(this.stateObj),(0,a.$)({hidden:!(0,c.e)(this.stateObj,u.mk.STOP)}),this.hass.localize("ui.card.cover.stop_cover"),"M18,18H6V6H18V18Z",this._onStopTap,!(0,u.qY)(this.stateObj),(0,a.$)({hidden:!(0,c.e)(this.stateObj,u.mk.CLOSE)}),this.hass.localize("ui.card.cover.close_cover"),this._onCloseTap,!(0,u.Lg)(this.stateObj),(0,r.o)(this.stateObj)):s.Ld}},{kind:"method",key:"_onOpenTap",value:function(t){t.stopPropagation(),this.hass.callService("cover","open_cover",{entity_id:this.stateObj.entity_id})}},{kind:"method",key:"_onCloseTap",value:function(t){t.stopPropagation(),this.hass.callService("cover","close_cover",{entity_id:this.stateObj.entity_id})}},{kind:"method",key:"_onStopTap",value:function(t){t.stopPropagation(),this.hass.callService("cover","stop_cover",{entity_id:this.stateObj.entity_id})}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(h||(h=d`.state{white-space:nowrap}.hidden{visibility:hidden!important}`))}}]}}),s.oi)},22969:function(t,e,i){var n=i(61701),s=(i(71695),i(47021),i(57243)),o=i(50778),a=i(35359),r=i(75278),c=i(78304);i(23334);let u,l,h=t=>t;(0,n.Z)([(0,o.Mo)("ha-cover-tilt-controls")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(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:"method",key:"render",value:function(){return this.stateObj?(0,s.dy)(u||(u=h` <ha-icon-button class="${0}" .label="${0}" .path="${0}" @click="${0}" .disabled="${0}"></ha-icon-button> <ha-icon-button class="${0}" .label="${0}" .path="${0}" @click="${0}" .disabled="${0}"></ha-icon-button> <ha-icon-button class="${0}" .label="${0}" .path="${0}" @click="${0}" .disabled="${0}"></ha-icon-button>`),(0,a.$)({invisible:!(0,r.e)(this.stateObj,c.mk.OPEN_TILT)}),this.hass.localize("ui.card.cover.open_tilt_cover"),"M5,17.59L15.59,7H9V5H19V15H17V8.41L6.41,19L5,17.59Z",this._onOpenTiltTap,!(0,c.NE)(this.stateObj),(0,a.$)({invisible:!(0,r.e)(this.stateObj,c.mk.STOP_TILT)}),this.hass.localize("ui.card.cover.stop_cover"),"M18,18H6V6H18V18Z",this._onStopTiltTap,!(0,c.JB)(this.stateObj),(0,a.$)({invisible:!(0,r.e)(this.stateObj,c.mk.CLOSE_TILT)}),this.hass.localize("ui.card.cover.close_tilt_cover"),"M19,6.41L17.59,5L7,15.59V9H5V19H15V17H8.41L19,6.41Z",this._onCloseTiltTap,!(0,c.oc)(this.stateObj)):s.Ld}},{kind:"method",key:"_onOpenTiltTap",value:function(t){t.stopPropagation(),this.hass.callService("cover","open_cover_tilt",{entity_id:this.stateObj.entity_id})}},{kind:"method",key:"_onCloseTiltTap",value:function(t){t.stopPropagation(),this.hass.callService("cover","close_cover_tilt",{entity_id:this.stateObj.entity_id})}},{kind:"method",key:"_onStopTiltTap",value:function(t){t.stopPropagation(),this.hass.callService("cover","stop_cover_tilt",{entity_id:this.stateObj.entity_id})}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(l||(l=h`:host{white-space:nowrap}.invisible{visibility:hidden!important}`))}}]}}),s.oi)},78304:function(t,e,i){i.d(e,{JB:()=>v,L3:()=>_,Lg:()=>u,NE:()=>h,g6:()=>c,mk:()=>a,oc:()=>d,pu:()=>r,qY:()=>l});var n=i(5839),s=i(75278),o=i(96194);let a=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}({});function r(t){const e=(0,s.e)(t,a.OPEN)||(0,s.e)(t,a.CLOSE)||(0,s.e)(t,a.STOP);return((0,s.e)(t,a.OPEN_TILT)||(0,s.e)(t,a.CLOSE_TILT)||(0,s.e)(t,a.STOP_TILT))&&!e}function c(t){if(t.state===o.nZ)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 u(t){if(t.state===o.nZ)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 l(t){return t.state!==o.nZ}function h(t){if(t.state===o.nZ)return!1;return!0===t.attributes.assumed_state||!function(t){return 100===t.attributes.current_tilt_position}(t)}function d(t){if(t.state===o.nZ)return!1;return!0===t.attributes.assumed_state||!function(t){return 0===t.attributes.current_tilt_position}(t)}function v(t){return t.state!==o.nZ}function _(t,e,i){var s;const o=(0,n.v)(t)?null!==(s=t.attributes.current_position)&&void 0!==s?s:t.attributes.current_tilt_position:void 0,a=null!=i?i:o;return a&&100!==a?e.formatEntityAttributeValue(t,"current_position",Math.round(a)):""}},4806:function(t,e,i){i.a(t,(async function(t,n){try{i.r(e);var s=i(61701),o=(i(52247),i(71695),i(47021),i(57243)),a=i(50778),r=(i(80588),i(22969),i(78304)),c=i(93331),u=i(8069),l=i(62577),h=t([u]);u=(h.then?(await h)():h)[0];let d,v,_,b,p,f=t=>t;(0,s.Z)([(0,a.Mo)("hui-cover-entity-row")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(t){if(!t)throw new Error("Invalid configuration");this._config=t}},{kind:"method",key:"shouldUpdate",value:function(t){return(0,c.G2)(this,t)}},{kind:"method",key:"render",value:function(){if(!this._config||!this.hass)return o.Ld;const t=this.hass.states[this._config.entity];return t?(0,o.dy)(v||(v=f` <hui-generic-entity-row .hass="${0}" .config="${0}"> ${0} </hui-generic-entity-row> `),this.hass,this._config,(0,r.pu)(t)?(0,o.dy)(_||(_=f` <ha-cover-tilt-controls .hass="${0}" .stateObj="${0}"></ha-cover-tilt-controls> `),this.hass,t):(0,o.dy)(b||(b=f` <ha-cover-controls .hass="${0}" .stateObj="${0}"></ha-cover-controls> `),this.hass,t)):(0,o.dy)(d||(d=f` <hui-warning> ${0} </hui-warning> `),(0,l.i)(this.hass,this._config.entity))}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(p||(p=f`ha-cover-controls,ha-cover-tilt-controls{margin-right:-.57em;margin-inline-end:-.57em;margin-inline-start:initial}`))}}]}}),o.oi);n()}catch(d){n(d)}}))}}]); //# sourceMappingURL=50764.f8488539dffc48d6.js.map