(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[6246],{63238:(t,i,e)=>{"use strict";e.r(i);var n=e(47181);class s extends HTMLElement{set hass(t){if(!this.content){const i=document.createElement("ha-card");this.content=document.createElement("div"),i.appendChild(this.content),i.style="background:none; width: 110px; border-radius: 52.5px; cursor: pointer;",this.appendChild(i),this.addEventListener("click",(function(){this._onClick(t)})),this.addEventListener("dblclick",(function(){this._onDbClick()}))}const i=this.config.entity,e=this.config.class||this.config.entity.replace(".","_");this.setAttribute("class",e);const n=t.states[i],s=this.config.image_on||"/static/ais_dom/design_tool/light_on.png",o=this.config.image_off||"/static/ais_dom/design_tool/light_off.png";if(n)if("on"===n.state){var c=n.attributes.rgb_color,a=n.attributes.hs_color,r="";a&&"255,255,255"!==c&&(r=" hue-rotate("+a[0]+"deg)");var h=n.attributes.brightness/205;this.content.innerHTML=`<img src="${s}" style="position: absolute; filter: opacity(${h}) ${r}!important;">`}else this.content.innerHTML=`<img src="${o}" class="${e}"  style="position: absolute;">`;else this.content.innerHTML=`<img src="${o}" class="${e}" style="position: absolute;">`}_onClick(t){const i=this.config.tap_action||"toggle";t.callService("light",i,{entity_id:this.config.entity})}_onDbClick(){(0,n.B)(this,"hass-more-info",{entityId:this.config.entity})}ready(){super.ready()}setConfig(t){if(!t.entity)throw new Error("You need to define an entity");this.config=t}getCardSize(){return 3}}customElements.define("hui-ais-light-card",s)}}]);
//# sourceMappingURL=chunk.31f261f0d312585b7a28.js.map