diff --git a/config/.HA_VERSION b/config/.HA_VERSION index fc795aad..b0db10da 100755 --- a/config/.HA_VERSION +++ b/config/.HA_VERSION @@ -1 +1 @@ -2023.1.4 \ No newline at end of file +2023.4.0 \ No newline at end of file diff --git a/config/automation/Pool_Deck_lights.yaml b/config/automation/Pool_Deck_lights.yaml index ed4f36b0..84d980ce 100755 --- a/config/automation/Pool_Deck_lights.yaml +++ b/config/automation/Pool_Deck_lights.yaml @@ -24,7 +24,7 @@ entity_id: binary_sensor.MCU2_GPIO12 state: 'on' - condition: numeric_state - entity_id: sensor.dark_sky_temperature + entity_id: sensor.pirateweather_temperature below: 80 action: diff --git a/config/automation/Speech/High_Wind_Speed_Check.yaml b/config/automation/Speech/High_Wind_Speed_Check.yaml index 4da76192..1f6732e1 100755 --- a/config/automation/Speech/High_Wind_Speed_Check.yaml +++ b/config/automation/Speech/High_Wind_Speed_Check.yaml @@ -7,13 +7,13 @@ mode: single trigger: - platform: numeric_state - entity_id: sensor.dark_sky_wind_speed + entity_id: sensor.pirateweather_wind_speed above: 24 - platform: numeric_state - entity_id: sensor.dark_sky_wind_speed + entity_id: sensor.pirateweather_wind_speed above: 40 - platform: numeric_state - entity_id: sensor.dark_sky_wind_speed + entity_id: sensor.pirateweather_wind_speed above: 60 action: @@ -21,7 +21,7 @@ data: title: 'VERY HIGH WINDS:' value1: >- - {% set windspeed = states.sensor.dark_sky_wind_speed.state | round %} + {% set windspeed = states.sensor.pirateweather_wind_speed.state | round %} {% if ( windspeed > 25 ) and ( windspeed <= 40 ) %} HEAVY WINDS!!! Current Wind Speed is : {{windspeed}} mph! Be VERY careful outdoors! {% elif ( windspeed > 40 ) and ( windspeed <= 60 ) %} @@ -38,7 +38,7 @@ - service: script.speech_engine data: value1: > - {% set windspeed = states.sensor.dark_sky_wind_speed.state | round %} + {% set windspeed = states.sensor.pirateweather_wind_speed.state | round %} {% if ( windspeed > 25 ) and ( windspeed <= 40 ) %} HEAVY WINDS!!! Current Wind Speed is : {{windspeed}} mph! Be VERY careful outdoors! {% elif ( windspeed > 40 ) and ( windspeed <= 60 ) %} @@ -54,7 +54,7 @@ - service: script.tweet_engine_no_image data: tweet: > - {% set windspeed = states.sensor.dark_sky_wind_speed.state | round %} + {% set windspeed = states.sensor.pirateweather_wind_speed.state | round %} {% if ( windspeed > 25 ) and ( windspeed <= 40 ) %} HEAVY WINDS!!! Current Wind Speed is : {{windspeed}} mph! Be VERY careful outdoors! #Florida #Weather (https://amzn.to/2jQLpVQ) {% elif ( windspeed > 40 ) and ( windspeed <= 60 ) %} diff --git a/config/automation/dark_rainy_day.yaml b/config/automation/dark_rainy_day.yaml index 7dfdabc4..3e6a3ba7 100755 --- a/config/automation/dark_rainy_day.yaml +++ b/config/automation/dark_rainy_day.yaml @@ -8,10 +8,10 @@ trigger: - platform: state - entity_id: sensor.dark_sky_precip + entity_id: sensor.pirateweather_precip to: 'rain' - platform: numeric_state - entity_id: sensor.dark_sky_precip_intensity + entity_id: sensor.pirateweather_precip_intensity above: 0.2 - platform: numeric_state entity_id: sensor.blitzortung_lightning_counter @@ -31,10 +31,10 @@ - condition: or conditions: - condition: numeric_state - entity_id: sensor.dark_sky_cloud_coverage + entity_id: sensor.pirateweather_cloud_coverage above: 90 - condition: numeric_state - entity_id: sensor.dark_sky_precip_intensity + entity_id: sensor.pirateweather_precip_intensity above: 0.2 - condition: numeric_state entity_id: sensor.blitzortung_lightning_counter diff --git a/config/automation/zwave_hallway_door_sensor.yaml b/config/automation/zwave_hallway_door_sensor.yaml index 36d17839..af532dad 100755 --- a/config/automation/zwave_hallway_door_sensor.yaml +++ b/config/automation/zwave_hallway_door_sensor.yaml @@ -22,7 +22,7 @@ after: sunset after_offset: '-03:00:00' - condition: numeric_state - entity_id: sensor.dark_sky_cloud_coverage + entity_id: sensor.pirateweather_cloud_coverage above: 50 action: diff --git a/config/group/weather.yaml b/config/group/weather.yaml index 38cc7eae..4a6197c7 100755 --- a/config/group/weather.yaml +++ b/config/group/weather.yaml @@ -6,15 +6,15 @@ Weather: - climate.upstairs - sensor.upstairs_thermostat_humidity - binary_sensor.upstairs_nest_away - - sensor.dark_sky_cloud_coverage - - sensor.dark_sky_minutely_summary -# - sensor.dark_sky_nearest_storm_distance - - sensor.dark_sky_precip_intensity - - sensor.dark_sky_daily_max_precip_intensity - - sensor.dark_sky_wind_speed - - sensor.dark_sky_humidity - - sensor.dark_sky_temperature - - sensor.dark_sky_uv_index + - sensor.pirateweather_cloud_coverage + - sensor.pirateweather_minutely_summary +# - sensor.pirateweather_nearest_storm_distance + - sensor.pirateweather_precip_intensity + - sensor.pirateweather_daily_max_precip_intensity + - sensor.pirateweather_wind_speed + - sensor.pirateweather_humidity + - sensor.pirateweather_temperature + - sensor.pirateweather_uv_index - sensor.moon - binary_sensor.iss - sensor.launch_window diff --git a/config/packages/rachio.yaml b/config/packages/rachio.yaml index 01865f85..0a52a9b5 100755 --- a/config/packages/rachio.yaml +++ b/config/packages/rachio.yaml @@ -59,8 +59,8 @@ automation: trigger: - platform: numeric_state entity_id: - - sensor.dark_sky_precip_intensity_max - - sensor.dark_sky_precip_intensity + - sensor.pirateweather_precip_intensity_max + - sensor.pirateweather_precip_intensity above: 0.5 - platform: numeric_state entity_id: sensor.dark_sky_wind_speed diff --git a/config/script/tweet.yaml b/config/script/tweet.yaml index d3df557e..29628039 100755 --- a/config/script/tweet.yaml +++ b/config/script/tweet.yaml @@ -124,15 +124,15 @@ tweet_engine_random: "weather": [ "The #Landscaping lights where on for about {{ states.sensor.landscaping_light_time.attributes.value }} yesterday. (https://youtu.be/FcBVu_yk2iY)", - "I keep the average humidity of the house at {{ states('sensor.downstairs_thermostat_humidity') }} percent. Outside is {{ states('sensor.dark_sky_humidity') }} #Nest (https://github.com/CCOSTAN/Home-AssistantConfig#nest)", - "Outside is {{ states('sensor.dark_sky_temperature') }}. I keep the average inside temperature at {{ states('sensor.downstairs_thermostat_temperature') }}. #Weather (https://github.com/CCOSTAN/Home-AssistantConfig#nest)", - "I know that it will be {{ states('sensor.dark_sky_minutely_summary') }} So I will adjust the Heating/Cooling, irrigation and lighting accordingly. #Nest #Rachio #Hue", - "The current UV index is {{ states('sensor.dark_sky_uv_index') }} and the Moon is {{ states('sensor.moon') }}. #Space" + "I keep the average humidity of the house at {{ states('sensor.downstairs_thermostat_humidity') }} percent. Outside is {{ states('sensor.pirateweather_humidity') }} #Nest (https://github.com/CCOSTAN/Home-AssistantConfig#nest)", + "Outside is {{ states('sensor.pirateweather_temperature') }}. I keep the average inside temperature at {{ states('sensor.downstairs_thermostat_temperature') }}. #Weather (https://github.com/CCOSTAN/Home-AssistantConfig#nest)", + "I know that it will be {{ states('sensor.pirateweather_minutely_summary') }} So I will adjust the Heating/Cooling, irrigation and lighting accordingly. #Nest #Rachio #Hue", + "The current UV index is {{ states('sensor.pirateweather_uv_index') }} and the Moon is {{ states('sensor.moon') }}. #Space" ], "cloud": [ - "Average Cloud Coverage: {{ states('sensor.dark_sky_cloud_coverage') }}%, Average Temp: {{ states('sensor.dark_sky_temperature') }}°F #Solar (https://www.vcloudinfo.com/2018/01/going-green-to-save-some-green-in-2018.html)", - "Unfortunately, Bear Stone has plenty of cloud dependancies. Nimbus and Cumulus to be exact! Average Cloud Coverage: {{ states('sensor.dark_sky_cloud_coverage') }}% " + "Average Cloud Coverage: {{ states('sensor.pirateweather_cloud_coverage') }}%, Average Temp: {{ states('sensor.pirateweather_temperature') }}°F #Solar (https://www.vcloudinfo.com/2018/01/going-green-to-save-some-green-in-2018.html)", + "Unfortunately, Bear Stone has plenty of cloud dependancies. Nimbus and Cumulus to be exact! Average Cloud Coverage: {{ states('sensor.pirateweather_cloud_coverage') }}% " ], "speedtest": [ diff --git a/config/sensor/weather.yaml b/config/sensor/weather.yaml index e3edcbd3..2b377210 100755 --- a/config/sensor/weather.yaml +++ b/config/sensor/weather.yaml @@ -1,21 +1,21 @@ -- platform: darksky - api_key: !secret forecast_key - monitored_conditions: - - summary - - precip_type - - precip_intensity - - precip_intensity_max - - temperature -# - dew_point - - wind_speed -# - wind_bearing - - cloud_cover - - humidity -# - nearest_storm_distance - - minutely_summary -# - pressure -# - visibility -# - ozone - - uv_index - - sunrise_time - - sunset_time +# - platform: darksky +# api_key: !secret forecast_key +# monitored_conditions: +# - summary +# - precip_type +# - precip_intensity +# - precip_intensity_max +# - temperature +# # - dew_point +# - wind_speed +# # - wind_bearing +# - cloud_cover +# - humidity +# # - nearest_storm_distance +# - minutely_summary +# # - pressure +# # - visibility +# # - ozone +# - uv_index +# - sunrise_time +# - sunset_time diff --git a/config/templates/speech/briefing.yaml b/config/templates/speech/briefing.yaml index 093dd146..5d0840a9 100755 --- a/config/templates/speech/briefing.yaml +++ b/config/templates/speech/briefing.yaml @@ -32,7 +32,7 @@ {%- endmacro -%} {%- macro outside_weather() -%} - Outside, it is going to be {{ states('sensor.dark_sky_minutely_summary') }} + Outside, it is going to be {{ states('sensor.pirateweather_minutely_summary') }} {%- endmacro -%} {%- macro lightning() -%} @@ -138,12 +138,12 @@ {%- endmacro -%} {%- macro uv() -%} - {% if states.sensor.dark_sky_uv_index.state|int(9999)>= 6 and states.sensor.dark_sky_uv_index.state|int(9999)<= 7.9 %} - Today's UV index is {{ states.sensor.dark_sky_uv_index.state }}. You should wear sunscreen if going outside. - {% elif states.sensor.dark_sky_uv_index.state|int(9999)>= 8 and states.sensor.dark_sky_uv_index.state|int(9999)<=10.9 %} - Today's UV index is {{ states.sensor.dark_sky_uv_index.state }}. This is VERY HIGH. Be sure wear sunscreen and re-apply. - {% elif states.sensor.dark_sky_uv_index.state|int(9999)>= 11 %} - Today's UV index is {{ states.sensor.dark_sky_uv_index.state }}. This is EXTREME. You should be very cautious going outside. + {% if states.sensor.pirateweather_uv_index.state|int(9999)>= 6 and states.sensor.pirateweather_uv_index.state|int(9999)<= 7.9 %} + Today's UV index is {{ states.sensor.pirateweather_uv_index.state }}. You should wear sunscreen if going outside. + {% elif states.sensor.pirateweather_uv_index.state|int(9999)>= 8 and states.sensor.pirateweather_uv_index.state|int(9999)<=10.9 %} + Today's UV index is {{ states.sensor.pirateweather_uv_index.state }}. This is VERY HIGH. Be sure wear sunscreen and re-apply. + {% elif states.sensor.pirateweather_uv_index.state|int(9999)>= 11 %} + Today's UV index is {{ states.sensor.pirateweather_uv_index.state }}. This is EXTREME. You should be very cautious going outside. {% endif %} {%- endmacro -%} diff --git a/config/www/community/button-card/button-card.js b/config/www/community/button-card/button-card.js new file mode 100644 index 00000000..874a5517 --- /dev/null +++ b/config/www/community/button-card/button-card.js @@ -0,0 +1,547 @@ +function t(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}const e="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=(t,e,i=null)=>{for(;e!==i;){const i=e.nextSibling;t.removeChild(e),e=i}},n=`{{lit-${String(Math.random()).slice(2)}}}`,r=`\x3c!--${n}--\x3e`,s=new RegExp(`${n}|${r}`),a="$lit$";class o{constructor(t,e){this.parts=[],this.element=e;const i=[],r=[],o=document.createTreeWalker(e.content,133,null,!1);let c=0,d=-1,p=0;const{strings:f,values:{length:m}}=t;for(;p0;){const e=f[p],i=u.exec(e)[2],n=i.toLowerCase()+a,r=t.getAttribute(n);t.removeAttribute(n);const o=r.split(s);this.parts.push({type:"attribute",index:d,name:i,strings:o}),p+=o.length-1}}"TEMPLATE"===t.tagName&&(r.push(t),o.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(n)>=0){const n=t.parentNode,r=e.split(s),o=r.length-1;for(let e=0;e{const i=t.length-e.length;return i>=0&&t.slice(i)===e},c=t=>-1!==t.index,h=()=>document.createComment(""),u=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function d(t,e){const{element:{content:i},parts:n}=t,r=document.createTreeWalker(i,133,null,!1);let s=f(n),a=n[s],o=-1,l=0;const c=[];let h=null;for(;r.nextNode();){o++;const t=r.currentNode;for(t.previousSibling===h&&(h=null),e.has(t)&&(c.push(t),null===h&&(h=t)),null!==h&&l++;void 0!==a&&a.index===o;)a.index=null!==h?-1:a.index-l,s=f(n,s),a=n[s]}c.forEach((t=>t.parentNode.removeChild(t)))}const p=t=>{let e=11===t.nodeType?0:1;const i=document.createTreeWalker(t,133,null,!1);for(;i.nextNode();)e++;return e},f=(t,e=-1)=>{for(let i=e+1;i(...e)=>{const i=t(...e);return m.set(i,!0),i},_=t=>"function"==typeof t&&m.has(t),b={},y={};class v{constructor(t,e,i){this.__parts=[],this.template=t,this.processor=e,this.options=i}update(t){let e=0;for(const i of this.__parts)void 0!==i&&i.setValue(t[e]),e++;for(const i of this.__parts)void 0!==i&&i.commit()}_clone(){const t=e?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),i=[],n=this.template.parts,r=document.createTreeWalker(t,133,null,!1);let s,a=0,o=0,l=r.nextNode();for(;at}),S=` ${n} `;class x{constructor(t,e,i,n){this.strings=t,this.values=e,this.type=i,this.processor=n}getHTML(){const t=this.strings.length-1;let e="",i=!1;for(let s=0;s-1||i)&&-1===t.indexOf("--\x3e",o+1);const l=u.exec(t);e+=null===l?t+(i?S:r):t.substr(0,l.index)+l[1]+l[2]+a+l[3]+n}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");let e=this.getHTML();return void 0!==w&&(e=w.createHTML(e)),t.innerHTML=e,t}}const k=t=>null===t||!("object"==typeof t||"function"==typeof t),O=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class T{constructor(t,e,i){this.dirty=!0,this.element=t,this.name=e,this.strings=i,this.parts=[];for(let n=0;n{try{const t={get capture(){return N=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();class j{constructor(t,e,i){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=i,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;_(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=b,t(this)}if(this.__pendingValue===b)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),n=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),n&&(this.__options=$(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=b}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const $=t=>t&&(N?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);function H(t){let e=R.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},R.set(t.type,e));let i=e.stringsArray.get(t.strings);if(void 0!==i)return i;const r=t.strings.join(n);return i=e.keyString.get(r),void 0===i&&(i=new o(t,t.getTemplateElement()),e.keyString.set(r,i)),e.stringsArray.set(t.strings,i),i}const R=new Map,V=new WeakMap;const D=new class{handleAttributeExpressions(t,e,i,n){const r=e[0];if("."===r){return new P(t,e.slice(1),i).parts}if("@"===r)return[new j(t,e.slice(1),n.eventContext)];if("?"===r)return[new E(t,e.slice(1),i)];return new T(t,e,i).parts}handleTextExpression(t){return new C(t)}};"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const L=(t,...e)=>new x(t,e,"html",D),F=(t,e)=>`${t}--${e}`;let I=!0;void 0===window.ShadyCSS?I=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),I=!1);const z=t=>e=>{const i=F(e.type,t);let r=R.get(i);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},R.set(i,r));let s=r.stringsArray.get(e.strings);if(void 0!==s)return s;const a=e.strings.join(n);if(s=r.keyString.get(a),void 0===s){const i=e.getTemplateElement();I&&window.ShadyCSS.prepareTemplateDom(i,t),s=new o(e,i),r.keyString.set(a,s)}return r.stringsArray.set(e.strings,s),s},U=["html","svg"],q=new Set,Y=(t,e,i)=>{q.add(t);const n=i?i.element:document.createElement("template"),r=e.querySelectorAll("style"),{length:s}=r;if(0===s)return void window.ShadyCSS.prepareTemplateStyles(n,t);const a=document.createElement("style");for(let c=0;c{U.forEach((e=>{const i=R.get(F(e,t));void 0!==i&&i.keyString.forEach((t=>{const{element:{content:e}}=t,i=new Set;Array.from(e.querySelectorAll("style")).forEach((t=>{i.add(t)})),d(t,i)}))}))})(t);const o=n.content;i?function(t,e,i=null){const{element:{content:n},parts:r}=t;if(null==i)return void n.appendChild(e);const s=document.createTreeWalker(n,133,null,!1);let a=f(r),o=0,l=-1;for(;s.nextNode();)for(l++,s.currentNode===i&&(o=p(e),i.parentNode.insertBefore(e,i));-1!==a&&r[a].index===l;){if(o>0){for(;-1!==a;)r[a].index+=o,a=f(r,a);return}a=f(r,a)}}(i,a,o.firstChild):o.insertBefore(a,o.firstChild),window.ShadyCSS.prepareTemplateStyles(n,t);const l=o.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(i){o.insertBefore(a,o.firstChild);const t=new Set;t.add(a),d(i,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const B={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},W=(t,e)=>e!==t&&(e==e||t==t),G={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:W},Z="finalized";class J extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach(((e,i)=>{const n=this._attributeNameForProperty(i,e);void 0!==n&&(this._attributeToPropertyMap.set(n,i),t.push(n))})),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach(((t,e)=>this._classProperties.set(e,t)))}}static createProperty(t,e=G){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const i="symbol"==typeof t?Symbol():`__${t}`,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const r=this[t];this[e]=n,this.requestUpdateInternal(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this._classProperties&&this._classProperties.get(t)||G}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty(Z)||t.finalize(),this[Z]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const i of e)this.createProperty(i,t[i])}}static _attributeNameForProperty(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,i=W){return i(t,e)}static _propertyValueFromAttribute(t,e){const i=e.type,n=e.converter||B,r="function"==typeof n?n:n.fromAttribute;return r?r(t,i):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const i=e.type,n=e.converter;return(n&&n.toAttribute||B.toAttribute)(t,i)}initialize(){this._updateState=0,this._updatePromise=new Promise((t=>this._enableUpdatingResolver=t)),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach(((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}}))}_applyInstanceProperties(){this._instanceProperties.forEach(((t,e)=>this[e]=t)),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,i){e!==i&&this._attributeToProperty(t,i)}_propertyToAttribute(t,e,i=G){const n=this.constructor,r=n._attributeNameForProperty(t,i);if(void 0!==r){const t=n._propertyValueToAttribute(e,i);if(void 0===t)return;this._updateState=8|this._updateState,null==t?this.removeAttribute(r):this.setAttribute(r,t),this._updateState=-9&this._updateState}}_attributeToProperty(t,e){if(8&this._updateState)return;const i=this.constructor,n=i._attributeToPropertyMap.get(t);if(void 0!==n){const t=i.getPropertyOptions(n);this._updateState=16|this._updateState,this[n]=i._propertyValueFromAttribute(e,t),this._updateState=-17&this._updateState}}requestUpdateInternal(t,e,i){let n=!0;if(void 0!==t){const r=this.constructor;i=i||r.getPropertyOptions(t),r._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):n=!1}!this._hasRequestedUpdate&&n&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const t=this.performUpdate();return null!=t&&await t,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{t=this.shouldUpdate(e),t?this.update(e):this._markUpdated()}catch(i){throw t=!1,this._markUpdated(),i}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach(((t,e)=>this._propertyToAttribute(e,this[e],t))),this._reflectingProperties=void 0),this._markUpdated()}updated(t){}firstUpdated(t){}}J[Z]=!0;const X=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher(i){i.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function K(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):X(t,e)}const Q=(t,e,i)=>{Object.defineProperty(e,i,t)},tt=(t,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:t});const et=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,it=Symbol();class nt{constructor(t,e){if(e!==it)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(et?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const rt={};class st extends J{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,i)=>t.reduceRight(((t,i)=>Array.isArray(i)?e(i,t):(t.add(i),t)),i),i=e(t,new Set),n=[];i.forEach((t=>n.unshift(t))),this._styles=n}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!et){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new nt(String(e),it)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?et?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==rt&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return rt}}st.finalized=!0,st.render=(t,e,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const r=n.scopeName,s=V.has(e),a=I&&11===e.nodeType&&!!e.host,o=a&&!q.has(r),l=o?document.createDocumentFragment():e;if(((t,e,n)=>{let r=V.get(e);void 0===r&&(i(e,e.firstChild),V.set(e,r=new C(Object.assign({templateFactory:H},n))),r.appendInto(e)),r.setValue(t),r.commit()})(t,l,Object.assign({templateFactory:z(r)},n)),o){const t=V.get(l);V.delete(l);const n=t.value instanceof v?t.value.template:void 0;Y(r,l,n),i(e,e.firstChild),e.appendChild(l),V.set(e,t)}!s&&a&&window.ShadyCSS.styleElement(e.host)};class at{constructor(t){this.startPress=e=>{t().then((t=>{t&&t.startPress(e)}))},this.endPress=()=>{t().then((t=>{t&&t.endPress()}))},this.startFocus=()=>{t().then((t=>{t&&t.startFocus()}))},this.endFocus=()=>{t().then((t=>{t&&t.endFocus()}))},this.startHover=()=>{t().then((t=>{t&&t.startHover()}))},this.endHover=()=>{t().then((t=>{t&&t.endHover()}))}}}const ot=new WeakMap,lt=g((t=>e=>{if(!(e instanceof M)||e instanceof A||"style"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `styleMap` directive must be used in the style attribute and must be the only part in the attribute.");const{committer:i}=e,{style:n}=i.element;let r=ot.get(e);void 0===r&&(n.cssText=i.strings.join(" "),ot.set(e,r=new Set)),r.forEach((e=>{e in t||(r.delete(e),-1===e.indexOf("-")?n[e]=null:n.removeProperty(e))}));for(const s in t)r.add(s),-1===s.indexOf("-")?n[s]=t[s]:n.setProperty(s,t[s])})),ct=new WeakMap,ht=g((t=>e=>{if(!(e instanceof C))throw new Error("unsafeHTML can only be used in text bindings");const i=ct.get(e);if(void 0!==i&&k(t)&&t===i.value&&e.value===i.fragment)return;const n=document.createElement("template");n.innerHTML=t;const r=document.importNode(n.content,!0);e.setValue(r),ct.set(e,{value:t,fragment:r})}));class ut{constructor(t){this.classes=new Set,this.changed=!1,this.element=t;const e=(t.getAttribute("class")||"").split(/\s+/);for(const i of e)this.classes.add(i)}add(t){this.classes.add(t),this.changed=!0}remove(t){this.classes.delete(t),this.changed=!0}commit(){if(this.changed){let t="";this.classes.forEach((e=>t+=e+" ")),this.element.setAttribute("class",t)}}}const dt=new WeakMap,pt=g((t=>e=>{if(!(e instanceof M)||e instanceof A||"class"!==e.committer.name||e.committer.parts.length>1)throw new Error("The `classMap` directive must be used in the `class` attribute and must be the only part in the attribute.");const{committer:i}=e,{element:n}=i;let r=dt.get(e);void 0===r&&(n.setAttribute("class",i.strings.join(" ")),dt.set(e,r=new Set));const s=n.classList||new ut(n);r.forEach((e=>{e in t||(s.remove(e),r.delete(e))}));for(const a in t){const e=t[a];e!=r.has(a)&&(e?(s.add(a),r.add(a)):(s.remove(a),r.delete(a)))}"function"==typeof s.commit&&s.commit()}));var ft=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,mt="[1-9]\\d?",gt="\\d\\d",_t="[^\\s]+",bt=/\[([^]*?)\]/gm;function yt(t,e){for(var i=[],n=0,r=t.length;n-1?r:null}};function wt(t){for(var e=[],i=1;i3?0:(t-t%10!=10?1:0)*t%10]}},Tt=wt({},Ot),Mt=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+Mt(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Mt(Math.floor(Math.abs(e)/60),2)+":"+Mt(Math.abs(e)%60,2)}},Et=function(t){return+t-1},Pt=[null,mt],At=[null,_t],Nt=["isPm",_t,function(t,e){var i=t.toLowerCase();return i===e.amPm[0]?0:i===e.amPm[1]?1:null}],jt=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var i=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?i:-i}return 0}],$t=(vt("monthNamesShort"),vt("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var Ht=function(t,e,i){if(void 0===e&&(e=$t.default),void 0===i&&(i={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var n=[];e=(e=$t[e]||e).replace(bt,(function(t,e){return n.push(e),"@@@"}));var r=wt(wt({},Tt),i);return(e=e.replace(ft,(function(e){return Ct[e](t,r)}))).replace(/@@@/g,(function(){return n.shift()}))};function Rt(t){var e=t.split(":").map(Number);return 3600*e[0]+60*e[1]+e[2]}var Vt=function(){try{(new Date).toLocaleDateString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleDateString(e,{year:"numeric",month:"long",day:"numeric"})}:function(t){return Ht(t,"mediumDate")},Dt=function(){try{(new Date).toLocaleString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleString(e,{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}:function(t){return Ht(t,"haDateTime")},Lt=function(){try{(new Date).toLocaleTimeString("i")}catch(t){return"RangeError"===t.name}return!1}()?function(t,e){return t.toLocaleTimeString(e,{hour:"numeric",minute:"2-digit"})}:function(t){return Ht(t,"shortTime")},Ft=function(t){return t<10?"0"+t:t};function It(t){return t.substr(0,t.indexOf("."))}var zt="hass:bookmark",Ut=["closed","locked","off"],qt=new Set(["fan","input_boolean","light","switch","group","automation"]),Yt=function(t,e,i,n){n=n||{},i=null==i?{}:i;var r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,t.dispatchEvent(r),r},Bt=new Set(["call-service","divider","section","weblink","cast","select"]),Wt={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},Gt={alert:"hass:alert",automation:"hass:playlist-play",calendar:"hass:calendar",camera:"hass:video",climate:"hass:thermostat",configurator:"hass:settings",conversation:"hass:text-to-speech",device_tracker:"hass:account",fan:"hass:fan",group:"hass:google-circles-communities",history_graph:"hass:chart-line",homeassistant:"hass:home-assistant",homekit:"hass:home-automation",image_processing:"hass:image-filter-frames",input_boolean:"hass:drawing",input_datetime:"hass:calendar-clock",input_number:"hass:ray-vertex",input_select:"hass:format-list-bulleted",input_text:"hass:textbox",light:"hass:lightbulb",mailbox:"hass:mailbox",notify:"hass:comment-alert",person:"hass:account",plant:"hass:flower",proximity:"hass:apple-safari",remote:"hass:remote",scene:"hass:google-pages",script:"hass:file-document",sensor:"hass:eye",simple_alarm:"hass:bell",sun:"hass:white-balance-sunny",switch:"hass:flash",timer:"hass:timer",updater:"hass:cloud-upload",vacuum:"hass:robot-vacuum",water_heater:"hass:thermometer",weblink:"hass:open-in-new"};function Zt(t,e){if(t in Gt)return Gt[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"hass:bell-plus";case"armed_night":return"hass:bell-sleep";case"disarmed":return"hass:bell-outline";case"triggered":return"hass:bell-ring";default:return"hass:bell"}case"binary_sensor":return e&&"off"===e?"hass:radiobox-blank":"hass:checkbox-marked-circle";case"cover":return"closed"===e?"hass:window-closed":"hass:window-open";case"lock":return e&&"unlocked"===e?"hass:lock-open":"hass:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"hass:cast-connected":"hass:cast";case"zwave":switch(e){case"dead":return"hass:emoticon-dead";case"sleeping":return"hass:sleep";case"initializing":return"hass:timer-sand";default:return"hass:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),zt}}var Jt=function(t){Yt(window,"haptic",t)},Xt=function(t,e){return function(t,e,i){void 0===i&&(i=!0);var n,r=It(e),s="group"===r?"homeassistant":r;switch(r){case"lock":n=i?"unlock":"lock";break;case"cover":n=i?"open_cover":"close_cover";break;default:n=i?"turn_on":"turn_off"}return t.callService(s,n,{entity_id:e})}(t,e,Ut.includes(t.states[e].state))},Kt=function(t,e,i,n,r){var s;if(r&&i.double_tap_action?s=i.double_tap_action:n&&i.hold_action?s=i.hold_action:!n&&i.tap_action&&(s=i.tap_action),s||(s={action:"more-info"}),!s.confirmation||s.confirmation.exemptions&&s.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(s.confirmation.text||"Are you sure you want to "+s.action+"?"))switch(s.action){case"more-info":(s.entity||i.entity||i.camera_image)&&(Yt(t,"hass-more-info",{entityId:s.entity?s.entity:i.entity?i.entity:i.camera_image}),s.haptic&&Jt(s.haptic));break;case"navigate":s.navigation_path&&(function(t,e,i){void 0===i&&(i=!1),i?history.replaceState(null,"",e):history.pushState(null,"",e),Yt(window,"location-changed",{replace:i})}(0,s.navigation_path),s.haptic&&Jt(s.haptic));break;case"url":s.url_path&&window.open(s.url_path),s.haptic&&Jt(s.haptic);break;case"toggle":i.entity&&(Xt(e,i.entity),s.haptic&&Jt(s.haptic));break;case"call-service":if(!s.service)return;var a=s.service.split(".",2),o=a[0],l=a[1],c=Object.assign({},s.service_data);"entity"===c.entity_id&&(c.entity_id=i.entity),e.callService(o,l,c),s.haptic&&Jt(s.haptic);break;case"fire-dom-event":Yt(t,"ll-custom",s),s.haptic&&Jt(s.haptic)}},Qt={humidity:"hass:water-percent",illuminance:"hass:brightness-5",temperature:"hass:thermometer",pressure:"hass:gauge",power:"hass:flash",signal_strength:"hass:wifi"},te={binary_sensor:function(t){var e=t.state&&"off"===t.state;switch(t.attributes.device_class){case"battery":return e?"hass:battery":"hass:battery-outline";case"cold":return e?"hass:thermometer":"hass:snowflake";case"connectivity":return e?"hass:server-network-off":"hass:server-network";case"door":return e?"hass:door-closed":"hass:door-open";case"garage_door":return e?"hass:garage":"hass:garage-open";case"gas":case"power":case"problem":case"safety":case"smoke":return e?"hass:shield-check":"hass:alert";case"heat":return e?"hass:thermometer":"hass:fire";case"light":return e?"hass:brightness-5":"hass:brightness-7";case"lock":return e?"hass:lock":"hass:lock-open";case"moisture":return e?"hass:water-off":"hass:water";case"motion":return e?"hass:walk":"hass:run";case"occupancy":case"presence":return e?"hass:home-outline":"hass:home";case"opening":return e?"hass:square":"hass:square-outline";case"plug":return e?"hass:power-plug-off":"hass:power-plug";case"sound":return e?"hass:music-note-off":"hass:music-note";case"vibration":return e?"hass:crop-portrait":"hass:vibrate";case"window":return e?"hass:window-closed":"hass:window-open";default:return e?"hass:radiobox-blank":"hass:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"hass:garage-open":"hass:garage";case"door":return e?"hass:door-open":"hass:door-closed";case"shutter":return e?"hass:window-shutter-open":"hass:window-shutter";case"blind":return e?"hass:blinds-open":"hass:blinds";case"window":return e?"hass:window-open":"hass:window-closed";default:return Zt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in Qt)return Qt[e];if("battery"===e){var i=Number(t.state);if(isNaN(i))return"hass:battery-unknown";var n=10*Math.round(i/10);return n>=100?"hass:battery":n<=0?"hass:battery-alert":"hass:battery-"+n}var r=t.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"hass:thermometer":Zt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?Zt("input_datetime"):"hass:calendar":"hass:clock"}};const ee=(t,e,i,n)=>{n=n||{},i=null==i?{}:i;const r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,t.dispatchEvent(r),r},ie=(t,e)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let i,n;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(!ie(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!ie(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(t[i]!==e[i])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const r=Object.keys(t);if(n=r.length,n!==Object.keys(e).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(e,r[i]))return!1;for(i=n;0!=i--;){const n=r[i];if(!ie(t[n],e[n]))return!1}return!0}return t!=t&&e!=e},ne="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;class re extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.cancelled=!1,this.isRepeating=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"fixed",width:ne?"100px":"50px",height:ne?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((t=>{document.addEventListener(t,(()=>{this.cancelled=!0,this.timer&&(this.stopAnimation(),clearTimeout(this.timer),this.timer=void 0,this.isRepeating&&this.repeatTimeout&&(clearInterval(this.repeatTimeout),this.isRepeating=!1))}),{passive:!0})}))}bind(t,e){t.actionHandler&&ie(e,t.actionHandler.options)||(t.actionHandler?(t.removeEventListener("touchstart",t.actionHandler.start),t.removeEventListener("touchend",t.actionHandler.end),t.removeEventListener("touchcancel",t.actionHandler.end),t.removeEventListener("mousedown",t.actionHandler.start),t.removeEventListener("click",t.actionHandler.end),t.removeEventListener("keyup",t.actionHandler.handleEnter)):t.addEventListener("contextmenu",(t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1})),t.actionHandler={options:e},e.disabled||(t.actionHandler.start=i=>{let n,r;this.cancelled=!1,i.touches?(n=i.touches[0].clientX,r=i.touches[0].clientY):(n=i.clientX,r=i.clientY),e.hasHold&&(this.held=!1,this.timer=window.setTimeout((()=>{this.startAnimation(n,r),this.held=!0,e.repeat&&!this.isRepeating&&(this.isRepeating=!0,this.repeatTimeout=setInterval((()=>{ee(t,"action",{action:"hold"})}),e.repeat))}),this.holdTime))},t.actionHandler.end=t=>{if(["touchend","touchcancel"].includes(t.type)&&this.cancelled)return void(this.isRepeating&&this.repeatTimeout&&(clearInterval(this.repeatTimeout),this.isRepeating=!1));const i=t.target;t.cancelable&&t.preventDefault(),e.hasHold&&(clearTimeout(this.timer),this.isRepeating&&this.repeatTimeout&&clearInterval(this.repeatTimeout),this.isRepeating=!1,this.stopAnimation(),this.timer=void 0),e.hasHold&&this.held?e.repeat||ee(i,"action",{action:"hold"}):e.hasDoubleClick?"click"===t.type&&t.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,ee(i,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,ee(i,"action",{action:"double_tap"})):ee(i,"action",{action:"tap"})},t.actionHandler.handleEnter=t=>{13===t.keyCode&&t.currentTarget.actionHandler.end(t)},t.addEventListener("touchstart",t.actionHandler.start,{passive:!0}),t.addEventListener("touchend",t.actionHandler.end),t.addEventListener("touchcancel",t.actionHandler.end),t.addEventListener("mousedown",t.actionHandler.start,{passive:!0}),t.addEventListener("click",t.actionHandler.end),t.addEventListener("keyup",t.actionHandler.handleEnter)))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.startPress(),this.ripple.unbounded=!0}stopAnimation(){this.ripple.endPress(),this.ripple.disabled=!0,this.style.display="none"}}customElements.define("button-card-action-handler",re);const se=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("button-card-action-handler"))return t.querySelector("button-card-action-handler");const e=document.createElement("button-card-action-handler");return t.appendChild(e),e})();i&&i.bind(t,e)},ae=g(((t={})=>e=>{se(e.committer.element,t)}));function oe(t,e){(function(t){return"string"==typeof t&&t.includes(".")&&1===parseFloat(t)})(t)&&(t="100%");var i=function(t){return"string"==typeof t&&t.includes("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),i&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function le(t){return Math.min(1,Math.max(0,t))}function ce(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function he(t){return t<=1?100*Number(t)+"%":t}function ue(t){return 1===t.length?"0"+t:String(t)}function de(t,e,i){t=oe(t,255),e=oe(e,255),i=oe(i,255);var n=Math.max(t,e,i),r=Math.min(t,e,i),s=0,a=0,o=(n+r)/2;if(n===r)a=0,s=0;else{var l=n-r;switch(a=o>.5?l/(2-n-r):l/(n+r),n){case t:s=(e-i)/l+(e1&&(i-=1),i<1/6?t+6*i*(e-t):i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function fe(t,e,i){t=oe(t,255),e=oe(e,255),i=oe(i,255);var n=Math.max(t,e,i),r=Math.min(t,e,i),s=0,a=n,o=n-r,l=0===n?0:o/n;if(n===r)s=0;else{switch(n){case t:s=(e-i)/o+(e>16,g:(65280&t)>>8,b:255&t}}(e)),this.originalInput=e;var r=ye(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(n=i.format)&&void 0!==n?n:r.format,this.gradientType=i.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return t.prototype.isDark=function(){return this.getBrightness()<128},t.prototype.isLight=function(){return!this.isDark()},t.prototype.getBrightness=function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},t.prototype.getLuminance=function(){var t=this.toRgb(),e=t.r/255,i=t.g/255,n=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},t.prototype.getAlpha=function(){return this.a},t.prototype.setAlpha=function(t){return this.a=ce(t),this.roundA=Math.round(100*this.a)/100,this},t.prototype.toHsv=function(){var t=fe(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}},t.prototype.toHsvString=function(){var t=fe(this.r,this.g,this.b),e=Math.round(360*t.h),i=Math.round(100*t.s),n=Math.round(100*t.v);return 1===this.a?"hsv("+e+", "+i+"%, "+n+"%)":"hsva("+e+", "+i+"%, "+n+"%, "+this.roundA+")"},t.prototype.toHsl=function(){var t=de(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}},t.prototype.toHslString=function(){var t=de(this.r,this.g,this.b),e=Math.round(360*t.h),i=Math.round(100*t.s),n=Math.round(100*t.l);return 1===this.a?"hsl("+e+", "+i+"%, "+n+"%)":"hsla("+e+", "+i+"%, "+n+"%, "+this.roundA+")"},t.prototype.toHex=function(t){return void 0===t&&(t=!1),me(this.r,this.g,this.b,t)},t.prototype.toHexString=function(t){return void 0===t&&(t=!1),"#"+this.toHex(t)},t.prototype.toHex8=function(t){return void 0===t&&(t=!1),function(t,e,i,n,r){var s,a=[ue(Math.round(t).toString(16)),ue(Math.round(e).toString(16)),ue(Math.round(i).toString(16)),ue((s=n,Math.round(255*parseFloat(s)).toString(16)))];return r&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this.r,this.g,this.b,this.a,t)},t.prototype.toHex8String=function(t){return void 0===t&&(t=!1),"#"+this.toHex8(t)},t.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},t.prototype.toRgbString=function(){var t=Math.round(this.r),e=Math.round(this.g),i=Math.round(this.b);return 1===this.a?"rgb("+t+", "+e+", "+i+")":"rgba("+t+", "+e+", "+i+", "+this.roundA+")"},t.prototype.toPercentageRgb=function(){var t=function(t){return Math.round(100*oe(t,255))+"%"};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},t.prototype.toPercentageRgbString=function(){var t=function(t){return Math.round(100*oe(t,255))};return 1===this.a?"rgb("+t(this.r)+"%, "+t(this.g)+"%, "+t(this.b)+"%)":"rgba("+t(this.r)+"%, "+t(this.g)+"%, "+t(this.b)+"%, "+this.roundA+")"},t.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var t="#"+me(this.r,this.g,this.b,!1),e=0,i=Object.entries(be);e=0;return e||!n||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),i||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()},t.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},t.prototype.clone=function(){return new t(this.toString())},t.prototype.lighten=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.l+=e/100,i.l=le(i.l),new t(i)},t.prototype.brighten=function(e){void 0===e&&(e=10);var i=this.toRgb();return i.r=Math.max(0,Math.min(255,i.r-Math.round(-e/100*255))),i.g=Math.max(0,Math.min(255,i.g-Math.round(-e/100*255))),i.b=Math.max(0,Math.min(255,i.b-Math.round(-e/100*255))),new t(i)},t.prototype.darken=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.l-=e/100,i.l=le(i.l),new t(i)},t.prototype.tint=function(t){return void 0===t&&(t=10),this.mix("white",t)},t.prototype.shade=function(t){return void 0===t&&(t=10),this.mix("black",t)},t.prototype.desaturate=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.s-=e/100,i.s=le(i.s),new t(i)},t.prototype.saturate=function(e){void 0===e&&(e=10);var i=this.toHsl();return i.s+=e/100,i.s=le(i.s),new t(i)},t.prototype.greyscale=function(){return this.desaturate(100)},t.prototype.spin=function(e){var i=this.toHsl(),n=(i.h+e)%360;return i.h=n<0?360+n:n,new t(i)},t.prototype.mix=function(e,i){void 0===i&&(i=50);var n=this.toRgb(),r=new t(e).toRgb(),s=i/100;return new t({r:(r.r-n.r)*s+n.r,g:(r.g-n.g)*s+n.g,b:(r.b-n.b)*s+n.b,a:(r.a-n.a)*s+n.a})},t.prototype.analogous=function(e,i){void 0===e&&(e=6),void 0===i&&(i=30);var n=this.toHsl(),r=360/i,s=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,s.push(new t(n));return s},t.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new t(e)},t.prototype.monochromatic=function(e){void 0===e&&(e=6);for(var i=this.toHsv(),n=i.h,r=i.s,s=i.v,a=[],o=1/e;e--;)a.push(new t({h:n,s:r,v:s})),s=(s+o)%1;return a},t.prototype.splitcomplement=function(){var e=this.toHsl(),i=e.h;return[this,new t({h:(i+72)%360,s:e.s,l:e.l}),new t({h:(i+216)%360,s:e.s,l:e.l})]},t.prototype.triad=function(){return this.polyad(3)},t.prototype.tetrad=function(){return this.polyad(4)},t.prototype.polyad=function(e){for(var i=this.toHsl(),n=i.h,r=[this],s=360/e,a=1;at&&"object"==typeof t;return t.reduce(((t,i)=>(Object.keys(i).forEach((n=>{const r=t[n],s=i[n];Array.isArray(r)&&Array.isArray(s)?t[n]=r.concat(...s):e(r)&&e(s)?t[n]=Pe(r,s):t[n]=s})),t)),{})}function Ae(t,e){let i=[];return t&&t.forEach((t=>{let n=t;e&&e.forEach((e=>{e.id&&t.id&&e.id==t.id&&(n=Pe(n,e))})),i.push(n)})),e&&(i=i.concat(e.filter((e=>!t||!t.find((t=>!(!t.id||!e.id)&&t.id==e.id)))))),i}const Ne=((t,...e)=>{const i=e.reduce(((e,i,n)=>e+(t=>{if(t instanceof nt)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[n+1]),t[0]);return new nt(i,it)})` + :host { + position: relative; + display: block; + } + ha-card { + cursor: pointer; + overflow: hidden; + box-sizing: border-box; + position: relative; + display: flex; + justify-content: center; + align-items: center; + line-height: normal; + + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Old versions of Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently + supported by Chrome, Opera and Firefox */ + } + ha-card.disabled { + pointer-events: none; + cursor: default; + } + :host(.tooltip) .tooltiptext { + pointer-events: none; + opacity: 0; + text-align: center; + padding: 4px; + border-radius: var(--ha-card-border-radius, 4px); + box-shadow: var( + --ha-card-box-shadow, + 0px 2px 1px -1px rgba(0, 0, 0, 0.2), + 0px 1px 1px 0px rgba(0, 0, 0, 0.14), + 0px 1px 3px 0px rgba(0, 0, 0, 0.12) + ); + background: var(--ha-card-background, var(--card-background-color, white)); + border: 1px solid var(--primary-text-color); + color: var(--primary-text-color); + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 9999; + } + :host(.tooltip:hover) span.tooltiptext { + opacity: 1; + transition-delay: 1.5s; + } + ha-icon { + display: inline-block; + margin: auto; + --mdc-icon-size: 100%; + --iron-icon-width: 100%; + --iron-icon-height: 100%; + } + ha-card.button-card-main { + padding: 4% 0px; + text-transform: none; + font-weight: 400; + font-size: 1.2rem; + align-items: center; + text-align: center; + letter-spacing: normal; + width: 100%; + } + .ellipsis { + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + } + #overlay { + align-items: flex-start; + justify-content: flex-end; + padding: 8px 7px; + opacity: 0.5; + /* DO NOT override items below */ + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 50; + display: flex; + } + #lock { + -webkit-animation-fill-mode: both; + animation-fill-mode: both; + margin: unset; + width: 24px; + } + .invalid { + animation: blink 1s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite; + } + .hidden { + visibility: hidden; + opacity: 0; + transition: visibility 0s 1s, opacity 1s linear; + } + @keyframes blink { + 0% { + opacity: 0; + } + 50% { + opacity: 1; + } + 100% { + opacity: 0; + } + } + @-webkit-keyframes rotating /* Safari and Chrome */ { + from { + -webkit-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + to { + -webkit-transform: rotate(360deg); + -o-transform: rotate(360deg); + transform: rotate(360deg); + } + } + @keyframes rotating { + from { + -ms-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + to { + -ms-transform: rotate(360deg); + -moz-transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -o-transform: rotate(360deg); + transform: rotate(360deg); + } + } + [rotating] { + -webkit-animation: rotating 2s linear infinite; + -moz-animation: rotating 2s linear infinite; + -ms-animation: rotating 2s linear infinite; + -o-animation: rotating 2s linear infinite; + animation: rotating 2s linear infinite; + } + + #container { + display: grid; + width: 100%; + height: 100%; + text-align: center; + align-items: center; + } + #img-cell { + display: flex; + grid-area: i; + height: 100%; + width: 100%; + max-width: 100%; + max-height: 100%; + align-self: center; + justify-self: center; + overflow: hidden; + justify-content: center; + align-items: center; + position: relative; + } + + ha-icon#icon { + height: 100%; + width: 100%; + max-height: 100%; + position: absolute; + } + img#icon { + display: block; + height: auto; + width: 100%; + position: absolute; + } + #name { + grid-area: n; + max-width: 100%; + align-self: center; + justify-self: center; + /* margin: auto; */ + } + #state { + grid-area: s; + max-width: 100%; + align-self: center; + justify-self: center; + /* margin: auto; */ + } + + #label { + grid-area: l; + max-width: 100%; + align-self: center; + justify-self: center; + } + + #container.vertical { + grid-template-areas: 'i' 'n' 's' 'l'; + grid-template-columns: 1fr; + grid-template-rows: 1fr min-content min-content min-content; + } + /* Vertical No Icon */ + #container.vertical.no-icon { + grid-template-areas: 'n' 's' 'l'; + grid-template-columns: 1fr; + grid-template-rows: 1fr min-content 1fr; + } + #container.vertical.no-icon #state { + align-self: center; + } + #container.vertical.no-icon #name { + align-self: end; + } + #container.vertical.no-icon #label { + align-self: start; + } + + /* Vertical No Icon No Name */ + #container.vertical.no-icon.no-name { + grid-template-areas: 's' 'l'; + grid-template-columns: 1fr; + grid-template-rows: 1fr 1fr; + } + #container.vertical.no-icon.no-name #state { + align-self: end; + } + #container.vertical.no-icon.no-name #label { + align-self: start; + } + + /* Vertical No Icon No State */ + #container.vertical.no-icon.no-state { + grid-template-areas: 'n' 'l'; + grid-template-columns: 1fr; + grid-template-rows: 1fr 1fr; + } + #container.vertical.no-icon.no-state #name { + align-self: end; + } + #container.vertical.no-icon.no-state #label { + align-self: start; + } + + /* Vertical No Icon No Label */ + #container.vertical.no-icon.no-label { + grid-template-areas: 'n' 's'; + grid-template-columns: 1fr; + grid-template-rows: 1fr 1fr; + } + #container.vertical.no-icon.no-label #name { + align-self: end; + } + #container.vertical.no-icon.no-label #state { + align-self: start; + } + + /* Vertical No Icon No Label No Name */ + #container.vertical.no-icon.no-label.no-name { + grid-template-areas: 's'; + grid-template-columns: 1fr; + grid-template-rows: 1fr; + } + #container.vertical.no-icon.no-label.no-name #state { + align-self: center; + } + /* Vertical No Icon No Label No State */ + #container.vertical.no-icon.no-label.no-state { + grid-template-areas: 'n'; + grid-template-columns: 1fr; + grid-template-rows: 1fr; + } + #container.vertical.no-icon.no-label.no-state #name { + align-self: center; + } + + /* Vertical No Icon No Name No State */ + #container.vertical.no-icon.no-name.no-state { + grid-template-areas: 'l'; + grid-template-columns: 1fr; + grid-template-rows: 1fr; + } + #container.vertical.no-icon.no-name.no-state #label { + align-self: center; + } + + #container.icon_name_state { + grid-template-areas: 'i n' 'l l'; + grid-template-columns: 40% 1fr; + grid-template-rows: 1fr min-content; + } + + #container.icon_name { + grid-template-areas: 'i n' 's s' 'l l'; + grid-template-columns: 40% 1fr; + grid-template-rows: 1fr min-content min-content; + } + + #container.icon_state { + grid-template-areas: 'i s' 'n n' 'l l'; + grid-template-columns: 40% 1fr; + grid-template-rows: 1fr min-content min-content; + } + + #container.name_state { + grid-template-areas: 'i' 'n' 'l'; + grid-template-columns: 1fr; + grid-template-rows: 1fr min-content min-content; + } + #container.name_state.no-icon { + grid-template-areas: 'n' 'l'; + grid-template-columns: 1fr; + grid-template-rows: 1fr 1fr; + } + #container.name_state.no-icon #name { + align-self: end; + } + #container.name_state.no-icon #label { + align-self: start; + } + + #container.name_state.no-icon.no-label { + grid-template-areas: 'n'; + grid-template-columns: 1fr; + grid-template-rows: 1fr; + } + #container.name_state.no-icon.no-label #name { + align-self: center; + } + + /* icon_name_state2nd default */ + #container.icon_name_state2nd { + grid-template-areas: 'i n' 'i s' 'i l'; + grid-template-columns: 40% 1fr; + grid-template-rows: 1fr min-content 1fr; + } + #container.icon_name_state2nd #name { + align-self: end; + } + #container.icon_name_state2nd #state { + align-self: center; + } + #container.icon_name_state2nd #label { + align-self: start; + } + + /* icon_name_state2nd No Label */ + #container.icon_name_state2nd.no-label { + grid-template-areas: 'i n' 'i s'; + grid-template-columns: 40% 1fr; + grid-template-rows: 1fr 1fr; + } + #container.icon_name_state2nd #name { + align-self: end; + } + #container.icon_name_state2nd #state { + align-self: start; + } + + /* icon_state_name2nd Default */ + #container.icon_state_name2nd { + grid-template-areas: 'i s' 'i n' 'i l'; + grid-template-columns: 40% 1fr; + grid-template-rows: 1fr min-content 1fr; + } + #container.icon_state_name2nd #state { + align-self: end; + } + #container.icon_state_name2nd #name { + align-self: center; + } + #container.icon_state_name2nd #label { + align-self: start; + } + + /* icon_state_name2nd No Label */ + #container.icon_state_name2nd.no-label { + grid-template-areas: 'i s' 'i n'; + grid-template-columns: 40% 1fr; + grid-template-rows: 1fr 1fr; + } + #container.icon_state_name2nd #state { + align-self: end; + } + #container.icon_state_name2nd #name { + align-self: start; + } + + #container.icon_label { + grid-template-areas: 'i l' 'n n' 's s'; + grid-template-columns: 40% 1fr; + grid-template-rows: 1fr min-content min-content; + } + + [style*='--aspect-ratio'] > :first-child { + width: 100%; + } + [style*='--aspect-ratio'] > img { + height: auto; + } + @supports (--custom: property) { + [style*='--aspect-ratio'] { + position: relative; + } + [style*='--aspect-ratio']::before { + content: ''; + display: block; + padding-bottom: calc(100% / (var(--aspect-ratio))); + } + [style*='--aspect-ratio'] > :first-child { + position: absolute; + top: 0; + left: 0; + height: 100%; + } + } +`;const je=(t,e,i,n)=>{if(!((t,e,i)=>{const[n,r]=t.split(".",2);return Number(n)>e||Number(n)===e&&Number(r)>=i})(t.config.version,0,109))return function(t,e){let i;const n=Me(e.entity_id);return"binary_sensor"===n?(e.attributes.device_class&&(i=t(`state.${n}.${e.attributes.device_class}.${e.state}`)),i||(i=t(`state.${n}.default.${e.state}`))):i=e.attributes.unit_of_measurement&&!["unknown","unavailable"].includes(e.state)?e.state:"zwave"===n?["initializing","dead"].includes(e.state)?t(`state.zwave.query_stage.${e.state}`,"query_stage",e.attributes.query_stage):t(`state.zwave.default.${e.state}`):t(`state.${n}.${e.state}`),i||(i=t(`state.default.${e.state}`)||t(`component.${n}.state.${e.state}`)||e.state),i}(e,i);if("unknown"===i.state||"unavailable"===i.state)return e(`state.default.${i.state}`);if(i.attributes.unit_of_measurement)return`${i.state} ${i.attributes.unit_of_measurement}`;const r=Me(i.entity_id);if("input_datetime"===r){let t;if(!i.attributes.has_time)return t=new Date(i.attributes.year,i.attributes.month-1,i.attributes.day),Vt(t,n);if(!i.attributes.has_date){const e=new Date;return t=new Date(e.getFullYear(),e.getMonth(),e.getDay(),i.attributes.hour,i.attributes.minute),Lt(t,n)}return t=new Date(i.attributes.year,i.attributes.month-1,i.attributes.day,i.attributes.hour,i.attributes.minute),Dt(t,n)}return i.attributes.device_class&&e(`component.${r}.state.${i.attributes.device_class}.${i.state}`)||e(`component.${r}.state._.${i.state}`)||i.state};var $e=Function.prototype.toString,He=Object.create,Re=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,De=Object.getOwnPropertyNames,Le=Object.getOwnPropertySymbols,Fe=Object.getPrototypeOf,Ie=Object.prototype,ze=Ie.hasOwnProperty,Ue=Ie.propertyIsEnumerable,qe="function"==typeof Le,Ye="function"==typeof WeakMap,Be=function(t,e){if(!t.constructor)return He(null);var i=t.constructor,n=t.__proto__||Fe(t);if(i===e.Object)return n===e.Object.prototype?{}:He(n);if(~$e.call(i).indexOf("[native code]"))try{return new i}catch(r){}return He(n)},We=function(t,e,i,n){var r=Be(t,e);for(var s in n.set(t,r),t)ze.call(t,s)&&(r[s]=i(t[s],n));if(qe){var a=Le(t),o=a.length;if(o)for(var l=0,c=void 0;l{Ke&&t(),window.loadCardHelpers&&(Ke=await window.loadCardHelpers(),window.cardHelpers=Ke,t())}));console.info("%c BUTTON-CARD \n%c Version 3.5.0 ","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),window.customCards=window.customCards||[],window.customCards.push({type:"button-card",name:"Button-Card",preview:!1,description:"A massively customizable custom button card"});let ti=class extends st{constructor(){super(...arguments),this._cards={},this._cardsConfig={},this._entities=[],this._initial_setup_complete=!1,this._rippleHandlers=new at((()=>this._ripple))}set hass(t){this._hass=t,Object.keys(this._cards).forEach((t=>{this._cards[t].hass=this._hass})),this._initial_setup_complete||this._initConnected()}disconnectedCallback(){super.disconnectedCallback(),this._clearInterval()}connectedCallback(){super.connectedCallback(),this._initial_setup_complete?this._startTimerCountdown():this._initConnected()}_initConnected(){void 0!==this._hass&&void 0!==this._config&&this.isConnected&&(this._initial_setup_complete=!0,this._startTimerCountdown())}_startTimerCountdown(){if(this._config&&this._config.entity&&"timer"===Me(this._config.entity)){const t=this._hass.states[this._config.entity];this._startInterval(t)}}_createCard(t){if(Ke)return Ke.createCardElement(t);{const e=function(t,e){void 0===e&&(e=!1);var i=function(t,e){return n("hui-error-card",{type:"error",error:t,config:e})},n=function(t,e){var n=window.document.createElement(t);try{n.setConfig(e)}catch(n){return console.error(t,n),i(n.message,e)}return n};if(!t||"object"!=typeof t||!e&&!t.type)return i("No type defined",t);var r=t.type;if(r&&r.startsWith("custom:"))r=r.substr("custom:".length);else if(e)if(Bt.has(r))r="hui-"+r+"-row";else{if(!t.entity)return i("Invalid config given.",t);var s=t.entity.split(".",1)[0];r="hui-"+(Wt[s]||"text")+"-entity-row"}else r="hui-"+r+"-card";if(customElements.get(r))return n(r,t);var a=i("Custom element doesn't exist: "+t.type+".",t);a.style.display="None";var o=setTimeout((function(){a.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(o),Yt(a,"ll-rebuild",{},a)})),a}(t);return Qe.then((()=>{Yt(e,"ll-rebuild",{})})),e}}static get styles(){return Ne}render(){if(!this._config||!this._hass)return L``;this._stateObj=this._config.entity?this._hass.states[this._config.entity]:void 0;try{return this._evaledVariables=this._config.variables?this._objectEvalTemplate(this._stateObj,this._config.variables):void 0,this._cardHtml()}catch(t){t.stack?console.error(t.stack):console.error(t);const e=document.createElement("hui-error-card");return e.setConfig({type:"error",error:t.toString(),origConfig:this._config}),L` ${e} `}}shouldUpdate(t){return!(!this._hasTemplate&&!t.has("_timeRemaining")&&!function(t,e){if(e.has("_config"))return!0;const i=e.get("_hass");if(i)return t._entities.some((function(e){return(null==i?void 0:i.states[e])!==t._hass.states[e]}));return!1}(this,t))&&(this._expandTriggerGroups(),!0)}updated(t){if(super.updated(t),this._config&&this._config.entity&&"timer"===Me(this._config.entity)&&t.has("_hass")){const e=this._hass.states[this._config.entity],i=t.get("_hass");(i?i.states[this._config.entity]:void 0)!==e?this._startInterval(e):e||this._clearInterval()}}_clearInterval(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}_startInterval(t){this._clearInterval(),this._calculateRemaining(t),"active"===t.state&&(this._interval=window.setInterval((()=>this._calculateRemaining(t)),1e3))}_calculateRemaining(t){t.attributes.remaining&&(this._timeRemaining=function(t){var e=Rt(t.attributes.remaining);if("active"===t.state){var i=(new Date).getTime(),n=new Date(t.last_changed).getTime();e=Math.max(e-(i-n)/1e3,0)}return e}(t))}_computeTimeDisplay(t){if(t)return function(t){var e=Math.floor(t/3600),i=Math.floor(t%3600/60),n=Math.floor(t%3600%60);return e>0?e+":"+Ft(i)+":"+Ft(n):i>0?i+":"+Ft(n):n>0?""+n:null}(this._timeRemaining||Rt(t.attributes.duration))}_getMatchingConfigState(t){if(!this._config.state)return;const e=this._config.state.find((t=>"template"===t.operator));if(!t&&!e)return;let i;const n=this._config.state.find((e=>{if(!e.operator)return t&&this._getTemplateOrValue(t,e.value)==t.state;switch(e.operator){case"==":return t&&t.state==this._getTemplateOrValue(t,e.value);case"<=":return t&&t.state<=this._getTemplateOrValue(t,e.value);case"<":return t&&t.state=":return t&&t.state>=this._getTemplateOrValue(t,e.value);case">":return t&&t.state>this._getTemplateOrValue(t,e.value);case"!=":return t&&t.state!=this._getTemplateOrValue(t,e.value);case"regex":return!(!t||!t.state.match(this._getTemplateOrValue(t,e.value)));case"template":return this._getTemplateOrValue(t,e.value);case"default":return i=e,!1;default:return!1}}));return!n&&i?i:n}_evalTemplate(t,e){try{return new Function("states","entity","user","hass","variables","html",`'use strict'; ${e}`).call(this,this._hass.states,t,this._hass.user,this._hass,this._evaledVariables,L)}catch(i){const t=e.length<=100?e.trim():`${e.trim().substring(0,98)}...`;throw i.message=`${i.name}: ${i.message} in '${t}'`,i.name="ButtonCardJSTemplateError",i}}_objectEvalTemplate(t,e){const i=Xe(e);return this._getTemplateOrValue(t,i)}_getTemplateOrValue(t,e){if(["number","boolean"].includes(typeof e))return e;if(!e)return e;if("object"==typeof e)return Object.keys(e).forEach((i=>{e[i]=this._getTemplateOrValue(t,e[i])})),e;const i=e.trim();return"[[["===i.substring(0,3)&&"]]]"===i.slice(-3)?this._evalTemplate(t,i.slice(3,-3)):e}_getDefaultColorForState(t){switch(t.state){case"on":return this._config.color_on;case"off":return this._config.color_off;default:return this._config.default_color}}_getColorForLightEntity(t,e){let i=this._config.default_color;return t&&("on"===t.state?t.attributes.rgb_color?(i=`rgb(${t.attributes.rgb_color.join(",")})`,t.attributes.brightness&&(i=Ee(i,(t.attributes.brightness+245)/5))):e&&t.attributes.color_temp&&t.attributes.min_mireds&&t.attributes.max_mireds?(i=function(t,e,i){const n=new Oe("rgb(255, 160, 0)"),r=new Oe("rgb(166, 209, 255)"),s=new Oe("white"),a=(t-e)/(i-e)*100;return a<50?Te(r).mix(s,2*a).toRgbString():Te(s).mix(n,2*(a-50)).toRgbString()}(t.attributes.color_temp,t.attributes.min_mireds,t.attributes.max_mireds),t.attributes.brightness&&(i=Ee(i,(t.attributes.brightness+245)/5))):i=t.attributes.brightness?Ee(this._getDefaultColorForState(t),(t.attributes.brightness+245)/5):this._getDefaultColorForState(t):i=this._getDefaultColorForState(t)),i}_buildCssColorAttribute(t,e){let i,n="";return(null==e?void 0:e.color)?n=e.color:"auto"!==this._config.color&&"off"===(null==t?void 0:t.state)?n=this._config.color_off:this._config.color&&(n=this._config.color),i="auto"==n||"auto-no-temperature"==n?this._getColorForLightEntity(t,"auto-no-temperature"!==n):n||(t?this._getDefaultColorForState(t):this._config.default_color),i}_buildIcon(t,e){if(!this._config.show_icon)return;let i;if(null==e?void 0:e.icon)i=e.icon;else if(this._config.icon)i=this._config.icon;else{if(!t)return;i=function(t){if(!t)return zt;if(t.attributes.icon)return t.attributes.icon;var e=It(t.entity_id);return e in te?te[e](t):Zt(e,t.state)}(t)}return this._getTemplateOrValue(t,i)}_buildEntityPicture(t,e){if(!this._config.show_entity_picture||!t&&!e&&!this._config.entity_picture)return;let i;return(null==e?void 0:e.entity_picture)?i=e.entity_picture:this._config.entity_picture?i=this._config.entity_picture:t&&(i=t.attributes&&t.attributes.entity_picture?t.attributes.entity_picture:void 0),this._getTemplateOrValue(t,i)}_buildStyleGeneric(t,e,i){var n,r;let s={};if((null===(n=this._config.styles)||void 0===n?void 0:n[i])&&(s=Object.assign(s,...this._config.styles[i])),null===(r=null==e?void 0:e.styles)||void 0===r?void 0:r[i]){let t={};t=Object.assign(t,...e.styles[i]),s=Object.assign(Object.assign({},s),t)}return Object.keys(s).forEach((e=>{s[e]=this._getTemplateOrValue(t,s[e])})),s}_buildCustomStyleGeneric(t,e,i){var n,r,s,a;let o={};if((null===(r=null===(n=this._config.styles)||void 0===n?void 0:n.custom_fields)||void 0===r?void 0:r[i])&&(o=Object.assign(o,...this._config.styles.custom_fields[i])),null===(a=null===(s=null==e?void 0:e.styles)||void 0===s?void 0:s.custom_fields)||void 0===a?void 0:a[i]){let t={};t=Object.assign(t,...e.styles.custom_fields[i]),o=Object.assign(Object.assign({},o),t)}return Object.keys(o).forEach((e=>{o[e]=this._getTemplateOrValue(t,o[e])})),o}_buildName(t,e){if(!1===this._config.show_name)return;let i;var n;return(null==e?void 0:e.name)?i=e.name:this._config.name?i=this._config.name:t&&(i=t.attributes&&t.attributes.friendly_name?t.attributes.friendly_name:(n=t.entity_id).substr(n.indexOf(".")+1)),this._getTemplateOrValue(t,i)}_buildStateString(t){var e;let i;if(this._config.show_state&&t&&t.state){const n=this._buildUnits(t);n?i=`${t.state} ${n}`:"timer"===Me(t.entity_id)?"idle"===t.state||0===this._timeRemaining?i=je(this._hass,this._hass.localize,t,this._hass.language):(i=this._computeTimeDisplay(t),"paused"===t.state&&(i+=` (${je(this._hass,this._hass.localize,t,this._hass.language)})`)):i=(null===(e=this._config)||void 0===e?void 0:e.show_units)||"sensor"!==Me(t.entity_id)?je(this._hass,this._hass.localize,t,this._hass.language):t.state}return i}_buildUnits(t){var e;let i;return t&&this._config.show_units&&(i=(null===(e=t.attributes)||void 0===e?void 0:e.unit_of_measurement)&&!this._config.units?t.attributes.unit_of_measurement:this._config.units?this._config.units:void 0),i}_buildLastChanged(t,e){return this._config.show_last_changed&&t?L` + + `:void 0}_buildLabel(t,e){if(!this._config.show_label)return;let i;return i=(null==e?void 0:e.label)?e.label:this._config.label,this._getTemplateOrValue(t,i)}_buildCustomFields(t,e){let i=L``;const n={},r={};return this._config.custom_fields&&Object.keys(this._config.custom_fields).forEach((e=>{const i=this._config.custom_fields[e];i.card?r[e]=this._objectEvalTemplate(t,i.card):n[e]=this._getTemplateOrValue(t,i)})),(null==e?void 0:e.custom_fields)&&Object.keys(e.custom_fields).forEach((i=>{const s=e.custom_fields[i];s.card?r[i]=this._objectEvalTemplate(t,s.card):n[i]=this._getTemplateOrValue(t,s)})),Object.keys(n).forEach((r=>{if(null!=n[r]){const s=Object.assign(Object.assign({},this._buildCustomStyleGeneric(t,e,r)),{"grid-area":r});i=L` + ${i} +
+ ${n[r]&&"html"===n[r].type?n[r]:ht(n[r])} +
+ `}})),Object.keys(r).forEach((n=>{if(null!=r[n]){const s=Object.assign(Object.assign({},this._buildCustomStyleGeneric(t,e,n)),{"grid-area":n});let a;ie(this._cardsConfig[n],r[n])?a=this._cards[n]:(a=this._createCard(r[n]),this._cards[n]=a,this._cardsConfig[n]=Xe(r[n])),a.hass=this._hass,i=L` + ${i} +
+ ${a} +
+ `}})),i}_isClickable(t){let e=!0;const i=this._getTemplateOrValue(t,this._config.tap_action.action),n=this._getTemplateOrValue(t,this._config.hold_action.action),r=this._getTemplateOrValue(t,this._config.double_tap_action.action);return e="none"!=i||"none"!=n||"none"!=r,e}_rotate(t){return!!(null==t?void 0:t.spin)}_blankCardColoredHtml(t){const e=Object.assign({background:"none","box-shadow":"none","border-style":"none"},t);return L` + +
+
+ `}_cardHtml(){var t,e;const i=this._getMatchingConfigState(this._stateObj),n=this._buildCssColorAttribute(this._stateObj,i);let r=n,s={},a={};const o={},l=this._buildStyleGeneric(this._stateObj,i,"lock"),c=this._buildStyleGeneric(this._stateObj,i,"card"),h=this._buildStyleGeneric(this._stateObj,i,"tooltip"),u={"button-card-main":!0,disabled:!this._isClickable(this._stateObj)};switch((null===(t=this._config)||void 0===t?void 0:t.tooltip)&&this.classList.add("tooltip"),c.width&&(this.style.setProperty("flex","0 0 auto"),this.style.setProperty("max-width","fit-content")),this._config.color_type){case"blank-card":return this._blankCardColoredHtml(c);case"card":case"label-card":{const t=function(t){const e=new Oe(Ce(t));return e.isValid&&e.getLuminance()>.5?"rgb(62, 62, 62)":"rgb(234, 234, 234)"}(n);s.color=t,a.color=t,s["background-color"]=n,s=Object.assign(Object.assign({},s),c),r="inherit";break}default:s=c}this._config.aspect_ratio?(o["--aspect-ratio"]=this._config.aspect_ratio,s.position="absolute"):o.display="inline",this.style.setProperty("--button-card-light-color",this._getColorForLightEntity(this._stateObj,!0)),this.style.setProperty("--button-card-light-color-no-temperature",this._getColorForLightEntity(this._stateObj,!1)),a=Object.assign(Object.assign({},a),l);const d=this._config.extra_styles?L` + + `:L``;return L` + ${d} +
+ + ${this._buttonContent(this._stateObj,i,r)} + + +
+ ${this._getLock(a)} + ${(null===(e=this._config)||void 0===e?void 0:e.tooltip)?L` + + ${this._getTemplateOrValue(this._stateObj,this._config.tooltip)} + + `:""} + `}_getLock(t){return this._config.lock&&this._getTemplateOrValue(this._stateObj,this._config.lock.enabled)?L` +
+ +
+ `:L``}_buttonContent(t,e,i){const n=this._buildName(t,e),r=(null==e?void 0:e.state_display)||this._config.state_display||void 0,s=this._config.show_state&&r?this._getTemplateOrValue(t,r):void 0,a=s||this._buildStateString(t),o=function(t,e){if(!t&&!e)return;let i;return i=e?t?`${t}: ${e}`:e:t,i}(n,a);switch(this._config.layout){case"icon_name_state":case"name_state":return this._gridHtml(t,e,this._config.layout,i,o,void 0);default:return this._gridHtml(t,e,this._config.layout,i,n,a)}}_gridHtml(t,e,i,n,r,s){const a=this._getIconHtml(t,e,n),o=[i],l=this._buildLabel(t,e),c=this._buildStyleGeneric(t,e,"name"),h=this._buildStyleGeneric(t,e,"state"),u=this._buildStyleGeneric(t,e,"label"),d=this._buildLastChanged(t,u),p=this._buildStyleGeneric(t,e,"grid");return a||o.push("no-icon"),r||o.push("no-name"),s||o.push("no-state"),l||d||o.push("no-label"),L` +
+ ${a||""} + ${r?L` +
+ ${"html"===r.type?r:ht(r)} +
+ `:""} + ${s?L` +
+ ${"html"===s.type?s:ht(s)} +
+ `:""} + ${l&&!d?L` +
+ ${"html"===l.type?l:ht(l)} +
+ `:""} + ${d||""} ${this._buildCustomFields(t,e)} +
+ `}_getIconHtml(t,e,i){const n=this._buildIcon(t,e),r=this._buildEntityPicture(t,e),s=this._buildStyleGeneric(t,e,"entity_picture"),a=this._buildStyleGeneric(t,e,"icon"),o=this._buildStyleGeneric(t,e,"img_cell"),l=this._buildStyleGeneric(t,e,"card"),c=Object.assign({color:i,width:this._config.size,position:this._config.aspect_ratio||l.height?"absolute":"relative"},a),h=Object.assign(Object.assign({},c),s),u=this._buildLiveStream(h);return n||r?L` +
+ ${!n||r||u?"":L` + + `} + ${u||""} + ${r&&!u?L` + + `:""} +
+ `:void 0}_buildLiveStream(t){return this._config.show_live_stream&&this._config.entity&&"camera"===Me(this._config.entity)?L` + + `:void 0}_configFromLLTemplates(t,e){const i=e.template;if(!i)return e;let n,r={};const s=i&&Array.isArray(i)?i:[i];return null==s||s.forEach((e=>{var i;if(!(null===(i=t.config.button_card_templates)||void 0===i?void 0:i[e]))throw new Error(`Button-card template '${e}' is missing!`);const s=this._configFromLLTemplates(t,t.config.button_card_templates[e]);r=Pe(r,s),n=Ae(n,s.state)})),r=Pe(r,e),r.state=Ae(n,e.state),r}setConfig(t){if(!t)throw new Error("Invalid configuration");this._cards={},this._cardsConfig={};const e=function(){let t=document.querySelector("home-assistant");if(t=t&&t.shadowRoot,t=t&&t.querySelector("home-assistant-main"),t=t&&t.shadowRoot,t=t&&t.querySelector("app-drawer-layout partial-panel-resolver, ha-drawer partial-panel-resolver"),t=t&&t.shadowRoot||t,t=t&&t.querySelector("ha-panel-lovelace"),t=t&&t.shadowRoot,t=t&&t.querySelector("hui-root"),t){const e=t.lovelace;return e.current_view=t.___curView,e}return null}()||function(){let t=document.querySelector("hc-main");if(t=t&&t.shadowRoot,t=t&&t.querySelector("hc-lovelace"),t=t&&t.shadowRoot,t=t&&(t.querySelector("hui-view")||t.querySelector("hui-panel-view")),t){const e=t.lovelace;return e.current_view=t.___curView,e}return null}();let i=Xe(t);i=this._configFromLLTemplates(e,i),this._config=Object.assign(Object.assign({type:"custom:button-card",group_expand:!1,hold_action:{action:"none"},double_tap_action:{action:"none"},layout:"vertical",size:"40%",color_type:"icon",show_name:!0,show_state:!1,show_icon:!0,show_units:!0,show_label:!1,show_entity_picture:!1,show_live_stream:!1,card_size:3},i),{default_color:"DUMMY",color_off:"DUMMY",color_on:"DUMMY",lock:Object.assign({enabled:!1,duration:5,unlock:"tap"},i.lock)}),this._config.entity&&qt.has(Me(this._config.entity))?this._config=Object.assign({tap_action:{action:"toggle"}},this._config):this._config=Object.assign({tap_action:{action:"more-info"}},this._config),this._config.default_color="var(--primary-text-color)","icon"!==this._config.color_type?this._config.color_off="var(--card-background-color)":this._config.color_off="var(--paper-item-icon-color)",this._config.color_on="var(--paper-item-icon-active-color)";const n=JSON.stringify(this._config);if(this._entities=[],Array.isArray(this._config.triggers_update)?this._entities=[...this._config.triggers_update]:"string"==typeof this._config.triggers_update&&"all"!==this._config.triggers_update&&this._entities.push(this._config.triggers_update),"all"!==this._config.triggers_update){const t=new RegExp(/states\[\s*('|\\")([a-zA-Z0-9_]+\.[a-zA-Z0-9_]+)\1\s*\]/,"gm"),e=new RegExp(/states\[\s*('|\\")([a-zA-Z0-9_]+\.[a-zA-Z0-9_]+)\1\s*\]/,"m"),i=n.match(t);null==i||i.forEach((t=>{const i=t.match(e);i&&!this._entities.includes(i[2])&&this._entities.push(i[2])}))}this._config.entity&&!this._entities.includes(this._config.entity)&&this._entities.push(this._config.entity),this._expandTriggerGroups();const r=new RegExp("\\[\\[\\[.*\\]\\]\\]","m");this._hasTemplate=!("all"!==this._config.triggers_update||!n.match(r)),this._initial_setup_complete||this._initConnected()}_loopGroup(t){t&&t.forEach((t=>{var e,i;(null===(e=this._hass)||void 0===e?void 0:e.states[t])&&("group"===Me(t)&&(null===(i=this._hass.states[t].attributes)||void 0===i?void 0:i.entity_id)?this._loopGroup(this._hass.states[t].attributes.entity_id):this._entities.includes(t)||this._entities.push(t))}))}_expandTriggerGroups(){var t;this._hass&&(null===(t=this._config)||void 0===t?void 0:t.group_expand)&&this._entities&&this._entities.forEach((t=>{var e,i;"group"===Me(t)&&this._loopGroup(null===(i=null===(e=this._hass)||void 0===e?void 0:e.states[t].attributes)||void 0===i?void 0:i.entity_id)}))}getCardSize(){var t;return(null===(t=this._config)||void 0===t?void 0:t.card_size)||3}_evalActions(t,e){const i=Xe(t),n=t=>t?(Object.keys(t).forEach((e=>{"object"==typeof t[e]?t[e]=n(t[e]):t[e]=this._getTemplateOrValue(this._stateObj,t[e])})),t):t;return i[e]=n(i[e]),!i[e].confirmation&&i.confirmation&&(i[e].confirmation=n(i.confirmation)),i}handleRippleActivate(t){this._ripple.then((e=>e&&e.startPress&&this._rippleHandlers.startPress(t)))}handleRippleDeactivate(){this._ripple.then((t=>t&&t.endPress&&this._rippleHandlers.endPress()))}handleRippleFocus(){this._ripple.then((t=>t&&t.startFocus&&this._rippleHandlers.startFocus()))}handleRippleBlur(){this._ripple.then((t=>t&&t.endFocus&&this._rippleHandlers.endFocus()))}_handleAction(t){var e;if(null===(e=t.detail)||void 0===e?void 0:e.action)switch(t.detail.action){case"tap":this._handleTap();break;case"hold":this._handleHold();break;case"double_tap":this._handleDblTap()}}_handleTap(){const t=this._config;t&&Kt(this,this._hass,this._evalActions(t,"tap_action"),!1,!1)}_handleHold(){const t=this._config;t&&Kt(this,this._hass,this._evalActions(t,"hold_action"),!0,!1)}_handleDblTap(){const t=this._config;t&&Kt(this,this._hass,this._evalActions(t,"double_tap_action"),!1,!0)}_handleUnlockType(t){const e=this._config;e&&e.lock.unlock===t.detail.action&&this._handleLock()}_handleLock(){const t=this.shadowRoot.getElementById("lock");if(!t)return;if(this._config.lock.exemptions){if(!this._hass.user.name||!this._hass.user.id)return;let e=!1;if(this._config.lock.exemptions.forEach((t=>{(!e&&t.user===this._hass.user.id||t.username===this._hass.user.name)&&(e=!0)})),!e)return t.classList.add("invalid"),void window.setTimeout((()=>{t&&t.classList.remove("invalid")}),3e3)}const e=this.shadowRoot.getElementById("overlay");if(e.style.setProperty("pointer-events","none"),t){const e=document.createAttribute("icon");e.value="mdi:lock-open-outline",t.attributes.setNamedItem(e),t.classList.add("hidden")}window.setTimeout((()=>{if(e.style.setProperty("pointer-events",""),t){t.classList.remove("hidden");const e=document.createAttribute("icon");e.value="mdi:lock-outline",t.attributes.setNamedItem(e)}}),1e3*this._config.lock.duration)}_stopPropagation(t){t.stopPropagation()}};var ei,ii,ni;t([K()],ti.prototype,"_hass",void 0),t([K()],ti.prototype,"_config",void 0),t([K()],ti.prototype,"_timeRemaining",void 0),t([(ei="mwc-ripple",(t,e)=>{const i={async get(){return await this.updateComplete,this.renderRoot.querySelector(ei)},enumerable:!0,configurable:!0};return void 0!==e?Q(i,t,e):tt(i,t)})],ti.prototype,"_ripple",void 0),t([(ii={passive:!0},(t,e)=>void 0!==e?((t,e,i)=>{Object.assign(e[i],t)})(ii,t,e):((t,e)=>Object.assign(Object.assign({},e),{finisher(i){Object.assign(i.prototype[e.key],t)}}))(ii,t))],ti.prototype,"handleRippleActivate",null),ti=t([(ni="button-card",t=>"function"==typeof t?((t,e)=>(window.customElements.define(t,e),e))(ni,t):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){window.customElements.define(t,e)}}})(ni,t))],ti); diff --git a/config/www/community/button-card/button-card.js.gz b/config/www/community/button-card/button-card.js.gz new file mode 100644 index 00000000..56a410f5 Binary files /dev/null and b/config/www/community/button-card/button-card.js.gz differ diff --git a/config/www/custom_ui/floorplan/alarm.css b/config/www/custom_ui/floorplan/alarm.css index db17af45..d3193b97 100755 --- a/config/www/custom_ui/floorplan/alarm.css +++ b/config/www/custom_ui/floorplan/alarm.css @@ -22,7 +22,7 @@ svg, svg * { transform-origin: right; } -#sensor\.dark_sky_minutely_summary { +#sensor\.pirateweather_minutely_summary { fill: #231F26 !important; fill-opacity: 1.0; } diff --git a/config/www/custom_ui/floorplan/alarm.svg b/config/www/custom_ui/floorplan/alarm.svg index 7041e12e..a8bb55af 100755 --- a/config/www/custom_ui/floorplan/alarm.svg +++ b/config/www/custom_ui/floorplan/alarm.svg @@ -86,7 +86,7 @@ - + @@ -751,10 +751,10 @@ v-6.4c0-1.6,1.3-2.8,2.8-2.8h97c1.6,0,2.8,1.3,2.8,2.8v6.4C759.9,50.1,758.6,51.3,757.1,51.3z"/> - + XX - + XX diff --git a/config/www/custom_ui/floorplan/alarm.yaml b/config/www/custom_ui/floorplan/alarm.yaml index 75845b58..383b8fb7 100755 --- a/config/www/custom_ui/floorplan/alarm.yaml +++ b/config/www/custom_ui/floorplan/alarm.yaml @@ -25,7 +25,7 @@ rules: - name: temp_darksky entities: - - sensor.dark_sky_temperature + - sensor.pirateweather_temperature text_template: '${entity.state ? Math.ceil(entity.state) + "°": "undefined"}' class_template: 'return "static-temp";' @@ -33,7 +33,7 @@ rules: entities: - sensor.downstairs_thermostat_humidity - sensor.upstairs_thermostat_humidity - - sensor.dark_sky_humidity + - sensor.pirateweather_humidity - sensor.carlojuice_amps text_template: '${entity.state ? Math.ceil(entity.state) : "undefined"}' class_template: 'return "static-temp";' @@ -240,7 +240,7 @@ rules: - name: Dark Sky Sensors entities: - - sensor.dark_sky_minutely_summary + - sensor.pirateweather_minutely_summary image_template: ' var imageName = ""; diff --git a/config/www/custom_ui/floorplan/clock.svg b/config/www/custom_ui/floorplan/clock.svg index 4633561b..8df62f9a 100755 --- a/config/www/custom_ui/floorplan/clock.svg +++ b/config/www/custom_ui/floorplan/clock.svg @@ -79,7 +79,7 @@ XX - + @@ -91,8 +91,8 @@ -Hell Fire for the next 2 hours -72 +Hell Fire for the next 2 hours +72 diff --git a/config/www/custom_ui/floorplan/clock.yaml b/config/www/custom_ui/floorplan/clock.yaml index 80a4bb8d..fd6e0593 100755 --- a/config/www/custom_ui/floorplan/clock.yaml +++ b/config/www/custom_ui/floorplan/clock.yaml @@ -53,13 +53,13 @@ rules: - name: temp_darksky entities: - - sensor.dark_sky_temperature + - sensor.pirateweather_temperature text_template: '${entity.state ? Math.ceil(entity.state) + "°": "undefined"}' class_template: 'return "static-temp";' - name: text_states entities: - - sensor.dark_sky_minutely_summary + - sensor.pirateweather_minutely_summary hover_over: false more_info: false text_template: '${entity.state ? entity.state : "undefined"}' @@ -103,8 +103,8 @@ rules: - name: Dark Sky Sensors entities: - - entity: sensor.dark_sky_minutely_summary - element: sensor.dark_sky_minutely_summary_icon + - entity: sensor.pirateweather_minutely_summary + element: sensor.pirateweather_minutely_summary_icon image_template: ' var imageName = ""; diff --git a/config/www/custom_ui/floorplan/clock_config.svg b/config/www/custom_ui/floorplan/clock_config.svg index 77a00237..179fedce 100755 --- a/config/www/custom_ui/floorplan/clock_config.svg +++ b/config/www/custom_ui/floorplan/clock_config.svg @@ -75,7 +75,7 @@ - + @@ -83,8 +83,8 @@ -Hell Fire for the next 2 hours -72 +Hell Fire for the next 2 hours +72 diff --git a/config/www/custom_ui/floorplan/clock_config.yaml b/config/www/custom_ui/floorplan/clock_config.yaml index 9ee805b6..29c5eade 100755 --- a/config/www/custom_ui/floorplan/clock_config.yaml +++ b/config/www/custom_ui/floorplan/clock_config.yaml @@ -98,13 +98,13 @@ rules: - name: temp_darksky entities: - - sensor.dark_sky_temperature + - sensor.pirateweather_temperature text_template: '${entity.state ? Math.ceil(entity.state) + "°": "undefined"}' class_template: 'return "static-temp";' - name: text_states entities: - - sensor.dark_sky_minutely_summary + - sensor.pirateweather_minutely_summary text_template: '${entity.state ? entity.state : "undefined"}' class_template: 'return "static-text";' @@ -127,8 +127,8 @@ rules: - name: Dark Sky Sensors entities: - - entity: sensor.dark_sky_minutely_summary - element: sensor.dark_sky_minutely_summary_icon + - entity: sensor.pirateweather_minutely_summary + element: sensor.pirateweather_minutely_summary_icon image_template: ' var imageName = ""; diff --git a/config/www/custom_ui/floorplan/floorplan_original.svg b/config/www/custom_ui/floorplan/floorplan_original.svg index 08501da4..a3f4b9a9 100755 --- a/config/www/custom_ui/floorplan/floorplan_original.svg +++ b/config/www/custom_ui/floorplan/floorplan_original.svg @@ -10534,7 +10534,7 @@ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:27.13692856px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;display:inline;fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:2.36688423" x="534.32465" y="-143.38016" - id="sensor.dark_sky_temperature" + id="sensor.pirateweather_temperature" inkscape:label="#text1979">