diff --git a/custom_cards/custom_card_esh_room/README.md b/custom_cards/custom_card_esh_room/README.md index 58cb908c4..b7b132a9e 100644 --- a/custom_cards/custom_card_esh_room/README.md +++ b/custom_cards/custom_card_esh_room/README.md @@ -17,7 +17,7 @@ hide: - Full credit to user [bms on the forum](https://community.home-assistant.io/t/lovelace-ui-minimalist/322687/192), they created the design and base of it in full, EverythingSmartHome put it into a PR as the basis - beasthouse and basbruss on the EverythingSmartHome discord channel for emoji/humidity customization - mpeterson added support for a switch to control climate and also to remove the need to have an entity associated -- Version: 2.1.0 +- Version: 2.1.1 ## Changelog @@ -40,6 +40,10 @@ Fixes text overflow issue over the climate button. - It now uses the `ulm_actions_card` template, which allows the usage of the popups wherever custom actions are set as `popup`. - Allow overflowing label and text to the climate button area whenever there is no climate button. +
+2.1.1 +Add support for the new popup framework while maintaining backwards compatibility with the old one. +
## Description diff --git a/custom_cards/custom_card_esh_room/custom_card_esh_room.yaml b/custom_cards/custom_card_esh_room/custom_card_esh_room.yaml index b117ba711..8179b2c03 100644 --- a/custom_cards/custom_card_esh_room/custom_card_esh_room.yaml +++ b/custom_cards/custom_card_esh_room/custom_card_esh_room.yaml @@ -159,8 +159,21 @@ card_esh_room: template: - "widget_icon" - "ulm_actions_card" - variables: - ulm_card_light_enable_popup: "[[[ return variables.ulm_card_light_enable_popup; ]]]" + variables: > + [[[ + let vars = {}; + vars.ulm_card_light_enable_popup = variables.ulm_card_light_enable_popup; + + if(variables.ulm_card_light_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_light_brightness', + 'popup_variables': { + 'ulm_popup_light_entity': variables.ulm_custom_card_esh_room_light_entity, + } + }; + } + return vars; + ]]] climate: card: @@ -218,5 +231,18 @@ card_esh_room: template: - "widget_icon" - "ulm_actions_card" - variables: - ulm_card_thermostat_enable_popup: "[[[ return variables.ulm_card_thermostat_enable_popup; ]]]" + variables: > + [[[ + let vars = {}; + vars.ulm_card_thermostat_enable_popup = variables.ulm_card_light_enable_popup; + + if(variables.ulm_card_thermostat_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_thermostat_temperature', + 'popup_variables': { + 'ulm_popup_thermostat_entity': variables.ulm_custom_card_esh_room_climate_entity, + } + }; + } + return vars; + ]]] diff --git a/custom_cards/custom_card_httpedo13_thermostat/languages/pl.yaml b/custom_cards/custom_card_httpedo13_thermostat/languages/pl.yaml new file mode 100644 index 000000000..c9522f8ea --- /dev/null +++ b/custom_cards/custom_card_httpedo13_thermostat/languages/pl.yaml @@ -0,0 +1,6 @@ +--- +custom_card_httpedo13_thermostat_language_variables: + variables: + custom_card_httpedo13_thermostat_off: "wyłączony" + custom_card_httpedo13_thermostat_on: "włączony" + custom_card_httpedo13_thermostat_heating: "grzanie" diff --git a/custom_cards/custom_card_irmajavi_speedtest/languages/pl.yaml b/custom_cards/custom_card_irmajavi_speedtest/languages/pl.yaml new file mode 100644 index 000000000..cf56d47a2 --- /dev/null +++ b/custom_cards/custom_card_irmajavi_speedtest/languages/pl.yaml @@ -0,0 +1,6 @@ +--- +ulm_custom_card_irmajavi_speedtest_language_variables: + variables: + ulm_custom_card_irmajavi_speedtest_speedtest: "Test prędkości Internetu" + ulm_custom_card_irmajavi_speedtest_download: "Prędkość pobierania" + ulm_custom_card_irmajavi_speedtest_upload: "Prędkość wysyłania" diff --git a/custom_cards/custom_card_ristou_person/languages/pl.yaml b/custom_cards/custom_card_ristou_person/languages/pl.yaml new file mode 100644 index 000000000..41ea3483f --- /dev/null +++ b/custom_cards/custom_card_ristou_person/languages/pl.yaml @@ -0,0 +1,4 @@ +--- +ulm_custom_card_ristou_person_language_variables: + variables: + ulm_custom_card_ristou_person_driving: "Porusza się" diff --git a/custom_cards/custom_card_wsly_pollen/languages/pl.yaml b/custom_cards/custom_card_wsly_pollen/languages/pl.yaml new file mode 100644 index 000000000..ad7a1bb38 --- /dev/null +++ b/custom_cards/custom_card_wsly_pollen/languages/pl.yaml @@ -0,0 +1,13 @@ +# EN.yaml for custom_card_wsly_pollen +--- +custom_card_wsly_pollen_language_variables: + variables: + custom_card_wsly_pollen_none: "Brak" + custom_card_wsly_pollen_very_low: "Bardzo słabe" + custom_card_wsly_pollen_low: "Słabe" + custom_card_wsly_pollen_medium: "Średnie" + custom_card_wsly_pollen_high: "Wysokie" + custom_card_wsly_pollen_very_high: "Bardzo wysokie" + custom_card_wsly_pollen_tree_name: "Drzewa" + custom_card_wsly_pollen_grass_name: "Trawy" + custom_card_wsly_pollen_weed_name: "Zioła" diff --git a/custom_components/ui_lovelace_minimalist/base.py b/custom_components/ui_lovelace_minimalist/base.py index 949d9e2ff..a6ca2c977 100644 --- a/custom_components/ui_lovelace_minimalist/base.py +++ b/custom_components/ui_lovelace_minimalist/base.py @@ -320,6 +320,7 @@ async def configure_plugins(self) -> bool: "simple-weather-card", "lovelace-layout-card", "lovelace-state-switch", + "weather-radar-card", ] for p in depenceny_resource_paths: if not self.configuration.include_other_cards: diff --git a/custom_components/ui_lovelace_minimalist/cards/lovelace-layout-card/lovelace-layout-card.js b/custom_components/ui_lovelace_minimalist/cards/lovelace-layout-card/lovelace-layout-card.js new file mode 100644 index 000000000..25422f4df --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/cards/lovelace-layout-card/lovelace-layout-card.js @@ -0,0 +1,228 @@ +function t(t,e,i,o){var s,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(a=(n<3?s(a):n>3?s(e,i,a):s(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a}const e=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),o=new Map;class s{constructor(t,e){if(this._$cssResult$=!0,e!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=o.get(this.cssText);return e&&void 0===t&&(o.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const n=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new s(o,i)},a=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",i))(e)})(t):t;var r;const l=window.trustedTypes,d=l?l.emptyScript:"",c=window.reactiveElementPolyfillSupport,h={toAttribute(t,e){switch(e){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},u=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:h,reflect:!1,hasChanged:u};class v extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Eh(i,e);void 0!==o&&(this._$Eu.set(o,i),t.push(o))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const s=this[t];this[e]=o,this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{e?t.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),o=window.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,t.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=p){var o,s;const n=this.constructor._$Eh(t,i);if(void 0!==n&&!0===i.reflect){const a=(null!==(s=null===(o=i.converter)||void 0===o?void 0:o.toAttribute)&&void 0!==s?s:h.toAttribute)(e,i.type);this._$Ei=t,null==a?this.removeAttribute(n):this.setAttribute(n,a),this._$Ei=null}}_$AK(t,e){var i,o,s;const n=this.constructor,a=n._$Eu.get(t);if(void 0!==a&&this._$Ei!==a){const t=n.getPropertyOptions(a),r=t.converter,l=null!==(s=null!==(o=null===(i=r)||void 0===i?void 0:i.fromAttribute)&&void 0!==o?o:"function"==typeof r?r:null)&&void 0!==s?s:h.fromAttribute;this._$Ei=a,this[a]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}var g;v.finalized=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==c||c({ReactiveElement:v}),(null!==(r=globalThis.reactiveElementVersions)&&void 0!==r?r:globalThis.reactiveElementVersions=[]).push("1.3.0");const _=globalThis.trustedTypes,f=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,y="?"+m,b=`<${y}>`,$=document,w=(t="")=>$.createComment(t),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,E=Array.isArray,A=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,x=/-->/g,S=/>/g,M=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,T=/'/g,O=/"/g,k=/^(?:script|style|textarea|title)$/i,U=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),L=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),R=new WeakMap,z=$.createTreeWalker($,129,null,!1),H=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"":"",a=A;for(let e=0;e"===l[0]?(a=null!=s?s:A,d=-1):void 0===l[1]?d=-2:(d=a.lastIndex-l[2].length,r=l[1],a=void 0===l[3]?M:'"'===l[3]?O:T):a===O||a===T?a=M:a===x||a===S?a=A:(a=M,s=void 0);const h=a===M&&t[e+1].startsWith("/>")?" ":"";n+=a===A?i+b:d>=0?(o.push(r),i.slice(0,d)+"$lit$"+i.slice(d)+m+h):i+m+(-2===d?(o.push(void 0),e):h)}const r=n+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==f?f.createHTML(r):r,o]};class j{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,n=0;const a=t.length-1,r=this.parts,[l,d]=H(t,e);if(this.el=j.createElement(l,i),z.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=z.nextNode())&&r.length0){o.textContent=_?_.emptyScript:"";for(let i=0;i{var e;return E(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==P&&C(this._$AH)?this._$AA.nextSibling.data=t:this.k($.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=j.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.m(i);else{const t=new I(s,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=R.get(t.strings);return void 0===e&&R.set(t.strings,e=new j(t)),e}S(t){E(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new B(this.A(w()),this.A(w()),this,this.options)):i=e[o],i._$AI(s),o++;o2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=P}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let n=!1;if(void 0===s)t=N(this,t,e,0),n=!C(t)||t!==this._$AH&&t!==L,n&&(this._$AH=t);else{const o=t;let a,r;for(t=s[0],a=0;a{var o,s;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let a=n._$litPart$;if(void 0===a){const t=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:null;n._$litPart$=a=new B(e.insertBefore(w(),t),t,void 0,null!=i?i:{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return L}}Y.finalized=!0,Y._$litElement$=!0,null===(K=globalThis.litElementHydrateSupport)||void 0===K||K.call(globalThis,{LitElement:Y});const Z=globalThis.litElementPolyfillSupport;null==Z||Z({LitElement:Y}),(null!==(J=globalThis.litElementVersions)&&void 0!==J?J:globalThis.litElementVersions=[]).push("3.2.0");const X=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function tt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):X(t,e)}function et(t){return tt({...t,state:!0})}var it;null===(it=window.HTMLSlotElement)||void 0===it||it.prototype.assignedElements;var ot={},st={},nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.ContentRect=function(t){if("getBBox"in t){var e=t.getBBox();return Object.freeze({height:e.height,left:0,top:0,width:e.width})}var i=window.getComputedStyle(t);return Object.freeze({height:parseFloat(i.height||"0"),left:parseFloat(i.paddingLeft||"0"),top:parseFloat(i.paddingTop||"0"),width:parseFloat(i.width||"0")})},Object.defineProperty(st,"__esModule",{value:!0});var at=nt,rt=function(){function t(t){this.target=t,this.$$broadcastWidth=this.$$broadcastHeight=0}return Object.defineProperty(t.prototype,"broadcastWidth",{get:function(){return this.$$broadcastWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"broadcastHeight",{get:function(){return this.$$broadcastHeight},enumerable:!0,configurable:!0}),t.prototype.isActive=function(){var t=at.ContentRect(this.target);return!!t&&(t.width!==this.broadcastWidth||t.height!==this.broadcastHeight)},t}();st.ResizeObservation=rt;var lt={};Object.defineProperty(lt,"__esModule",{value:!0});var dt=nt,ct=function(t){this.target=t,this.contentRect=dt.ContentRect(t)};lt.ResizeObserverEntry=ct,Object.defineProperty(ot,"__esModule",{value:!0});var ht=st,ut=lt,pt=[],vt=function(){function t(t){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var e=function(t){if(void 0===t)return"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.";if("function"!=typeof t)return"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."}(t);if(e)throw TypeError(e);this.$$callback=t}return t.prototype.observe=function(t){var e,i=ft("observe",t);if(i)throw TypeError(i);mt(this.$$observationTargets,t)>=0||(this.$$observationTargets.push(new ht.ResizeObservation(t)),e=this,pt.indexOf(e)<0&&(pt.push(e),Et()))},t.prototype.unobserve=function(t){var e=ft("unobserve",t);if(e)throw TypeError(e);var i=mt(this.$$observationTargets,t);i<0||(this.$$observationTargets.splice(i,1),0===this.$$observationTargets.length&&_t(this))},t.prototype.disconnect=function(){this.$$observationTargets=[],this.$$activeTargets=[],_t(this)},t}(),gt=ot.ResizeObserver=vt;function _t(t){var e=pt.indexOf(t);e>=0&&(pt.splice(e,1),xt())}function ft(t,e){return void 0===e?"Failed to execute '"+t+"' on 'ResizeObserver': 1 argument required, but only 0 present.":e&&e.nodeType===window.Node.ELEMENT_NODE?void 0:"Failed to execute '"+t+"' on 'ResizeObserver': parameter 1 is not of type 'Element'."}function mt(t,e){for(var i=0;it?e.$$activeTargets.push(i):e.$$skippedTargets.push(i))}))}))},$t=function(){var t=1/0;return pt.forEach((function(e){if(e.$$activeTargets.length){var i=[];e.$$activeTargets.forEach((function(e){var o=new ut.ResizeObserverEntry(e.target);i.push(o),e.$$broadcastWidth=o.contentRect.width,e.$$broadcastHeight=o.contentRect.height;var s=wt(e.target);s{var e;return t.editMode=null===(e=this.lovelace)||void 0===e?void 0:e.editMode})),this._editMode=null!==(n=null===(s=this.lovelace)||void 0===s?void 0:s.editMode)&&void 0!==n&&n}}_shouldShow(t,e,i){var o,s,n,a,r,l,d,c;return"always"===(null===(o=e.view_layout)||void 0===o?void 0:o.show)||"never"!==(null===(s=e.view_layout)||void 0===s?void 0:s.show)&&(("shown"!==(null===(a=null===(n=e.view_layout)||void 0===n?void 0:n.show)||void 0===a?void 0:a.sidebar)||"auto"!==(null===(r=this.hass)||void 0===r?void 0:r.dockedSidebar)&&!this.narrow)&&!("hidden"===(null===(d=null===(l=e.view_layout)||void 0===l?void 0:l.show)||void 0===d?void 0:d.sidebar)&&"docked"===(null===(c=this.hass)||void 0===c?void 0:c.dockedSidebar)&&!this.narrow))}getCardElement(t){var e;if(!(null===(e=this.lovelace)||void 0===e?void 0:e.editMode))return t.card;const i=document.createElement("hui-card-options");return i.hass=this.hass,i.lovelace=this.lovelace,i.path=[this.index,t.index],t.card.editMode=!0,i.appendChild(t.card),!1===t.show&&(i.style.border="1px solid red"),i}_addCard(){this.dispatchEvent(new CustomEvent("ll-create-card"))}_render_fab(){var t;return!0==!(null===(t=this.lovelace)||void 0===t?void 0:t.editMode)?U``:U` + + + + `}static get _fab_styles(){return n` + ha-fab { + position: sticky; + float: right; + right: calc(16px + env(safe-area-inset-right)); + bottom: calc(16px + env(safe-area-inset-bottom)); + z-index: 1; + } + `}}t([tt()],St.prototype,"cards",void 0),t([tt()],St.prototype,"index",void 0),t([tt()],St.prototype,"narrow",void 0),t([tt()],St.prototype,"hass",void 0),t([tt()],St.prototype,"lovelace",void 0),t([tt()],St.prototype,"_editMode",void 0),t([tt()],St.prototype,"_config",void 0);class Mt extends St{constructor(){super(...arguments),this._mediaQueries=[]}async setConfig(t){var e,i,o,s;await super.setConfig(t);for(const t of this._config.cards)if("string"!=typeof(null===(e=t.view_layout)||void 0===e?void 0:e.show)&&(null===(o=null===(i=t.view_layout)||void 0===i?void 0:i.show)||void 0===o?void 0:o.mediaquery)){const e=window.matchMedia(`${t.view_layout.show.mediaquery}`);this._mediaQueries.push(e),e.addEventListener("change",(()=>this._makeLayout()))}else this._mediaQueries.push(null);this._observer&&this._observer.disconnect(),this._observer=new gt((()=>{this._updateSize()})),this._cardObserver&&this._cardObserver.disconnect(),(null===(s=t.layout)||void 0===s?void 0:s.reflow)&&(this._cardObserver=new MutationObserver((t=>{for(const e of t)"attributes"!==e.type||"style"!==e.attributeName&&"hidden"!==e.attributeName||this._makeLayout()})))}async updated(t){var e;await super.updated(t),(t.has("_columns")||t.has("cards"))&&this._makeLayout(),t.has("_editMode")&&this._makeLayout(),(t.has("narrow")||t.has("hass")&&(null===(e=t.get("hass"))||void 0===e?void 0:e.dockedSidebar)!=this.hass.dockedSidebar)&&(this._updateSize(),this._makeLayout())}async firstUpdated(){var t,e,i,o,s,n,a,r,l,d,c,h,u,p,v,g;this._updateSize();const _=(null===(t=this._config.layout)||void 0===t?void 0:t.width)||300,f=(null===(e=this._config.layout)||void 0===e?void 0:e.max_width)||((null===(i=this._config.layout)||void 0===i?void 0:i.width)?Math.ceil(1.5*(null===(o=this._config.layout)||void 0===o?void 0:o.width)):500),m=(null===(s=this._config.layout)||void 0===s?void 0:s.width)?2*this._config.layout.width:600,y=document.createElement("style");y.innerHTML=`\n :host {\n --column-max-width: ${f}px;\n --column-width: ${_}px;\n --column-widths: ${null!==(a=null===(n=this._config.layout)||void 0===n?void 0:n.column_widths)&&void 0!==a?a:"none"};\n --layout-margin: ${null!==(l=null===(r=this._config.layout)||void 0===r?void 0:r.margin)&&void 0!==l?l:"4px 4px 0px 4px"};\n --layout-padding: ${null!==(c=null===(d=this._config.layout)||void 0===d?void 0:d.padding)&&void 0!==c?c:"0px"};\n --card-margin: ${null!==(u=null===(h=this._config.layout)||void 0===h?void 0:h.card_margin)&&void 0!==u?u:"var(--masonry-view-card-margin, 4px 4px 8px)"};\n --layout-height: ${null!==(v=null===(p=this._config.layout)||void 0===p?void 0:p.height)&&void 0!==v?v:"auto"};\n --layout-overflow: ${void 0!==(null===(g=this._config.layout)||void 0===g?void 0:g.height)?"auto":"visible"};\n }\n @media (max-width: ${f}px) {\n .column:first-child > * {\n margin-left: 0;\n }\n .column:last-child > * {\n margin-right: 0;\n }\n }\n @media (max-width: ${m-1}px) {\n .column {\n --column-max-width: ${m}px;\n }\n }\n `,this.shadowRoot.appendChild(y)}connectedCallback(){super.connectedCallback(),this._updateSize()}disconnectedCallback(){super.disconnectedCallback(),this._observer.disconnect()}async _updateSize(){var t,e,i;let o=this.getBoundingClientRect().width,s=0;s=Math.floor(o/((null===(t=this._config.layout)||void 0===t?void 0:t.width)||300)),s=Math.min(s,(null===(e=this._config.layout)||void 0===e?void 0:e.max_cols)||("docked"===(null===(i=this.hass)||void 0===i?void 0:i.dockedSidebar)?3:4)),s=Math.max(s,1),s!==this._columns&&(this._columns=s)}_shouldShow(t,e,i){var o;if(!super._shouldShow(t,e,i))return!1;if(null===(o=this._config.layout)||void 0===o?void 0:o.reflow){if("none"===getComputedStyle(t).display)return!1;if(!0===t.hidden)return!1}const s=this._mediaQueries[i];return!s||!!s.matches}isBreak(t){return"layout-break"===t.localName}async _makeLayout(){this._makeColumnLayout()}async _makeColumnLayout(){var t;if(this._observer.disconnect(),this._cardObserver&&this._cardObserver.disconnect(),!this._columns)return;let e=[];for(let t=0;t{const i=this._config.cards[e];return{card:t,config:i,index:e,show:this._shouldShow(t,i,e)}}));await this._placeColumnCards(e,i.filter((t=>{var e;return(null===(e=this.lovelace)||void 0===e?void 0:e.editMode)||t.show}))),e=e.filter((t=>t.childElementCount>0)),(null===(t=this._config.layout)||void 0===t?void 0:t.rtl)&&e.reverse();const o=this.shadowRoot.querySelector("#columns");for(;o.firstChild;)o.removeChild(o.firstChild);if(this._cardObserver)for(const t of this.cards)this._cardObserver.observe(t,{attributes:!0});for(const t of e)o.appendChild(t);this.requestUpdate(),await this.updateComplete,this._observer.observe(this)}async _placeColumnCards(t,e){}render(){return U` +
+ ${this._render_fab()} + `}static get styles(){return[this._fab_styles,n` + :host { + display: block; + height: 100%; + box-sizing: border-box; + overflow-y: var(--layout-overflow); + } + + #columns { + display: grid; + grid-auto-columns: minmax( + var(--column-width), + var(--column-max-width) + ); + grid-template-columns: var(--column-widths); + justify-content: center; + justify-items: center; + margin: var(--layout-margin); + padding: var(--layout-padding); + height: var(--layout-height); + overflow-y: var(--layout-overflow); + } + .column { + grid-row: 1/2; + max-width: var(--column-max-width); + width: 100%; + } + .column > * { + display: block; + margin: var(--card-margin); + } + `]}}t([tt()],Mt.prototype,"_columns",void 0),t([tt()],Mt.prototype,"_config",void 0);customElements.define("masonry-layout",class extends Mt{async _placeColumnCards(t,e){var i;const o=(null===(i=this._config.layout)||void 0===i?void 0:i.min_height)||5;function s(){let e=0;for(let i=0;isetTimeout((()=>t(1)),500)))]):1}}});customElements.define("horizontal-layout",class extends Mt{async _placeColumnCards(t,e){var i,o;let s=0;for(const n of e){s+=1,(null===(i=n.config.view_layout)||void 0===i?void 0:i.column)&&(s=n.config.view_layout.column);const e=t[(s-1)%t.length];e.appendChild(this.getCardElement(n)),this.isBreak(n.card)&&(s=0,(null===(o=this.lovelace)||void 0===o?void 0:o.editMode)||e.removeChild(n.card))}}});customElements.define("vertical-layout",class extends Mt{async _placeColumnCards(t,e){var i;let o=1;for(const s of e){(null===(i=s.config.view_layout)||void 0===i?void 0:i.column)&&(o=s.config.view_layout.column);t[(o-1)%t.length].appendChild(this.getCardElement(s)),this.isBreak(s.card)&&(o+=1)}}});class Tt extends HTMLElement{setConfig(){this.style.display="none";const t=document.createElement("ha-card");t.innerHTML="BREAK",t.style.cssText="\n background: red;\n text-align: center;\n font-size: large;\n color: white;\n padding: 16px;\n ",this.appendChild(t)}getCardSize(){return 0}set editMode(t){this.style.display=t?"block":"none"}static getConfigElement(){return document.createElement("layout-break-editor")}static getStubConfig(){return{}}}customElements.define("layout-break",Tt),window.customCards=window.customCards||[],window.customCards.push({type:"layout-break",name:"Layout Break",preview:!1,description:"Forces a break in the layout flow. For use with layout-card or special layouts."});class Ot extends HTMLElement{setConfig(t){const e=document.createElement("div");e.innerHTML="BREAK",this.appendChild(e)}}customElements.define("layout-break-editor",Ot);customElements.define("grid-layout",class extends St{constructor(){super(...arguments),this._mediaQueries=[],this._layoutMQs=[]}async setConfig(t){var e,i,o,s,n;await super.setConfig(t);for(const t of this._config.cards)if("string"!=typeof(null===(e=t.view_layout)||void 0===e?void 0:e.show)&&(null===(o=null===(i=t.view_layout)||void 0===i?void 0:i.show)||void 0===o?void 0:o.mediaquery)){const e=window.matchMedia(`${t.view_layout.show.mediaquery}`);this._mediaQueries.push(e),e.addEventListener("change",(()=>this._placeCards()))}else this._mediaQueries.push(null);if(null===(s=this._config.layout)||void 0===s?void 0:s.mediaquery)for(const[t,e]of Object.entries(null===(n=this._config.layout)||void 0===n?void 0:n.mediaquery)){const e=window.matchMedia(t);this._layoutMQs.push(e),e.addEventListener("change",(()=>this._setGridStyles()))}this._setGridStyles()}async updated(t){await super.updated(t),(t.has("cards")||t.has("_editMode"))&&this._placeCards()}async firstUpdated(){var t,e,i,o,s,n,a;this._setGridStyles();const r=document.createElement("style");r.innerHTML=`\n :host {\n --layout-margin: ${null!==(e=null===(t=this._config.layout)||void 0===t?void 0:t.margin)&&void 0!==e?e:"4px 4px 0px 4px"};\n --layout-padding: ${null!==(o=null===(i=this._config.layout)||void 0===i?void 0:i.padding)&&void 0!==o?o:"0px"};\n --layout-height: ${null!==(n=null===(s=this._config.layout)||void 0===s?void 0:s.height)&&void 0!==n?n:"auto"};\n --layout-overflow: ${void 0!==(null===(a=this._config.layout)||void 0===a?void 0:a.height)?"auto":"visible"};\n }`,this.shadowRoot.appendChild(r)}_setGridStyles(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("#root");if(!e)return;const i=t=>{for(const[i,o]of Object.entries(t))(i.startsWith("grid")||"grid"===i||"place-items"===i||"place-content"===i)&&e.style.setProperty(i,o)};e.style.cssText="",this._config.layout&&i(this._config.layout);for(const t of this._layoutMQs)if(t.matches){i(this._config.layout.mediaquery[t.media]);break}}_shouldShow(t,e,i){if(!super._shouldShow(t,e,i))return!1;const o=this._mediaQueries[i];return!o||!!o.matches}_placeCards(){var t,e;const i=this.shadowRoot.querySelector("#root");for(;i.firstChild;)i.removeChild(i.firstChild);let o=this.cards.map(((t,e)=>{const i=this._config.cards[e];return{card:t,config:i,index:e,show:this._shouldShow(t,i,e)}}));for(const s of o.filter((t=>{var e;return(null===(e=this.lovelace)||void 0===e?void 0:e.editMode)||t.show}))){const o=this.getCardElement(s);for(const[i,n]of Object.entries(null!==(e=null===(t=s.config)||void 0===t?void 0:t.view_layout)&&void 0!==e?e:{}))(i.startsWith("grid")||"place-self"===i)&&o.style.setProperty(i,n);i.appendChild(o)}}render(){return U`
+ ${this._render_fab()}`}static get styles(){return[this._fab_styles,n` + :host { + height: 100%; + box-sizing: border-box; + } + #root { + display: grid; + justify-content: stretch; + margin: var(--layout-margin); + padding: var(--layout-padding); + height: var(--layout-height); + overflow-y: var(--layout-overflow); + } + #root > * { + margin: var(--masonry-view-card-margin, 4px 4px 8px); + } + `]}});class kt extends Y{constructor(){super(...arguments),this.editMode=!1,this.isPanel=!1,this._cards=[]}setConfig(t){this._config=Object.assign({},t),this._config.entities&&(this._config.cards=this._config.entities.map((t=>t.type?t:Object.assign(Object.assign({},t),{type:"entity"}))));let e=t.layout_type;e?((null==e?void 0:e.endsWith("-layout"))||(e+="-layout"),e.startsWith("custom:")&&(e=e.substring("custom:".length))):e="hui-masonry-view",this._layoutType=e}async updated(t){var e;if(super.updated(t),t.has("_layoutType")||t.has("_config")){const t={type:this._layoutType,layout:this._config.layout||this._config.layout_options,cards:this._config.cards},i=document.createElement(this._layoutType);null===(e=i.setConfig)||void 0===e||e.call(i,t),this._layoutElement=i,await this._createCards(),this._layoutElement.hass=this.hass,this._layoutElement.narrow=!1,this._layoutElement.lovelace=Object.assign(Object.assign({},this._getLovelace()),{editMode:!1}),this._layoutElement.index=1}t.has("hass")&&(this._cards.forEach((t=>{t.hass=this.hass})),this._layoutElement&&(this._layoutElement.hass=this.hass)),t.has("_cards")&&this._layoutElement&&(this._layoutElement.cards=this._cards),t.has("editMode")&&this._layoutElement&&(this._layoutElement.lovelace=Object.assign(Object.assign({},this._getLovelace()),{editMode:!1}))}_getLovelace(t=this){return t.lovelace?t.lovelace:"home-assistant"!==t.localName?t.parentElement&&t.parentElement.host?this._getLovelace(t.parentElement.host):t.parentNode&&t.parentNode.host?this._getLovelace(t.parentNode.host):t.parentElement?this._getLovelace(t.parentElement):t.parentNode?this._getLovelace(t.parentNode):void 0:void 0}_createCard(t,e){const i=e.createCardElement(t);return i.addEventListener("ll-rebuild",(e=>{e.stopPropagation(),this._rebuildCard(i,t)})),i.hass=this.hass,i}async _createCards(){const t=await window.loadCardHelpers();this._cards=this._config.cards.map((e=>this._createCard(e,t)))}async _rebuildCard(t,e){const i=await window.loadCardHelpers(),o=this._createCard(e,i);t.parentElement&&t.parentElement.replaceChild(o,t),this._cards=this._cards.map((e=>e===t?o:e))}render(){return U`${this._layoutElement}`}static get styles(){return n` + :host(:not(:first-child)) { + margin-top: 0 !important; + } + :host(:not(:last-child)) { + margin-bottom: 0 !important; + } + `}static getConfigElement(){return document.createElement("layout-card-editor")}static getStubConfig(){return{layout_type:"masonry",layout:{},cards:[]}}}t([tt()],kt.prototype,"hass",void 0),t([tt()],kt.prototype,"editMode",void 0),t([tt()],kt.prototype,"isPanel",void 0),t([tt()],kt.prototype,"_config",void 0),t([tt()],kt.prototype,"_cards",void 0),t([tt()],kt.prototype,"_layoutElement",void 0),t([tt()],kt.prototype,"_layoutType",void 0),customElements.define("layout-card",kt),window.customCards=window.customCards||[],window.customCards.push({type:"layout-card",name:"Layout Card",preview:!1,description:"Like a stack card, but with way more control."});const Ut=[{value:"custom:masonry-layout",label:"Masonry (layout-card)"},{value:"custom:horizontal-layout",label:"Horizontal (layout-card)"},{value:"custom:vertical-layout",label:"Vertical (layout-card)"},{value:"custom:grid-layout",label:"Grid (layout-card)"}],Lt=["masonry","sidebar","panel"];class Pt extends Y{constructor(){super(...arguments),this._selectedTab=0,this._selectedCard=0,this._cardGUIMode=!0,this._cardGUIModeAvailable=!0,this._schema=t=>[{name:"layout_type",selector:{select:{options:[...Lt.map((e=>({value:e,label:t(`ui.panel.lovelace.editor.edit_view.types.${e}`)}))),...Ut]}}},{name:"layout",selector:{object:{}}}]}setConfig(t){this._config=t}firstUpdated(){(async()=>{var t,e;if(customElements.get("ha-form"))return;const i=await(null===(e=(t=window).loadCardHelpers)||void 0===e?void 0:e.call(t));if(!i)return;const o=await i.createCardElement({type:"entity"});o&&await o.getConfigElement()})()}_handleSwitchTab(t){this._selectedTab=parseInt(t.detail.index,10)}_editCard(t){t.stopPropagation(),"add-card"!==t.target.id?(this._cardGUIMode=!0,this._cardEditorEl&&(this._cardEditorEl.GUImode=!0),this._cardGUIModeAvailable=!0,this._selectedCard=parseInt(t.detail.selected,10)):this._selectedCard=this._config.cards.length}_addCard(t){t.stopPropagation();const e=[...this._config.cards];e.push(t.detail.config),this._config=Object.assign(Object.assign({},this._config),{cards:e}),this._selectedCard=this._config.cards.length-1,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_updateCard(t){t.stopPropagation();const e=[...this._config.cards];e[this._selectedCard]=t.detail.config,this._config=Object.assign(Object.assign({},this._config),{cards:e}),this._cardGUIModeAvailable=t.detail.guiModeAvailable,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_GUIModeChange(t){t.stopPropagation(),this._cardGUIMode=t.detail.guiMode,this._cardGUIModeAvailable=t.detail.guiModeAvailable}_toggleMode(t){this._cardEditorEl.toggleMode()}_moveCard(t){const e=this._selectedCard,i=e+t.currentTarget.move,o=[...this._config.cards],s=o.splice(e,1)[0];o.splice(i,0,s),this._config=Object.assign(Object.assign({},this._config),{cards:o}),this._selectedCard=i,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_deleteCard(){const t=[...this._config.cards];t.splice(this._selectedCard,1),this._config=Object.assign(Object.assign({},this._config),{cards:t}),this._selectedCard=Math.max(0,this._selectedCard-1),this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:this._config}}))}_valueChanged(t){t.stopPropagation();const e=t.detail.value;this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:e}}))}_computeLabel(t){return"layout_type"===t.name?this.hass.localize("ui.panel.lovelace.editor.edit_view.type"):"layout"===t.name?"Layout options (layout-card)":void 0}render(){return this.hass&&this._config?U` +
+
+ + + + +
+
+ ${[this._renderLayoutEditor,this._renderCardsEditor][this._selectedTab].bind(this)()} +
+
+ `:U``}_renderLayoutEditor(){const t=this._schema(this.hass.localize),e=Object.assign({},this._config);return U` +

+ See + + layout-card on github + + for usage instructions. +

+ + `}_renderCardsEditor(){const t=this._selectedCard,e=this._config.cards.length;return this._config.entities?U` + This layout-card has the entities parameter set. You cannot + manually select cards. + `:U` +
+
+ + ${this._config.cards.map(((t,e)=>U` ${e+1} `))} + + + + + + +
+
+ ${t + + ${this.hass.localize(this._cardEditorEl||this._cardGUIMode?"ui.panel.lovelace.editor.edit_card.show_code_editor":"ui.panel.lovelace.editor.edit_card.show_visual_editor")} + + + + + + + + + + +
+ + `:U` + + `} +
+ + `}static get styles(){return[n` + mwc-tab-bar { + border-bottom: 1px solid var(--divider-color); + } + + .layout, + .cards #editor { + margin-top: 8px; + border: 1px solid var(--divider-color); + padding: 12px; + } + + .cards .toolbar { + display: flex; + --paper-tabs-selection-bar-color: var(--primary-color); + --paper-tab-ink: var(--primary-color); + } + paper-tabs { + display: flex; + font-size: 14px; + flex-grow: 1; + } + #add-card { + max-width: 32px; + padding: 0; + } + + .cards .card-options { + display: flex; + justify-content: flex-end; + width: 100%; + } + #editor { + border: 1px solid var(--divider-color); + padding: 12px; + } + .gui-mode-button { + margin-right: auto; + } + + a { + color: var(--primary-color); + } + `]}}t([tt()],Pt.prototype,"_config",void 0),t([tt()],Pt.prototype,"lovelace",void 0),t([tt()],Pt.prototype,"hass",void 0),t([et()],Pt.prototype,"_selectedTab",void 0),t([et()],Pt.prototype,"_selectedCard",void 0),t([et()],Pt.prototype,"_cardGUIMode",void 0),t([et()],Pt.prototype,"_cardGUIModeAvailable",void 0),t([function(t,e){return(({finisher:t,descriptor:e})=>(i,o)=>{var s;if(void 0===o){const o=null!==(s=i.originalKey)&&void 0!==s?s:i.key,n=null!=e?{kind:"method",placement:"prototype",key:o,descriptor:e(i.key)}:{...i,key:o};return null!=t&&(n.finisher=function(e){t(e,o)}),n}{const s=i.constructor;void 0!==e&&Object.defineProperty(i,o,e(o)),null==t||t(s,o)}})({descriptor:i=>{const o={get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;o.get=function(){var i,o;return void 0===this[e]&&(this[e]=null!==(o=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==o?o:null),this[e]}}return o}})}("hui-card-element-editor")],Pt.prototype,"_cardEditorEl",void 0),customElements.define("layout-card-editor",Pt),customElements.whenDefined("hui-card-element-editor").then((()=>{const t=customElements.get("hui-card-element-editor"),e=t.prototype.getConfigElement;t.prototype.getConfigElement=async function(){const t=await e.bind(this)();if(t){const e=t.setConfig;t.setConfig=function(t){let i=JSON.parse(JSON.stringify(t));this._layoutData=i.view_layout,delete i.view_layout,e.bind(this)(i)}}return t};const i=t.prototype._handleUIConfigChanged;t.prototype._handleUIConfigChanged=function(t){this._configElement&&this._configElement._layoutData&&(t.detail.config.view_layout=this._configElement._layoutData),i.bind(this)(t)}})),customElements.whenDefined("hui-view-editor").then((()=>{const t=customElements.get("hui-view-editor"),e=t.prototype.firstUpdated;t.prototype.firstUpdated=function(){null==e||e.bind(this)(),this._oldSchema=this._schema,this._schema=t=>{const e=this._oldSchema(t),i=e[e.length-1];return"layout"===i.name||(i.selector.select.options.push(...Ut),e.push({name:"layout",selector:{object:{}}})),e};const t=document.createElement("p");t.innerHTML='\n You have layout-card installed which adds some options to this dialog.
\n Please see\n \n layout-card on github\n \n for usage instructions.\n \n ',this.shadowRoot.appendChild(t),this.requestUpdate()}}));class Rt extends HTMLElement{setConfig(t){var e,i;this.height=null!==(e=t.height)&&void 0!==e?e:50,this.size=null!==(i=t.size)&&void 0!==i?i:Math.ceil(this.height/50),this.style.cssText=`\n display: block;\n height: ${this.height}px;\n `}getCardSize(){return this.size}static getConfigElement(){return document.createElement("gap-card-editor")}static getStubConfig(){return{}}}customElements.define("gap-card",Rt),window.customCards=window.customCards||[],window.customCards.push({type:"gap-card",name:"Gap Card",preview:!1,description:"Add a customizable gap in the layout."});class zt extends Y{setConfig(t){this._config=t}heightChanged(t){const e=Object.assign({},this._config);delete e.height,t.detail.value&&(e.height=parseInt(t.detail.value)),this._config=e,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:e}}))}sizeChanged(t){const e=Object.assign({},this._config);delete e.size,t.detail.value&&(e.size=parseInt(t.detail.value)),this._config=e,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:e}}))}render(){return U` + + + `}}t([tt()],zt.prototype,"_config",void 0),customElements.define("gap-card-editor",zt);var Ht="2.4.2";console.groupCollapsed(`%cLAYOUT-CARD ${Ht} IS INSTALLED`,"color: green; font-weight: bold"),console.log("Readme:","https://github.com/thomasloven/lovelace-layout-card"),console.groupEnd(); diff --git a/custom_components/ui_lovelace_minimalist/cards/lovelace-state-switch/lovelace-state-switch.js b/custom_components/ui_lovelace_minimalist/cards/lovelace-state-switch/lovelace-state-switch.js new file mode 100644 index 000000000..363339aff --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/cards/lovelace-state-switch/lovelace-state-switch.js @@ -0,0 +1,139 @@ +function t(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r}const e=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new Map;class o{constructor(t,e){if(this._$cssResult$=!0,e!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=s.get(this.cssText);return e&&void 0===t&&(s.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}}const n=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,i,s)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new o(s,i)},r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new o("string"==typeof t?t:t+"",i))(e)})(t):t;var a;const l=window.trustedTypes,h=l?l.emptyScript:"",d=window.reactiveElementPolyfillSupport,c={toAttribute(t,e){switch(e){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},u=(t,e)=>e!==t&&(e==e||t==t),p={attribute:!0,type:String,converter:c,reflect:!1,hasChanged:u};class v extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;null!==(e=this.l)&&void 0!==e||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const s=this._$Eh(i,e);void 0!==s&&(this._$Eu.set(s,i),t.push(s))})),t}static createProperty(t,e=p){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const o=this[t];this[e]=s,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Eh(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$Eg)&&void 0!==e?e:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$Eg)||void 0===e||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const i=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,i)=>{e?t.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):i.forEach((e=>{const i=document.createElement("style"),s=window.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))})(i,this.constructor.elementStyles),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=p){var s,o;const n=this.constructor._$Eh(t,i);if(void 0!==n&&!0===i.reflect){const r=(null!==(o=null===(s=i.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==o?o:c.toAttribute)(e,i.type);this._$Ei=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Ei=null}}_$AK(t,e){var i,s,o;const n=this.constructor,r=n._$Eu.get(t);if(void 0!==r&&this._$Ei!==r){const t=n.getPropertyOptions(r),a=t.converter,l=null!==(o=null!==(s=null===(i=a)||void 0===i?void 0:i.fromAttribute)&&void 0!==s?s:"function"==typeof a?a:null)&&void 0!==o?o:c.fromAttribute;this._$Ei=r,this[r]=l(e,t.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,e)=>this[e]=t)),this._$Et=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$Eg)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$ES(e,this[e],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}var f;v.finalized=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:v}),(null!==(a=globalThis.reactiveElementVersions)&&void 0!==a?a:globalThis.reactiveElementVersions=[]).push("1.3.0");const _=globalThis.trustedTypes,m=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,$="?"+g,y=`<${$}>`,b=document,A=(t="")=>b.createComment(t),w=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,E=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C=/-->/g,x=/>/g,P=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,k=/'/g,U=/"/g,T=/^(?:script|style|textarea|title)$/i,H=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),M=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),O=new WeakMap,N=b.createTreeWalker(b,129,null,!1),L=(t,e)=>{const i=t.length-1,s=[];let o,n=2===e?"":"",r=E;for(let e=0;e"===l[0]?(r=null!=o?o:E,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?P:'"'===l[3]?U:k):r===U||r===k?r=P:r===C||r===x?r=E:(r=P,o=void 0);const c=r===P&&t[e+1].startsWith("/>")?" ":"";n+=r===E?i+y:h>=0?(s.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+g+c):i+g+(-2===h?(s.push(void 0),e):c)}const a=n+(t[i]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==m?m.createHTML(a):a,s]};class I{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,n=0;const r=t.length-1,a=this.parts,[l,h]=L(t,e);if(this.el=I.createElement(l,i),N.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=N.nextNode())&&a.length0){s.textContent=_?_.emptyScript:"";for(let i=0;i{var e;return S(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==R&&w(this._$AH)?this._$AA.nextSibling.data=t:this.k(b.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=I.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.m(i);else{const t=new D(o,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new I(t)),e}S(t){S(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new j(this.A(A()),this.A(A()),this,this.options)):i=e[s],i._$AI(o),s++;s2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const o=this.strings;let n=!1;if(void 0===o)t=z(this,t,e,0),n=!w(t)||t!==this._$AH&&t!==M,n&&(this._$AH=t);else{const s=t;let r,a;for(t=o[0],r=0;r{var s,o;const n=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let r=n._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;n._$litPart$=r=new j(e.insertBefore(A(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return M}}Q.finalized=!0,Q._$litElement$=!0,null===(F=globalThis.litElementHydrateSupport)||void 0===F||F.call(globalThis,{LitElement:Q});const X=globalThis.litElementPolyfillSupport;null==X||X({LitElement:Q}),(null!==(G=globalThis.litElementVersions)&&void 0!==G?G:globalThis.litElementVersions=[]).push("3.2.0");const Y=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function tt(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):Y(t,e)}var et;null===(et=window.HTMLSlotElement)||void 0===et||et.prototype.assignedElements;const it="lovelace-player-device-id";function st(){if(!localStorage[it]){const t=()=>Math.floor(1e5*(1+Math.random())).toString(16).substring(1);window.fully&&"function"==typeof fully.getDeviceId?localStorage[it]=fully.getDeviceId():localStorage[it]=`${t()}${t()}-${t()}${t()}`}return localStorage[it]}let ot=st();const nt=new URLSearchParams(window.location.search);var rt;function at(){return document.querySelector("hc-main")?document.querySelector("hc-main").hass:document.querySelector("home-assistant")?document.querySelector("home-assistant").hass:void 0}function lt(t){return!!String(t).includes("{%")||(!!String(t).includes("{{")||void 0)}nt.get("deviceID")&&null!==(rt=nt.get("deviceID"))&&("clear"===rt?localStorage.removeItem(it):localStorage[it]=rt,ot=st()),window.cardMod_template_cache=window.cardMod_template_cache||{};const ht=window.cardMod_template_cache;async function dt(t,e,i){const s=at().connection,o=JSON.stringify([e,i]);let n=ht[o];n?(n.callbacks.has(t)||ct(t),t(n.value),n.callbacks.add(t)):(ct(t),t(""),i=Object.assign({user:at().user.name,browser:ot,hash:location.hash.substr(1)||""},i),ht[o]=n={template:e,variables:i,value:"",callbacks:new Set([t]),unsubscribe:s.subscribeMessage((t=>function(t,e){const i=ht[t];i&&(i.value=e.result,i.callbacks.forEach((t=>t(e.result))))}(o,t)),{type:"render_template",template:e,variables:i})})}async function ct(t){let e;for(const[i,s]of Object.entries(ht))if(s.callbacks.has(t)){s.callbacks.delete(t),0==s.callbacks.size&&(e=s.unsubscribe,delete ht[i]);break}e&&await(await e)()}var ut="1.9.3";class pt extends Q{constructor(){super(...arguments),this.cardsInitialized=!1,this.templateRenderer=t=>{this._tmpl=t}}async setConfig(t){if(window.deviceID=ot,this._config=t,this.state=void 0,this.classList.add("no-match"),this.cards={},this.buildCards(),"hash"===t.entity&&(window.addEventListener("location-changed",(()=>this.updated(new Map))),window.addEventListener("hashchange",(()=>this.updated(new Map)))),"mediaquery"===t.entity)for(const e in t.states){window.matchMedia(e).addEventListener("change",(()=>this.update_state()))}if("template"===t.entity||lt(t.entity)){const e=lt(t.entity)?t.entity:t.template;dt(this.templateRenderer,e,{config:t})}this.style.setProperty("display","none")}connectedCallback(){if(super.connectedCallback(),this._config){for(const t in this.cards)this.cards[t].hass=this._hass;("template"===this._config.entity||lt(this._config.entity))&&dt(this.templateRenderer,lt(this._config.entity)?this._config.entity:this._config.template,{config:this._config})}}disconnectedCallback(){super.disconnectedCallback(),ct(this.templateRenderer)}async buildCards(){const t=await window.loadCardHelpers();for(let e in this._config.states)this.cards[e]=await t.createCardElement(this._config.states[e]),this.cards[e].hass=this._hass;this.cardsInitialized=!0,this.update_state(),this._updateVisibility()}update_state(){var t,e,i,s,o,n;if(!this.cardsInitialized)return;let r;switch(this._config.entity){case"template":r=this._tmpl;break;case"user":r=null===(e=null===(t=this._hass)||void 0===t?void 0:t.user)||void 0===e?void 0:e.name;break;case"group":r=(null===(s=null===(i=this._hass)||void 0===i?void 0:i.user)||void 0===s?void 0:s.is_admin)?"admin":"user";break;case"deviceID":case"browser":r=ot;break;case"hash":r=location.hash.substring(1);break;case"mediaquery":for(const t in this.cards)if(window.matchMedia(t).matches){r=t;break}break;default:r=lt(this._config.entity)?this._tmpl:null===(n=null===(o=this._hass)||void 0===o?void 0:o.states[this._config.entity])||void 0===n?void 0:n.state}void 0!==r&&this.cards.hasOwnProperty(r)||(r=this._config.default),this.state=r}set hass(t){this._hass=t;for(const e in this.cards)this.cards[e].hass=t}_updateVisibility(){this.cards[this.state]?(this.classList.remove("no-match"),this.style.setProperty("display",""),this.removeAttribute("hidden")):(this.classList.add("no-match"),this.style.setProperty("display","none"),this.setAttribute("hidden",""))}updated(t){if(t.has("state")){const e=t.get("state");this.cards[e]&&(this.cards[e].classList.remove("visible"),this._config.transition&&(this.shadowRoot.querySelector("#root").classList.add("transition"),this.cards[e].classList.add("out"),window.setTimeout((()=>{this.cards[e].classList.remove("out"),window.setTimeout((()=>{this.shadowRoot.querySelector("#root").classList.remove("transition")}),this._config.transition_time||500)}),this._config.transition_time||500))),this.cards[this.state]&&this.cards[this.state].classList.add("visible"),this._updateVisibility()}else this.update_state()}render(){return H` +
+ ${Object.keys(this.cards).map((t=>H` ${this.cards[t]} `))} +
+ `}async getCardSize(){var t;let e=1;for(const i in this.cards)(null===(t=this.cards[i])||void 0===t?void 0:t.getCardSize)&&(e=Math.max(e,await this.cards[i].getCardSize()));return e}static get styles(){return n` + :host { + perspective: 1000px; + } + :host(.no-match) { + display: none; + } + #root { + margin: -4px; + padding: 4px; + display: grid; + grid-template-rows: auto 0px; + overflow: clip visible; + } + #root.transition { + overflow: hidden; + } + #root * { + grid-column: 1; + grid-row: 2; + overflow: hidden; + min-width: 0; + } + #root *.visible, + #root *.out { + grid-row: 1; + overflow: visible; + } + + #root.slide-down *, + #root.slide-up *, + #root.slide-left *, + #root.slide-right * { + transition-property: transform; + transition-timing-function: linear; + transition-duration: inherit; + transform: translate(0, -110%); + } + #root.slide-up * { + transform: translate(0, 110%); + } + #root.slide-left * { + transform: translate(110%, 0); + } + #root.slide-right * { + transform: translate(-110%, 0); + } + #root.slide-down .visible, + #root.slide-up .visible, + #root.slide-left .visible, + #root.slide-right .visible { + transform: translate(0%); + } + #root.slide-down .out { + transform: translate(0, 110%); + } + #root.slide-up .out { + transform: translate(0, -110%); + } + #root.slide-left .out { + transform: translate(-110%); + } + #root.slide-right .out { + transform: translate(110%); + } + + #root.swap-down *, + #root.swap-up *, + #root.swap-left *, + #root.swap-right * { + transition-property: transform; + transition-timing-function: linear; + transition-duration: inherit; + transform: translate(0, 110%); + } + #root.swap-up * { + transform: translate(0, -110%); + } + #root.swap-left * { + transform: translate(-110%, 0); + } + #root.swap-right * { + transform: translate(110%, 0); + } + #root.swap-down .visible, + #root.swap-up .visible, + #root.swap-left .visible, + #root.swap-right .visible { + transition-delay: inherit; + transform: translate(0%); + } + + #root.flip, + #root.flip-x, + #root.flip-y { + position: relative; + perspective: 1000px; + } + #root.flip *, + #root.flip-x *, + #root.flip-y * { + transform: rotate3d(0, 1, 0, -180deg); + transition-property: transform; + transition-timing-function: linear; + transition-duration: inherit; + transform-style: preserve-3d; + backface-visibility: hidden; + z-index: 100; + } + #root.flip-y * { + transform: rotate3d(1, 0, 0, -180deg); + } + #root.flip .visible, + #root.flip-x .visible, + #root.flip-y .visible { + backface-visibility: hidden; + transform: rotate3d(0, 0, 0, 0deg); + } + #root.flip .out, + #root.flip-x .out, + #root.flip-y .out { + pointer-events: none; + transform: rotate3d(0, 1, 0, 180deg); + } + #root.flip-y .out { + transform: rotate3d(1, 0, 0, 180deg); + } + `}}t([tt()],pt.prototype,"_config",void 0),t([tt()],pt.prototype,"_hass",void 0),t([tt()],pt.prototype,"state",void 0),t([tt()],pt.prototype,"_tmpl",void 0),customElements.get("state-switch")||(customElements.define("state-switch",pt),console.info(`%cSTATE-SWITCH ${ut} IS INSTALLED`,"color: green; font-weight: bold","")); diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/cn.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/cn.yaml index 2475fbacf..9b3781eb9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/cn.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/cn.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "你好" ulm_volume: "体积" ulm_popups_color: "顏色" + ulm_radar: "雷达" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/cs.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/cs.yaml index 79e777838..443813fe2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/cs.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/cs.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Ahoj" ulm_volume: "Hlasitost" ulm_popups_color: "Barva" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/da.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/da.yaml index 7daaffaf0..1f16b71f2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/da.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/da.yaml @@ -13,3 +13,4 @@ ulm_language_variables: ulm_hello: "Hej" ulm_volume: "Volumen" ulm_popups_color: "Farve" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/de.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/de.yaml index 9f7317d67..84b40122a 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/de.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/de.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Hallo" ulm_volume: "Lautstärke" ulm_popups_color: "Farbe" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/en.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/en.yaml index 26639da6e..93d2c3bfa 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/en.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/en.yaml @@ -13,3 +13,4 @@ ulm_language_variables: ulm_hello: "Hello" ulm_volume: "Volume" ulm_popups_color: "Color" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/es.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/es.yaml index bc8952353..84ebd9eeb 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/es.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/es.yaml @@ -13,3 +13,4 @@ ulm_language_variables: ulm_hello: "Hola" ulm_volume: "Volumen" ulm_popups_color: "Color" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/fi.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/fi.yaml index 7a06561fa..d3f78a6ec 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/fi.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/fi.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Hei" ulm_volume: "Äänenvoimakkuus" ulm_popups_color: "Väri" + ulm_radar: "Tutka" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/fr.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/fr.yaml index 482267b00..966732ccf 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/fr.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/fr.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Bonjour" ulm_volume: "Volume" ulm_popups_color: "Couleur" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/it.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/it.yaml index 1019eedf8..89b7327f1 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/it.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/it.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Ciao" ulm_volume: "Volume" ulm_popups_color: "Colore" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/nl.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/nl.yaml index 00ea82687..ebd499d7d 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/nl.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/nl.yaml @@ -13,3 +13,4 @@ ulm_language_variables: ulm_hello: "Hallo" ulm_volume: "Volume" ulm_popups_color: "Kleur" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/no.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/no.yaml index d2c9d27f9..47e6451dc 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/no.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/no.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Hei" ulm_volume: "Volume" ulm_popups_color: "Farge" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/pl.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/pl.yaml index 079e0a85c..f6b960552 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/pl.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/pl.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Witaj" ulm_volume: "Objętość" ulm_popups_color: "Kolor" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/pt-BR.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/pt-BR.yaml index 15a0ce73b..fc593775b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/pt-BR.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/pt-BR.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Olá" ulm_volume: "Volume" ulm_popups_color: "Cor" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/pt.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/pt.yaml index 220c309d0..a6bb80f45 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/pt.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/pt.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Olá" ulm_volume: "Volume" ulm_popups_color: "Cor" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/ru.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/ru.yaml index ceb1f12a6..fae2fe72b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/ru.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/ru.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Здравствуйте" ulm_volume: "Объем" ulm_popups_color: "Цвет" + ulm_radar: "Pадар" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/sk.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/sk.yaml index c47bcc031..1ec4dcf7f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/sk.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/sk.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Ahoj" ulm_volume: "Volume" ulm_popups_color: "Farba" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/sv.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/sv.yaml index b0b865550..2d93e8fb4 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/sv.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/sv.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Hej" ulm_volume: "Volym" ulm_popups_color: "Färg" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/translations/tr.yaml b/custom_components/ui_lovelace_minimalist/lovelace/translations/tr.yaml index 5d0fa3011..25f8c73b6 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/translations/tr.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/translations/tr.yaml @@ -10,3 +10,4 @@ ulm_language_variables: ulm_hello: "Hello" ulm_volume: "Cilt" ulm_popups_color: "Renk" + ulm_radar: "Radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index 9c9c42d63..44e647d02 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -1,15 +1,13 @@ --- ### Actions card ### ulm_actions_card: - template: - - "ulm_custom_actions" tap_action: action: > [[[ - var action = variables.ulm_card_tap_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_card_tap_action != null ? variables.ulm_card_tap_action : 'toggle'; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -21,16 +19,21 @@ ulm_actions_card: action = 'call-service' } - if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ - action = 'fire-dom-event' + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + action = 'fire-dom-event'; + } } + if (action == 'popup'){ action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_card_tap_action == 'navigate' ? variables.ulm_card_tap_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_card_tap_haptic != null ? variables.ulm_card_tap_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -43,28 +46,40 @@ ulm_actions_card: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" - hold_action: action: > [[[ - var action = variables.ulm_card_hold_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_card_hold_action != null ? variables.ulm_card_hold_action : 'more-info'; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -76,9 +91,13 @@ ulm_actions_card: action = 'call-service' } - if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ - action = 'fire-dom-event' + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + action = 'fire-dom-event'; + } } + if (action == 'popup'){ action = 'more-info' } @@ -86,6 +105,7 @@ ulm_actions_card: return action ]]] navigation_path: "[[[ return variables.ulm_card_hold_action == 'navigate' ? variables.ulm_card_hold_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_card_hold_haptic != null ? variables.ulm_card_hold_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -98,27 +118,40 @@ ulm_actions_card: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" double_tap_action: action: > [[[ - var action = variables.ulm_card_double_tap_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_card_double_tap_action != null ? variables.ulm_card_double_tap_action : "adaptive"; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -130,9 +163,13 @@ ulm_actions_card: action = 'call-service' } - if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ - action = 'fire-dom-event' + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + action = 'fire-dom-event'; + } } + if (action == 'popup'){ action = 'more-info' } @@ -140,6 +177,7 @@ ulm_actions_card: return action ]]] navigation_path: "[[[ return variables.ulm_card_double_tap_action == 'navigate' ? variables.ulm_card_double_tap_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_card_double_tap_haptic != null ? variables.ulm_card_double_tap_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -152,17 +190,30 @@ ulm_actions_card: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index eccbc286c..e4f6e7418 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -1,15 +1,13 @@ --- ### Actions icon ### ulm_actions_icon: - template: - - "ulm_custom_actions" tap_action: action: > [[[ - var action = variables.ulm_icon_tap_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_icon_tap_action != null ? variables.ulm_icon_tap_action : 'toggle'; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -21,16 +19,21 @@ ulm_actions_icon: action = 'call-service' } - if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ - action = 'fire-dom-event' + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + action = 'fire-dom-event'; + } } + if (action == 'popup'){ action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_icon_tap_action == 'navigate' ? variables.ulm_icon_tap_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_icon_tap_haptic != null ? variables.ulm_icon_tap_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -52,19 +55,41 @@ ulm_actions_icon: if (variables.ulm_card_media_player_enable_popup){ return 'popup_media_player_infos' } + + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } + } + ]]] hold_action: action: > [[[ - var action = variables.ulm_icon_hold_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_icon_hold_action != null ? variables.ulm_icon_hold_action : 'more_info'; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -76,16 +101,21 @@ ulm_actions_icon: action = 'call-service' } - if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ - action = 'fire-dom-event' + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + action = 'fire-dom-event'; + } } + if (action == 'popup'){ action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_icon_hold_action == 'navigate' ? variables.ulm_icon_hold_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_icon_hold_haptic != null ? variables.ulm_icon_hold_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -107,18 +137,41 @@ ulm_actions_icon: if (variables.ulm_card_media_player_enable_popup){ return 'popup_media_player_infos' } + + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } + + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } + } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" double_tap_action: action: > [[[ - var action = variables.ulm_icon_double_tap_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_icon_double_tap_action != null ? variables.ulm_icon_double_tap_action : 'adaptive'; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -133,13 +186,22 @@ ulm_actions_icon: if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ action = 'fire-dom-event' } + + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + action = 'fire-dom-event'; + } + } + if (action == 'popup'){ action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_icon_double_tap_action == 'navigate' ? variables.ulm_icon_double_tap_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_icon_double_tap_haptic != null ? variables.ulm_icon_double_tap_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -152,17 +214,30 @@ ulm_actions_icon: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 3210625c7..6140e4ab9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -1,15 +1,13 @@ --- ### Actions name ### ulm_actions_name: - template: - - "ulm_custom_actions" tap_action: action: > [[[ - var action = variables.ulm_name_tap_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_name_tap_action != null ? variables.ulm_name_tap_action : 'toggle'; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -21,16 +19,21 @@ ulm_actions_name: action = 'call-service' } - if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ - action = 'fire-dom-event' + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + action = 'fire-dom-event'; + } } + if (action == 'popup'){ action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_name_tap_action == 'navigate' ? variables.ulm_name_tap_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_name_tap_haptic != null ? variables.ulm_name_tap_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -43,28 +46,40 @@ ulm_actions_name: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" - hold_action: action: > [[[ - var action = variables.ulm_name_hold_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_name_hold_action != null ? variables.ulm_name_hold_action : 'more-info'; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -76,16 +91,21 @@ ulm_actions_name: action = 'call-service' } - if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ - action = 'fire-dom-event' + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + action = 'fire-dom-event'; + } } + if (action == 'popup'){ action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_name_hold_action == 'navigate' ? variables.ulm_name_hold_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_name_hold_haptic != null ? variables.ulm_name_hold_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -98,27 +118,40 @@ ulm_actions_name: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" double_tap_action: action: > [[[ - var action = variables.ulm_name_double_tap_action; - let domain = entity.entity_id.substr(0, entity.entity_id.indexOf(".")); + var action = variables.ulm_name_double_tap_action != null ? variables.ulm_name_double_tap_action : 'adaptive'; + let domain = (entity != null) ? entity.entity_id.substr(0, entity.entity_id.indexOf(".")) : ""; - if (domain == "binary_sensor" || domain == "sensor"){ + if (domain == "binary_sensor" || domain == "sensor" || domain == ""){ if (action == 'toggle') action = 'none'; } @@ -130,16 +163,21 @@ ulm_actions_name: action = 'call-service' } - if (action == 'popup' && (variables.ulm_card_light_enable_popup || variables.ulm_card_media_player_enable_popup || variables.ulm_card_thermostat_enable_popup) ){ - action = 'fire-dom-event' + if (action == 'popup' && (variables.ulm_custom_popup != null )){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config){ + action = 'fire-dom-event'; + } } + if (action == 'popup'){ action = 'more-info' } - return action + return action; ]]] navigation_path: "[[[ return variables.ulm_name_double_tap_action == 'navigate' ? variables.ulm_name_double_tap_navigate_path : '/0' ]]]" + haptic: "[[[ return variables.ulm_name_double_tap_haptic != null ? variables.ulm_name_double_tap_haptic : 'none' ]]]" service: "input_select.select_option" service_data: option: "[[[ return variables.ulm_input_select_option ]]]" @@ -152,17 +190,30 @@ ulm_actions_name: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } ]]] - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/2-line_cards/card_graph.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/2-line_cards/card_graph.yaml index 878bc8244..5ecfd6e63 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/2-line_cards/card_graph.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/2-line_cards/card_graph.yaml @@ -1,6 +1,8 @@ --- ### Card Graph ### card_graph: + template: + - "extended_card" variables: ulm_card_graph_color: "var(--info-color)" ulm_card_graph_name: "[[[ return entity.attributes.friendly_name; ]]]" @@ -10,46 +12,17 @@ card_graph: ulm_card_graph_hours: 24 ulm_card_graph_type: "fill" ulm_card_graph_points: "0.5" - show_icon: false - show_name: false - show_label: false triggers_update: "all" - styles: - grid: - - grid-template-areas: "'item1' 'item2'" - - grid-template-columns: "1fr" - - grid-template-rows: "min-content min-content" - card: - - border-radius: "var(--border-radius)" - - box-shadow: "var(--box-shadow)" - - padding: "0px" custom_fields: item1: card: type: "custom:button-card" template: - "card_generic" - styles: - card: - - box-shadow: "none" - - border-radius: "var(--border-radius) var(--border-radius) 0px 0px" - - padding: "12px" - entity: "[[[ return entity.entity_id ]]]" - custom_fields: - item1: - card: - type: "custom:button-card" - custom_fields: - item1: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - icon: "[[[ return variables.ulm_card_graph_icon; ]]]" - item2: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - label: "[[[ return variables.ulm_card_graph_name ]]]" + variables: + ulm_card_generic_icon: "[[[ return variables.ulm_card_graph_icon; ]]]" + ulm_card_generic_name: "[[[ return variables.ulm_card_graph_name; ]]]" + item2: card: type: "custom:mini-graph-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml index 499cfb2fc..a4e1ba541 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml @@ -3,7 +3,6 @@ card_battery: template: - "icon_more_info_new" - - "ulm_actions_card" - "ulm_translation_engine" variables: ulm_card_battery_name: "[[[ return entity.attributes.friendly_name ]]]" @@ -24,9 +23,6 @@ card_battery: item1: card: type: "custom:button-card" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" icon: | [[[ @@ -99,9 +95,6 @@ card_battery: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" name: "[[[ return variables.ulm_card_battery_name ]]]" label: | [[[ diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml index 781db4a35..b6501a4db 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml @@ -5,7 +5,6 @@ card_binary_sensor: - "icon_more_info_new" - "blue" - "ulm_translation_engine" - - "ulm_actions_card" show_last_changed: false variables: ulm_show_last_changed: false @@ -23,9 +22,6 @@ card_binary_sensor: type: "custom:button-card" template: - "blue" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_binary_sensor_icon; ]]]" item2: @@ -33,9 +29,6 @@ card_binary_sensor: type: "custom:button-card" template: - "blue_no_card" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_binary_sensor_name; ]]]" label: "[[[ return variables.ulm_translation_state;]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml index 01020386e..2ca7fd9af 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml @@ -5,7 +5,6 @@ card_binary_sensor_alert: - "icon_more_info_alert" - "blue" - "ulm_translation_engine" - - "ulm_actions_card" show_last_changed: false variables: ulm_show_last_changed: false @@ -23,9 +22,6 @@ card_binary_sensor_alert: type: "custom:button-card" template: - "blue" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_binary_sensor_alert_icon; ]]]" item2: @@ -33,9 +29,6 @@ card_binary_sensor_alert: type: "custom:button-card" template: - "blue_no_card" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_binary_sensor_alert_name; ]]]" label: "[[[ return variables.ulm_translation_state;]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_cover.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_cover.yaml index a48a2f544..4c355ec54 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_cover.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_cover.yaml @@ -3,7 +3,6 @@ card_cover: template: - "icon_more_info_new" - - "ulm_actions_card" - "ulm_translation_engine" variables: ulm_card_cover_name: "[[[ return entity.attributes.friendly_name ]]]" @@ -89,9 +88,6 @@ card_cover: item1: card: type: "custom:button-card" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" icon: | [[[ @@ -174,9 +170,6 @@ card_cover: item2: card: type: "custom:button-card" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_cover_name ]]]" label: >- diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml index 61a33675e..bc239d3a3 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml @@ -3,7 +3,6 @@ card_generic: template: - "icon_more_info_new" - - "ulm_actions_card" - "ulm_translation_engine" variables: ulm_card_generic_icon: "[[[ return entity.attributes.icon ]]]" @@ -17,9 +16,6 @@ card_generic: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" icon: "[[[ return variables.ulm_card_generic_icon; ]]]" styles: icon: @@ -28,8 +24,5 @@ card_generic: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" name: "[[[ return variables.ulm_translation_state_unit ]]]" label: "[[[ return variables.ulm_card_generic_name ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml index 58c80b476..0b75b093c 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml @@ -3,7 +3,6 @@ card_generic_swap: template: - "icon_more_info_new" - - "ulm_actions_card" - "ulm_translation_engine" variables: ulm_card_generic_swap_icon: "[[[ return entity.attributes.icon ]]]" @@ -17,9 +16,6 @@ card_generic_swap: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" icon: "[[[ return variables.ulm_card_generic_swap_icon; ]]]" styles: icon: @@ -28,8 +24,5 @@ card_generic_swap: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" label: "[[[ return variables.ulm_translation_state_unit ]]]" name: "[[[ return variables.ulm_card_generic_swap_name ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml index 32a9c4522..cfaef7581 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml @@ -3,7 +3,6 @@ card_input_boolean: template: - "icon_more_info_new" - - "ulm_actions_card" - "ulm_translation_engine" - "blue" variables: @@ -21,9 +20,7 @@ card_input_boolean: type: "custom:button-card" template: - "blue" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_input_boolean_icon; ]]]" item2: @@ -31,9 +28,6 @@ card_input_boolean: type: "custom:button-card" template: - "blue_no_card" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_input_boolean_name; ]]]" label: "[[[ return variables.ulm_translation_state ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_light.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_light.yaml index a5e0e5c1f..3a3db1e2d 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_light.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_light.yaml @@ -3,7 +3,6 @@ card_light: template: - "icon_more_info_new" - - "ulm_actions_card" - "ulm_translation_engine" variables: ulm_card_light_name: "[[[ return entity.attributes.friendly_name ]]]" @@ -104,10 +103,16 @@ card_light: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_light_icon ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" - ulm_card_light_enable_popup: "[[[ return variables.ulm_card_light_enable_popup; ]]]" + variables: > + [[[ + let vars = variables; + if(variables.ulm_card_light_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_light_brightness' + }; + } + return vars; + ]]] styles: icon: - color: > @@ -141,10 +146,16 @@ card_light: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" - ulm_card_light_enable_popup: "[[[ return variables.ulm_card_light_enable_popup; ]]]" + variables: > + [[[ + let vars = variables; + if(variables.ulm_card_light_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_light_brightness' + }; + } + return vars; + ]]] name: "[[[ return variables.ulm_card_light_name ]]]" label: >- [[[ @@ -200,10 +211,10 @@ card_light: [[[ var color = entity.attributes.rgb_color; if (entity.state == "unavailable"){ - return "rgba(var(--color-grey),1)"; + return "rgba(var(--color-grey),1)"; } else if (color && variables.ulm_card_light_enable_color){ - return "rgba(" + color + ",1)"; + return "rgba(" + color + ",1)"; } else{ return "rgba(var(--color-yellow),1)"; @@ -213,10 +224,10 @@ card_light: [[[ var color = entity.attributes.rgb_color; if (entity.state == "unavailable"){ - return "rgba(var(--color-grey),0.2)"; + return "rgba(var(--color-grey),0.2)"; } else if (color && variables.ulm_card_light_enable_color){ - return "rgba(" + color + ",0.2)"; + return "rgba(" + color + ",0.2)"; } else{ return "rgba(var(--color-yellow),0.2)"; @@ -226,10 +237,10 @@ card_light: [[[ var color = entity.attributes.rgb_color; if (entity.state == "unavailable"){ - return "rgba(var(--color-grey),1)"; + return "rgba(var(--color-grey),1)"; } else if (color && variables.ulm_card_light_enable_color){ - return "rgba(" + color + ",1)"; + return "rgba(" + color + ",1)"; } else{ return "rgba(var(--color-yellow),1)"; diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml index 6fafb3018..c0a952ff9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml @@ -3,7 +3,6 @@ card_media_player: template: - "icon_more_info_new" - - "ulm_actions_card" - "ulm_translation_engine" variables: ulm_card_media_player_name: "[[[ return entity.attributes.friendly_name ]]]" @@ -49,7 +48,7 @@ card_media_player: if (!variables.ulm_card_media_player_collapsible) { return "12px"; } else { - return entity.state !== "off" ? "12px" : "0px"; + return (entity.state === "off" || entity.state === "standby") ? "0px" : "12px"; } ]]] card: @@ -69,7 +68,7 @@ card_media_player: [[[ if(variables.ulm_card_media_player_enable_controls) { if(variables.ulm_card_media_player_collapsible){ - return entity.state === "off" ? "none" : "block"; + return (entity.state === "off" || entity.state === "standby") ? "none" : "block"; } return "block"; } @@ -80,7 +79,7 @@ card_media_player: [[[ if(variables.ulm_card_media_player_enable_volume_slider) { if(variables.ulm_card_media_player_collapsible){ - return entity.state === "off" ? "none" : "block"; + return (entity.state === "off" || entity.state === "standby") ? "none" : "block"; } return "block"; } @@ -95,13 +94,19 @@ card_media_player: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" - ulm_card_media_player_enable_popup: "[[[ return variables.ulm_card_media_player_enable_popup; ]]]" + variables: > + [[[ + let vars = variables; + if(variables.ulm_card_media_player_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_media_player_infos' + }; + } + return vars; + ]]] icon: | [[[ - var icon = entity.attributes.icon || "mdi:speaker"; + var icon = entity.attributes.icon || "mdi:speaker"; if(entity.attributes.app_name){ var app = entity.attributes.app_name.toLowerCase(); var icon = { @@ -113,6 +118,7 @@ card_media_player: "oto music": "mdi:music-circle", "pandora": "mdi:pandora", "netflix": "mdi:netflix", + "hulu": "mdi:hulu", "bluetooth audio": "mdi:bluetooth" } } @@ -139,10 +145,16 @@ card_media_player: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" - ulm_card_media_player_enable_popup: "[[[ return variables.ulm_card_media_player_enable_popup; ]]]" + variables: > + [[[ + let vars = variables; + if(variables.ulm_card_media_player_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_media_player_infos' + }; + } + return vars; + ]]] label: "[[[ return variables.ulm_translation_state ]]]" state: - operator: "template" @@ -153,7 +165,14 @@ card_media_player: return name; ]]] - operator: "template" - value: "[[[ return entity.state != 'off' ]]]" + value: "[[[ return entity.state == 'standby' ]]]" + name: | + [[[ + let name = variables.ulm_card_media_player_name || states[entity.entity_id].attributes.friendly_name; + return name; + ]]] + - operator: "template" + value: "[[[ return entity.state != 'off' || entity.state != 'standby']]]" name: | [[[ let name = variables.ulm_card_media_player_name || states[entity.entity_id].attributes.friendly_name; @@ -231,8 +250,7 @@ card_media_player: card: type: "custom:button-card" template: "popup_media_player_infos" - variables: - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" + entity: "[[[ return entity.entity_id ]]]" tap_action: action: "call-service" service: "media_player.media_previous_track" @@ -254,7 +272,6 @@ card_media_player: ? 'white' : 'rgba(var(--color-theme), 0.9)' ]]] - item2: card: type: "custom:button-card" @@ -272,8 +289,7 @@ card_media_player: card: type: "custom:button-card" template: "popup_media_player_infos" - variables: - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" + entity: "[[[ return entity.entity_id; ]]]" tap_action: action: "call-service" service: "media_player.media_play_pause" @@ -285,6 +301,8 @@ card_media_player: icon: "mdi:play" - value: "off" icon: "mdi:play" + - value: "standby" + icon: "mdi:play" styles: card: - background-color: | @@ -316,8 +334,7 @@ card_media_player: card: type: "custom:button-card" template: "popup_media_player_infos" - variables: - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" + entity: "[[[ return entity.entity_id; ]]]" tap_action: action: "call-service" service: "media_player.media_next_track" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_person.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_person.yaml index 048127b20..47da16c65 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_person.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_person.yaml @@ -6,6 +6,7 @@ card_person: - "ulm_translation_engine" variables: ulm_card_person_use_entity_picture: false + ulm_card_person_icon: "mdi:face-man" ulm_card_person_zone1: "" ulm_card_person_zone2: "" ulm_address: "" @@ -27,7 +28,7 @@ card_person: ]]] name: "[[[ return states[variables.ulm_card_person_entity].attributes.friendly_name ]]]" entity: "[[[ return variables.ulm_card_person_entity; ]]]" - icon: "mdi:face-man" + icon: "[[[ return variables.ulm_card_person_icon; ]]]" show_entity_picture: "[[[ return variables.ulm_card_person_use_entity_picture ]]]" entity_picture: "[[[ return variables.ulm_card_person_use_entity_picture ? states[variables.ulm_card_person_entity].attributes.entity_picture\ \ : null ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml index 695735cd3..70be47682 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml @@ -5,7 +5,6 @@ card_power_outlet: - "icon_more_info_new" - "yellow" - "ulm_translation_engine" - - "ulm_actions_card" variables: ulm_card_power_outlet_consumption_sensor: ulm_card_power_outlet_name: "[[[ return entity.attributes.friendly_name ]]]" @@ -23,9 +22,6 @@ card_power_outlet: type: "custom:button-card" template: - "yellow" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_power_outlet_icon ]]]" item2: @@ -33,9 +29,6 @@ card_power_outlet: type: "custom:button-card" template: - "yellow_no_card" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_power_outlet_name ]]]" label: |- diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml index f4c433f77..a9e55191e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml @@ -4,7 +4,6 @@ card_thermostat: template: - "ulm_translation_engine" - "icon_more_info_new" - - "ulm_actions_card" variables: ulm_card_thermostat_name: "[[[ return entity.attributes.friendly_name ]]]" ulm_card_thermostat_icon: "[[[ return 'mdi:thermometer' ]]]" @@ -148,10 +147,17 @@ card_thermostat: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" - ulm_card_thermostat_enable_popup: "[[[ return variables.ulm_card_thermostat_enable_popup; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_card_thermostat_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_thermostat_temperature' + }; + } + return vars; + ]]] icon: "[[[ return variables.ulm_card_thermostat_icon ]]]" state: - operator: "template" @@ -178,10 +184,17 @@ card_thermostat: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" - ulm_card_thermostat_enable_popup: "[[[ return variables.ulm_card_thermostat_enable_popup; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_card_thermostat_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_thermostat_temperature' + }; + } + return vars; + ]]] name: "[[[ return variables.ulm_card_thermostat_name ]]]" label: >- [[[ diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vacuum.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vacuum.yaml index 08c92502d..1057737b0 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vacuum.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_vacuum.yaml @@ -7,7 +7,6 @@ card_vacuum: template: - "icon_more_info_new" - "ulm_translation_engine" - - "ulm_actions_card" variables: ulm_card_vacuum_name: "[[[ return entity.attributes.friendly_name ]]]" ulm_card_vacuum_icon: "[[[ return entity.attributes.icon ]]]" @@ -78,9 +77,6 @@ card_vacuum: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" icon: "[[[ return variables.ulm_card_vacuum_icon ]]]" styles: icon: @@ -96,9 +92,6 @@ card_vacuum: item2: card: type: "custom:button-card" - variables: - ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" - ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_vacuum_name ]]]" label: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/chips/chip_temperature.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/chips/chip_temperature.yaml index 6674a83bb..81ba035b1 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/chips/chip_temperature.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/chips/chip_temperature.yaml @@ -1,7 +1,11 @@ --- ### Chip Temperature ### chip_temperature: - template: "chips" + template: + - "chips" + - "ulm_actions_card" + variables: + ulm_card_weather_enable_popup: false triggers_update: "all" label: | [[[ diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/extended_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/extended_card.yaml new file mode 100644 index 000000000..19ee39753 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/extended_card.yaml @@ -0,0 +1,69 @@ +--- +### Extension template for combining cards ### +extended_card: + template: + - "ulm_custom_actions" + - "ulm_actions_card" + show_icon: false + show_name: false + show_label: false + triggers_update: "all" + styles: + grid: + - grid-template-areas: "'item1' 'item2'" + - grid-template-columns: "1fr" + - grid-template-rows: "min-content min-content" + card: + - border-radius: "var(--border-radius)" + - box-shadow: "var(--box-shadow)" + - padding: "0px" + custom_fields: + item1: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" + ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + ulm_card_tap_action: "[[[ return variables.ulm_card_tap_action; ]]]" + ulm_card_tap_haptic: "[[[ return variables.ulm_card_tap_haptic; ]]]" + ulm_card_tap_navigate_path: "[[[ return variables.ulm_card_tap_navigate_path; ]]]" + ulm_card_hold_action: "[[[ return variables.ulm_card_hold_action; ]]]" + ulm_card_hold_haptic: "[[[ return variables.ulm_card_hold_haptic; ]]]" + ulm_card_hold_navigate_path: "[[[ return variables.ulm_card_hold_navigate_path; ]]]" + ulm_card_double_tap_action: "[[[ return variables.ulm_card_double_tap_action; ]]]" + ulm_card_double_tap_haptic: "[[[ return variables.ulm_card_double_tap_haptic; ]]]" + ulm_card_double_tap_navigate_path: "[[[ return variables.ulm_card_double_tap_navigate_path; ]]]" + ulm_icon_tap_action: "[[[ return variables.ulm_icon_tap_action; ]]]" + ulm_icon_tap_haptic: "[[[ return variables.ulm_icon_tap_haptic; ]]]" + ulm_icon_tap_navigate_path: "[[[ return variables.ulm_icon_tap_navigate_path; ]]]" + ulm_icon_hold_action: "[[[ return variables.ulm_icon_hold_action; ]]]" + ulm_icon_hold_haptic: "[[[ return variables.ulm_icon_hold_haptic; ]]]" + ulm_icon_hold_navigate_path: "[[[ return variables.ulm_icon_hold_navigate_path; ]]]" + ulm_icon_double_tap_action: "[[[ return variables.ulm_icon_double_tap_action; ]]]" + ulm_icon_double_tap_haptic: "[[[ return variables.ulm_icon_double_tap_haptic; ]]]" + ulm_icon_double_tap_navigate_path: "[[[ return variables.ulm_icon_double_tap_navigate_path; ]]]" + ulm_name_tap_action: "[[[ return variables.ulm_name_tap_action; ]]]" + ulm_name_tap_haptic: "[[[ return variables.ulm_name_tap_haptic; ]]]" + ulm_name_tap_navigate_path: "[[[ return variables.ulm_name_tap_navigate_path; ]]]" + ulm_name_hold_action: "[[[ return variables.ulm_name_hold_action; ]]]" + ulm_name_hold_haptic: "[[[ return variables.ulm_name_hold_haptic; ]]]" + ulm_name_hold_navigate_path: "[[[ return variables.ulm_name_hold_navigate_path; ]]]" + ulm_name_double_tap_action: "[[[ return variables.ulm_name_double_tap_action; ]]]" + ulm_name_double_tap_haptic: "[[[ return variables.ulm_name_double_tap_haptic; ]]]" + ulm_name_double_tap_navigate_path: "[[[ return variables.ulm_name_double_tap_navigate_path; ]]]" + ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" + styles: + card: + - box-shadow: "none" + - border-radius: "var(--border-radius) var(--border-radius) 0px 0px" + - padding: "12px" + + item2: + card: + type: "custom:button-card" + style: | + ha-card { + box-shadow: none; + border-radius: var(--border-radius); + } diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_alert.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_alert.yaml index 8aa570950..d072ab6f1 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_alert.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_alert.yaml @@ -4,6 +4,9 @@ icon_more_info_alert: show_icon: false show_name: false show_label: false + template: + - "ulm_custom_actions" + - "ulm_actions_card" styles: grid: - grid-template-areas: "'item1'" @@ -37,6 +40,19 @@ icon_more_info_alert: template: - "icon_alert" - "ulm_actions_icon" + variables: + ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" + ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + ulm_icon_tap_action: "[[[ return variables.ulm_icon_tap_action; ]]]" + ulm_icon_tap_haptic: "[[[ return variables.ulm_icon_tap_haptic; ]]]" + ulm_icon_tap_navigate_path: "[[[ return variables.ulm_icon_tap_navigate_path; ]]]" + ulm_icon_hold_action: "[[[ return variables.ulm_icon_hold_action; ]]]" + ulm_icon_hold_haptic: "[[[ return variables.ulm_icon_hold_haptic; ]]]" + ulm_icon_hold_navigate_path: "[[[ return variables.ulm_icon_hold_navigate_path; ]]]" + ulm_icon_double_tap_action: "[[[ return variables.ulm_icon_double_tap_action; ]]]" + ulm_icon_double_tap_haptic: "[[[ return variables.ulm_icon_double_tap_haptic; ]]]" + ulm_icon_double_tap_navigate_path: "[[[ return variables.ulm_icon_double_tap_navigate_path; ]]]" + ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: - overflow: "visible" @@ -48,8 +64,24 @@ icon_more_info_alert: template: - "icon_info" - "ulm_actions_name" + variables: + ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" + ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + ulm_name_tap_action: "[[[ return variables.ulm_name_tap_action; ]]]" + ulm_name_tap_haptic: "[[[ return variables.ulm_name_tap_haptic; ]]]" + ulm_name_tap_navigate_path: "[[[ return variables.ulm_name_tap_navigate_path; ]]]" + ulm_name_hold_action: "[[[ return variables.ulm_name_hold_action; ]]]" + ulm_name_hold_haptic: "[[[ return variables.ulm_name_hold_haptic; ]]]" + ulm_name_hold_navigate_path: "[[[ return variables.ulm_name_hold_navigate_path; ]]]" + ulm_name_double_tap_action: "[[[ return variables.ulm_name_double_tap_action; ]]]" + ulm_name_double_tap_haptic: "[[[ return variables.ulm_name_double_tap_haptic; ]]]" + ulm_name_double_tap_navigate_path: "[[[ return variables.ulm_name_double_tap_navigate_path; ]]]" + ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: - padding: "6px" - margin-left: "-6px" - background-color: "rgba(0,0,0,0)" + custom_fields: + notification: + - display: "none" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_new.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_new.yaml index 2731d226a..d4c806178 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_new.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/internal_templates/icon_more_info_new.yaml @@ -4,6 +4,9 @@ icon_more_info_new: show_icon: false show_name: false show_label: false + template: + - "ulm_custom_actions" + - "ulm_actions_card" styles: grid: - grid-template-areas: "'item1'" @@ -37,6 +40,19 @@ icon_more_info_new: template: - "icon" - "ulm_actions_icon" + variables: + ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" + ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + ulm_icon_tap_action: "[[[ return variables.ulm_icon_tap_action; ]]]" + ulm_icon_tap_haptic: "[[[ return variables.ulm_icon_tap_haptic; ]]]" + ulm_icon_tap_navigate_path: "[[[ return variables.ulm_icon_tap_navigate_path; ]]]" + ulm_icon_hold_action: "[[[ return variables.ulm_icon_hold_action; ]]]" + ulm_icon_hold_haptic: "[[[ return variables.ulm_icon_hold_haptic; ]]]" + ulm_icon_hold_navigate_path: "[[[ return variables.ulm_icon_hold_navigate_path; ]]]" + ulm_icon_double_tap_action: "[[[ return variables.ulm_icon_double_tap_action; ]]]" + ulm_icon_double_tap_haptic: "[[[ return variables.ulm_icon_double_tap_haptic; ]]]" + ulm_icon_double_tap_navigate_path: "[[[ return variables.ulm_icon_double_tap_navigate_path; ]]]" + ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: - overflow: "visible" @@ -48,8 +64,24 @@ icon_more_info_new: template: - "icon_info" - "ulm_actions_name" + variables: + ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" + ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + ulm_name_tap_action: "[[[ return variables.ulm_name_tap_action; ]]]" + ulm_name_tap_haptic: "[[[ return variables.ulm_name_tap_haptic; ]]]" + ulm_name_tap_navigate_path: "[[[ return variables.ulm_name_tap_navigate_path; ]]]" + ulm_name_hold_action: "[[[ return variables.ulm_name_hold_action; ]]]" + ulm_name_hold_haptic: "[[[ return variables.ulm_name_hold_haptic; ]]]" + ulm_name_hold_navigate_path: "[[[ return variables.ulm_name_hold_navigate_path; ]]]" + ulm_name_double_tap_action: "[[[ return variables.ulm_name_double_tap_action; ]]]" + ulm_name_double_tap_haptic: "[[[ return variables.ulm_name_double_tap_haptic; ]]]" + ulm_name_double_tap_navigate_path: "[[[ return variables.ulm_name_double_tap_navigate_path; ]]]" + ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" styles: card: - padding: "6px" - margin-left: "-6px" - background-color: "rgba(0,0,0,0)" + custom_fields: + notification: + - display: "none" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_forecast.yaml new file mode 100644 index 000000000..043f4ba85 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_forecast.yaml @@ -0,0 +1,4 @@ +--- +popup_button_forecast: + template: "ulm_translation_engine" + name: "[[[ return hass.resources[hass['language']]['ui.card.weather.forecast']; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_radar.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_radar.yaml new file mode 100644 index 000000000..64c12067b --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_radar.yaml @@ -0,0 +1,4 @@ +--- +popup_button_radar: + template: "ulm_language_variables" + name: "[[[ return variables.ulm_radar ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_chip_controls.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_chip_controls.yaml index a0a33b42d..ca2e111e6 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_chip_controls.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_chip_controls.yaml @@ -1,8 +1,6 @@ --- popup_chip_controls: template: "chips" - variables: - ulm_popup_media_player_entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" styles: card: - background: "none" @@ -20,13 +18,13 @@ popup_chip_controls: card: type: "custom:button-card" template: "icon_controls" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" icon: "mdi:skip-previous" tap_action: action: "call-service" service: "media_player.media_previous_track" service_data: - entity_id: "[[[ return variables.ulm_popup_media_player_entity]]]" + entity_id: "[[[ return entity.entity_id; ]]]" styles: icon: - color: "rgba(var(--color-theme),0.5)" @@ -34,7 +32,7 @@ popup_chip_controls: card: type: "custom:button-card" template: "icon_controls" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" icon: "mdi:play" state: - value: "playing" @@ -43,18 +41,18 @@ popup_chip_controls: action: "call-service" service: "media_player.media_play_pause" service_data: - entity_id: "[[[ return variables.ulm_popup_media_player_entity]]]" + entity_id: "[[[ return entity.entity_id; ]]]" item3: card: type: "custom:button-card" template: "icon_controls" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" icon: "mdi:skip-next" tap_action: action: "call-service" service: "media_player.media_next_track" service_data: - entity_id: "[[[ return variables.ulm_popup_media_player_entity]]]" + entity_id: "[[[ return entity.entity_id; ]]]" styles: icon: - color: "rgba(var(--color-theme),0.5)" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_layouts/popup_weather_row.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_layouts/popup_weather_row.yaml new file mode 100644 index 000000000..9aee9ae62 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_layouts/popup_weather_row.yaml @@ -0,0 +1,111 @@ +--- +popup_weather_row: + template: + - "icon" + show_name: false + styles: + grid: + - grid-template-areas: "'i date templow tempmax'" + - grid-template-columns: "1fr 2fr 1fr 1fr" + - grid-template-rows: "min-content min-content min-content min-content" + card: + - padding: "2px 0px" + icon: + - color: > + [[[ + var state = entity.attributes.forecast[variables.ulm_popup_weather_entity_idx].condition; + var icon = { + "clear-night": "rgba(var(--color-yellow),1)", + "cloudy": "rgba(var(--color-blue),1)", + "exceptional": "rgba(var(--color-red),1)", + "fog": "rgba(var(--color-grey),1)", + "hail": "rgba(var(--color-blue),1)", + "lightning": "rgba(var(--color-blue),1)", + "lightning-rainy": "rgba(var(--color-blue),1)", + "partlycloudy": "rgba(var(--color-yellow),1)", + "pouring": "rgba(var(--color-grey),1)", + "rainy": "rgba(var(--color-blue),1)", + "snowy": "rgba(var(--color-blue),1)", + "snowy-rainy": "rgba(var(--color-blue),1)", + "sunny": "rgba(var(--color-yellow),1)", + "windy": "rgba(var(--color-grey),1)", + "default": "rgba(var(--color-grey),1)", + } + return (icon[state] || icon["default"]); + ]]] + img_cell: + - background-color: > + [[[ + var state = entity.attributes.forecast[variables.ulm_popup_weather_entity_idx].condition; + var icon = { + "clear-night": "rgba(var(--color-yellow),0.2)", + "cloudy": "rgba(var(--color-blue),0.2)", + "exceptional": "rgba(var(--color-red),0.2)", + "fog": "rgba(var(--color-grey),0.2)", + "hail": "rgba(var(--color-blue),0.2)", + "lightning": "rgba(var(--color-blue),0.2)", + "lightning-rainy": "rgba(var(--color-blue),0.2)", + "partlycloudy": "rgba(var(--color-yellow),0.2)", + "pouring": "rgba(var(--color-grey),0.2)", + "rainy": "rgba(var(--color-blue),0.2)", + "snowy": "rgba(var(--color-blue),0.2)", + "snowy-rainy": "rgba(var(--color-blue),0.2)", + "sunny": "rgba(var(--color-yellow),0.2)", + "windy": "rgba(var(--color-grey),0.2)", + "default": "rgba(var(--color-grey),0.2)", + } + return (icon[state] || icon["default"]); + ]]] + - height: "36px" + - width: "36px" + custom_fields: + date: + - text-align: "left" + - text-transform: "capitalize" + templow: + - background-color: "rgba(var(--color-blue), 1)" + - color: "white" + - border-radius: "15px" + - height: "30px" + - vertical-align: "middle" + - line-height: "30px" + - width: "90%" + tempmax: + - background-color: "rgba(var(--color-red), 1)" + - color: "white" + - border-radius: "15px" + - height: "30px" + - vertical-align: "middle" + - line-height: "30px" + - width: "90%" + custom_fields: + date: | + [[[ + const userLocale = navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language; + const date = new Date(entity.attributes.forecast[variables.ulm_popup_weather_entity_idx].datetime); + return date.toLocaleDateString(userLocale, {weekday: 'long',}); + ]]] + templow: "[[[ return entity.attributes.forecast[variables.ulm_popup_weather_entity_idx].templow + '°' ]]]" + tempmax: "[[[ return entity.attributes.forecast[variables.ulm_popup_weather_entity_idx].temperature + '°' ]]]" + icon: | + [[[ + var state = entity.attributes.forecast[variables.ulm_popup_weather_entity_idx].condition; + var icon = { + "clear-night": "mdi:weather-night", + "cloudy": "mdi:weather-cloudy", + "exceptional": "mdi:weather-sunny-alert", + "fog": "mdi:weather-fog", + "hail": "mdi:weather-hail", + "lightning": "mdi:weather-lightning", + "lightning-rainy": "mdi:weather-lightning-rainy", + "partlycloudy": "mdi:weather-partly-cloudy", + "pouring": "mdi:weather-pouring", + "rainy": "mdi:weather-rainy", + "snowy": "mdi:weather-snowy", + "snowy-rainy": "mdi:weather-snowy-rainy", + "sunny": "mdi:weather-sunny", + "windy": "mdi:weather-windy", + "default": "mdi:crosshairs-question" + } + return (icon[state] || icon["default"]); + ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml index 4fd039869..2b70809ac 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml @@ -9,5 +9,4 @@ popup_light: card: type: "custom:button-card" template: "popup_light_brightness" - variables: - ulm_popup_light_entity: "[[[ return entity.entity_id ]]]" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml index ea82d6739..4ca68e991 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml @@ -1,5 +1,9 @@ --- popup_light_brightness: + show_icon: false + show_name: false + show_label: false + show_units: false styles: grid: - grid-template-areas: > @@ -8,13 +12,13 @@ popup_light_brightness: var brightness_modes = ["brightness", "hs", "color_temp", "rgb", "rgbw", "xy"]; var color_temp_modes = ["color_temp"]; var color_modes = ["hs", "rgb", "rgbw", "xy"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { contents.push("content1"); } - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { contents.push("content2"); } - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_modes.includes(r))) { contents.push("content3"); } return "\"" + "header ".repeat(contents.length) + "\" " + "\"" + contents.join(" ") + "\" " + "\"" + "footer ".repeat(contents.length) + "\""; @@ -26,13 +30,13 @@ popup_light_brightness: var brightness_modes = ["brightness", "hs", "color_temp", "rgb", "rgbw", "xy"]; var color_temp_modes = ["color_temp"]; var color_modes = ["hs", "rgb", "rgbw", "xy"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { columns.push("1fr"); } - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { columns.push("1fr"); } - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_modes.includes(r))) { columns.push("2fr"); } return columns.join(" "); @@ -49,7 +53,7 @@ popup_light_brightness: - display: > [[[ var brightness_modes = ["brightness", "hs", "color_temp", "rgb", "rgbw", "xy"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { return "block"; } return "none"; @@ -59,7 +63,7 @@ popup_light_brightness: - display: > [[[ var color_temp_modes = ["color_temp"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { return "block"; } return "none"; @@ -69,7 +73,7 @@ popup_light_brightness: - display: > [[[ var color_modes = ["hs", "rgb", "rgbw", "xy"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_modes.includes(r))) { return "block"; } return "none"; @@ -107,11 +111,11 @@ popup_light_brightness: card: type: "custom:button-card" template: "popup_header" - entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" content1: card: type: "custom:my-slider" - entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" radius: "20px" rotate: 270 containerHeight: "320px" @@ -123,12 +127,12 @@ popup_light_brightness: thumbWidth: "0px" mainSliderColor: > [[[ - var color = states[variables.ulm_popup_light_entity].attributes.rgb_color; - if (states[variables.ulm_popup_light_entity].state == "unavailable"){ - return "rgba(var(--color-grey),1)"; + var color = entity.attributes.rgb_color; + if (entity.state == "unavailable"){ + return "rgba(var(--color-grey),1)"; } else if (color){ - return "rgba(" + color + ",1)"; + return "rgba(" + color + ",1)"; } else{ return "rgba(var(--color-yellow),1)"; @@ -137,12 +141,12 @@ popup_light_brightness: mainSliderColorOff: "rgba(var(--color-theme),0.1)" secondarySliderColor: > [[[ - var color = states[variables.ulm_popup_light_entity].attributes.rgb_color; - if (states[variables.ulm_popup_light_entity].state == "unavailable"){ - return "rgba(var(--color-grey),0.2)"; + var color = entity.attributes.rgb_color; + if (entity.state == "unavailable"){ + return "rgba(var(--color-grey),0.2)"; } else if (color){ - return "rgba(" + color + ",0.2)"; + return "rgba(" + color + ",0.2)"; } else{ return "rgba(var(--color-yellow),0.2)"; @@ -167,11 +171,11 @@ popup_light_brightness: content2: card: type: "custom:my-slider" - entity: "[[[ return variables.ulm_popup_light_entity ]]]" - minBar: "[[[ return states[variables.ulm_popup_light_entity].attributes.min_mireds ]]]" - minSet: "[[[ return states[variables.ulm_popup_light_entity].attributes.min_mireds ]]]" - maxBar: "[[[ return states[variables.ulm_popup_light_entity].attributes.max_mireds ]]]" - maxSet: "[[[ return states[variables.ulm_popup_light_entity].attributes.max_mireds ]]]" + entity: "[[[ return entity.entity_id ]]]" + minBar: "[[[ return entity.attributes.min_mireds ]]]" + minSet: "[[[ return entity.attributes.min_mireds ]]]" + maxBar: "[[[ return entity.attributes.max_mireds ]]]" + maxSet: "[[[ return entity.attributes.max_mireds ]]]" function: "Warmth" radius: "20px" rotate: 270 @@ -222,13 +226,13 @@ popup_light_brightness: var brightness_modes = ["brightness", "hs", "color_temp", "rgb", "rgbw", "xy"]; var color_temp_modes = ["color_temp"]; var color_modes = ["hs", "rgb", "rgbw", "xy"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { areas.push("item1"); } - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { areas.push("item2"); } - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_modes.includes(r))) { areas.push("item3"); } return "\"" + areas.join(" ") + "\""; @@ -239,13 +243,13 @@ popup_light_brightness: var brightness_modes = ["brightness", "hs", "color_temp", "rgb", "rgbw", "xy"]; var color_temp_modes = ["color_temp"]; var color_modes = ["hs", "rgb", "rgbw", "xy"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => brightness_modes.includes(r))) { columns.push("1fr"); } - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { columns.push("1fr"); } - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_modes.includes(r))) { columns.push("1fr"); } return columns.join(" "); @@ -271,7 +275,7 @@ popup_light_brightness: - display: > [[[ var color_temp_modes = ["color_temp"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_temp_modes.includes(r))) { return "block"; } return "none"; @@ -284,8 +288,7 @@ popup_light_brightness: card: type: "custom:button-card" template: "popup_light_color_temp" - variables: - ulm_popup_light_entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" item3: card: icon: "mdi:palette" @@ -298,7 +301,7 @@ popup_light_brightness: - display: > [[[ var color_modes = ["hs", "rgb", "rgbw", "xy"]; - if (states[variables.ulm_popup_light_entity].attributes.supported_color_modes.some(r => color_modes.includes(r))) { + if (entity.attributes.supported_color_modes.some(r => color_modes.includes(r))) { return "block"; } return "none"; @@ -311,8 +314,7 @@ popup_light_brightness: card: type: "custom:button-card" template: "popup_light_color" - variables: - ulm_popup_light_entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" footer: card: type: "custom:button-card" @@ -326,11 +328,11 @@ popup_light_brightness: card: type: "custom:button-card" template: "popup_button_power" - entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" content3: card: type: "custom:light-entity-card" - entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" persist_features: true brightness: false color_temp: false diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml index df584c719..951e1fe2f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml @@ -55,8 +55,7 @@ popup_light_color: card: type: "custom:button-card" template: "popup_light_brightness" - variables: - ulm_popup_light_entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" item2: card: icon: "mdi:sun-thermometer-outline" @@ -72,8 +71,7 @@ popup_light_color: card: type: "custom:button-card" template: "popup_light_color_temp" - variables: - ulm_popup_light_entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" item3: card: icon: "mdi:palette" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml index df06dbb8d..6c19a7cb9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml @@ -55,8 +55,7 @@ popup_light_color_temp: card: type: "custom:button-card" template: "popup_light_brightness" - variables: - ulm_popup_light_entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" item2: card: icon: "mdi:sun-thermometer-outline" @@ -80,5 +79,4 @@ popup_light_color_temp: card: type: "custom:button-card" template: "popup_light_color" - variables: - ulm_popup_light_entity: "[[[ return variables.ulm_popup_light_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml index 3c8b551b3..fa6fd06ee 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml @@ -9,5 +9,4 @@ popup_media_player: card: type: "custom:button-card" template: "popup_media_player_infos" - variables: - ulm_popup_media_player_entity: "[[[ return entity.entity_id ]]]" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml index 76b3e4e1a..fe6ae9620 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml @@ -1,5 +1,9 @@ --- popup_media_player_infos: + show_icon: false + show_name: false + show_label: false + show_units: false triggers_update: "all" styles: grid: @@ -51,7 +55,7 @@ popup_media_player_infos: card: type: "custom:button-card" template: "popup_header" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" content1: card: type: "custom:button-card" @@ -66,12 +70,12 @@ popup_media_player_infos: - background: | [[[ if(hass.themes.darkMode){ - return states[variables.ulm_popup_media_player_entity].state == 'playing' && states[variables.ulm_popup_media_player_entity].attributes.entity_picture != null - ? ' center / cover url(' + states[variables.ulm_popup_media_player_entity].attributes.entity_picture + '), radial-gradient(circle, #333333 90%, grey 105% ,#333333 110%)' + return entity.state == 'playing' && entity.attributes.entity_picture != null + ? ' center / cover url(' + entity.attributes.entity_picture + '), radial-gradient(circle, #333333 90%, grey 105% ,#333333 110%)' : '' }else{ - return states[variables.ulm_popup_media_player_entity].state == 'playing' && states[variables.ulm_popup_media_player_entity].attributes.entity_picture != null - ? ' center / cover url(' + states[variables.ulm_popup_media_player_entity].attributes.entity_picture + '), radial-gradient(circle, white 5%, grey 100% ,white 110%)' + return entity.state == 'playing' && entity.attributes.entity_picture != null + ? ' center / cover url(' + entity.attributes.entity_picture + '), radial-gradient(circle, white 5%, grey 100% ,white 110%)' : '' } ]]] @@ -104,11 +108,11 @@ popup_media_player_infos: card: type: "custom:button-card" template: "popup_button_app" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" picture: card: type: "custom:mini-media-player" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" artwork: "full-cover" hide: name: true @@ -128,7 +132,7 @@ popup_media_player_infos: media: card: type: "custom:mini-media-player" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" hide: runtime: false icon: true @@ -161,7 +165,7 @@ popup_media_player_infos: control: card: type: "custom:mini-media-player" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" hide: controls: true icon: true @@ -187,8 +191,6 @@ popup_media_player_infos: card: type: "custom:button-card" template: "list_2_items" - variables: - ulm_popup_media_player_entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" styles: card: - background: "none" @@ -202,8 +204,7 @@ popup_media_player_infos: card: type: "custom:button-card" template: "popup_chip_controls" - variables: - ulm_popup_media_player_entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" styles: card: - background: "none" @@ -213,7 +214,7 @@ popup_media_player_infos: card: type: "custom:button-card" template: "popup_chip_volume" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" styles: card: - background: "none" @@ -227,8 +228,7 @@ popup_media_player_infos: card: type: "custom:button-card" template: "popup_media_player_volume" - variables: - ulm_popup_media_player_entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" footer: card: type: "custom:button-card" @@ -242,16 +242,16 @@ popup_media_player_infos: card: type: "custom:button-card" template: "popup_button_power" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" item3: card: type: "custom:button-card" template: "popup_button_source" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" content2: card: type: "custom:my-slider" - entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" radius: "20px" rotate: 270 containerHeight: "320px" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml index 4b1f99ceb..ba20b2a04 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml @@ -49,8 +49,7 @@ popup_media_player_volume: card: type: "custom:button-card" template: "popup_media_player_infos" - variables: - ulm_popup_media_player_entity: "[[[ return variables.ulm_popup_media_player_entity ]]]" + entity: "[[[ return entity.entity_id; ]]]" item2: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml index b499cb565..095514343 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml @@ -9,8 +9,8 @@ popup_power_outlet: card: type: "custom:button-card" template: "popup_power_outlet_stats" + entity: "[[[ return entity.entity_id ]]]" variables: - ulm_popup_power_outlet_entity: "[[[ return entity.entity_id ]]]" ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml index c7e3d1ed5..822a79eab 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml @@ -50,8 +50,8 @@ popup_power_outlet_history: card: type: "custom:button-card" template: "popup_power_outlet_stats" + entity: "[[[ return entity.entity_id ]]]" variables: - ulm_popup_power_outlet_entity: "[[[ return variables.ulm_popup_power_outlet_entity ]]]" ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml index 2d7971f76..89ea130ef 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml @@ -1,5 +1,9 @@ --- popup_power_outlet_stats: + show_icon: false + show_name: false + show_label: false + show_units: false styles: grid: - grid-template-areas: "'header header' 'content1 content1' 'content2 content3' 'footer footer'" @@ -44,7 +48,7 @@ popup_power_outlet_stats: card: type: "custom:button-card" template: "popup_header" - entity: "[[[ return variables.ulm_popup_power_outlet_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" content1: card: type: "grid" @@ -132,8 +136,8 @@ popup_power_outlet_stats: card: type: "custom:button-card" template: "popup_power_outlet_history" + entity: "[[[ return entity.entity_id ]]]" variables: - ulm_popup_power_outlet_entity: "[[[ return variables.ulm_popup_power_outlet_entity ]]]" ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" @@ -150,12 +154,12 @@ popup_power_outlet_stats: card: type: "custom:button-card" template: "popup_button_power" - entity: "[[[ return variables.ulm_popup_power_outlet_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" content3: card: type: "logbook" entities: - - "[[[ return variables.ulm_popup_power_outlet_entity ]]]" + - "[[[ return entity.entity_id ]]]" card_mod: style: | ha-card { diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml index edf003919..9735668a2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml @@ -9,5 +9,4 @@ popup_thermostat: card: type: "custom:button-card" template: "popup_thermostat_temperature" - variables: - ulm_popup_thermostat_entity: "[[[ return entity.entity_id ]]]" + entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml index 5e09ab6d9..ca5d7bbb4 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml @@ -1,5 +1,9 @@ --- popup_thermostat_temperature: + show_icon: false + show_name: false + show_label: false + show_units: false styles: grid: - grid-template-areas: "'header' 'content1' 'buttons' 'footer'" @@ -35,11 +39,11 @@ popup_thermostat_temperature: card: type: "custom:button-card" template: "popup_header" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" content1: card: type: "thermostat" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" card_mod: style: | ha-card { @@ -64,22 +68,22 @@ popup_thermostat_temperature: - grid-template-areas: > [[[ var areas = []; - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("auto")) { + if (entity.attributes.hvac_modes.includes("auto")) { areas.push("auto"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("heat")) { + if (entity.attributes.hvac_modes.includes("heat")) { areas.push("heat"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("cool")) { + if (entity.attributes.hvac_modes.includes("cool")) { areas.push("cool"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("dry")) { + if (entity.attributes.hvac_modes.includes("dry")) { areas.push("dry"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("fan_only")) { + if (entity.attributes.hvac_modes.includes("fan_only")) { areas.push("fan_only"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("heat_cool")) { + if (entity.attributes.hvac_modes.includes("heat_cool")) { areas.push("heat_cool"); } return "\"" + areas.join(" ") + "\""; @@ -87,22 +91,22 @@ popup_thermostat_temperature: - grid-template-columns: > [[[ var columns = []; - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("auto")) { + if (entity.attributes.hvac_modes.includes("auto")) { columns.push("1fr"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("heat")) { + if (entity.attributes.hvac_modes.includes("heat")) { columns.push("1fr"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("cool")) { + if (entity.attributes.hvac_modes.includes("cool")) { columns.push("1fr"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("dry")) { + if (entity.attributes.hvac_modes.includes("dry")) { columns.push("1fr"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("fan_only")) { + if (entity.attributes.hvac_modes.includes("fan_only")) { columns.push("1fr"); } - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("heat_cool")) { + if (entity.attributes.hvac_modes.includes("heat_cool")) { columns.push("1fr"); } return columns.join(" "); @@ -118,7 +122,7 @@ popup_thermostat_temperature: auto: - display: > [[[ - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("auto")) { + if (entity.attributes.hvac_modes.includes("auto")) { return "block"; } else { return "none"; @@ -127,7 +131,7 @@ popup_thermostat_temperature: heat: - display: > [[[ - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("heat")) { + if (entity.attributes.hvac_modes.includes("heat")) { return "block"; } else { return "none"; @@ -136,7 +140,7 @@ popup_thermostat_temperature: cool: - display: > [[[ - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("cool")) { + if (entity.attributes.hvac_modes.includes("cool")) { return "block"; } else { return "none"; @@ -145,7 +149,7 @@ popup_thermostat_temperature: dry: - display: > [[[ - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("dry")) { + if (entity.attributes.hvac_modes.includes("dry")) { return "block"; } else { return "none"; @@ -154,7 +158,7 @@ popup_thermostat_temperature: fan_only: - display: > [[[ - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("fan_only")) { + if (entity.attributes.hvac_modes.includes("fan_only")) { return "block"; } else { return "none"; @@ -163,7 +167,7 @@ popup_thermostat_temperature: heat_cool: - display: > [[[ - if (states[variables.ulm_popup_thermostat_entity].attributes.hvac_modes.includes("heat_cool")) { + if (entity.attributes.hvac_modes.includes("heat_cool")) { return "block"; } else { return "none"; @@ -173,14 +177,14 @@ popup_thermostat_temperature: auto: card: type: "custom:button-card" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" icon: "mdi:autorenew" tap_action: action: "call-service" service: "climate.set_hvac_mode" service_data: - entity_id: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity_id: "[[[ return entity.entity_id ]]]" hvac_mode: "auto" styles: card: @@ -199,14 +203,14 @@ popup_thermostat_temperature: heat: card: type: "custom:button-card" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" icon: "mdi:fire" tap_action: action: "call-service" service: "climate.set_hvac_mode" service_data: - entity_id: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity_id: "[[[ return entity.entity_id ]]]" hvac_mode: "heat" styles: card: @@ -225,14 +229,14 @@ popup_thermostat_temperature: cool: card: type: "custom:button-card" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" icon: "mdi:snowflake" tap_action: action: "call-service" service: "climate.set_hvac_mode" service_data: - entity_id: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity_id: "[[[ return entity.entity_id ]]]" hvac_mode: "cool" styles: card: @@ -251,14 +255,14 @@ popup_thermostat_temperature: dry: card: type: "custom:button-card" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" icon: "mdi:water" tap_action: action: "call-service" service: "climate.set_hvac_mode" service_data: - entity_id: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity_id: "[[[ return entity.entity_id ]]]" hvac_mode: "dry" styles: card: @@ -277,14 +281,14 @@ popup_thermostat_temperature: fan_only: card: type: "custom:button-card" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" icon: "mdi:fan" tap_action: action: "call-service" service: "climate.set_hvac_mode" service_data: - entity_id: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity_id: "[[[ return entity.entity_id ]]]" hvac_mode: "fan_only" styles: card: @@ -303,14 +307,14 @@ popup_thermostat_temperature: heat_cool: card: type: "custom:button-card" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" icon: "mdi:sun-snowflake" tap_action: action: "call-service" service: "climate.set_hvac_mode" service_data: - entity_id: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity_id: "[[[ return entity.entity_id ]]]" hvac_mode: "heat_cool" styles: card: @@ -339,4 +343,4 @@ popup_thermostat_temperature: card: type: "custom:button-card" template: "popup_button_power" - entity: "[[[ return variables.ulm_popup_thermostat_entity ]]]" + entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml new file mode 100644 index 000000000..c225df1ba --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml @@ -0,0 +1,12 @@ +--- +popup_weather: + hold_action: + action: "fire-dom-event" + browser_mod: + command: "popup" + large: true + hide_header: true + card: + type: "custom:button-card" + template: "popup_weather_forecast" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml new file mode 100644 index 000000000..58c6f2c5f --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -0,0 +1,170 @@ +--- +popup_weather_forecast: + show_icon: false + show_name: false + show_label: false + show_units: false + styles: + grid: + - grid-template-areas: "'header header' 'content1 content2' 'footer footer'" + - grid-template-rows: "14vh 56vh 16vh" + - grid-template-columns: "1fr 1fr" + - column-gap: "30px" + card: + - background: "var(--primary-background-color)" + - box-shadow: "none" + - padding: "4%" + custom_fields: + header: + - align-self: "start" + content1: + - align-self: "center" + content2: + - align-self: "center" + buttons: + - display: "none" + footer: + - align-self: "end" + - margin-top: "25px" + extra_styles: | + @media (max-width: 800px) { + #container { + grid-template-areas: "header" "content1" "buttons" "footer" !important; + grid-template-rows: 14vh 56vh 13vh 13vh !important; + grid-template-columns: 1fr !important; + } + #buttons { + display: block !important; + align-self: start !important; + } + #content2 { + display: none; + } + } + custom_fields: + header: + card: + type: "custom:button-card" + template: "popup_header" + entity: "[[[ return entity.entity_id ]]]" + icon: | + [[[ + var state = entity.state; + var icon = { + "clear-night": "mdi:weather-night", + "cloudy": "mdi:weather-cloudy", + "exceptional": "mdi:weather-sunny-alert", + "fog": "mdi:weather-fog", + "hail": "mdi:weather-hail", + "lightning": "mdi:weather-lightning", + "lightning-rainy": "mdi:weather-lightning-rainy", + "partlycloudy": "mdi:weather-partly-cloudy", + "pouring": "mdi:weather-pouring", + "rainy": "mdi:weather-rainy", + "snowy": "mdi:weather-snowy", + "snowy-rainy": "mdi:weather-snowy-rainy", + "sunny": "mdi:weather-sunny", + "windy": "mdi:weather-windy", + "default": "mdi:crosshairs-question" + } + return (icon[state] || icon["default"]); + ]]] + content1: + card: + type: "vertical-stack" + cards: + - type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + show_name: false + show_icon: false + styles: + grid: + - grid-template-areas: "'temp' 'tempminmax'" + - grid-template-columns: "1fr" + - grid-template-rows: "min-content min-content" + card: + - background: "none" + - box-shadow: "none" + custom_fields: + temp: + - font-size: "60px" + custom_fields: + temp: "[[[ return entity.attributes.temperature + '°' ]]]" + tempminmax: "[[[ return 'Max. ' + entity.attributes.forecast[0].temperature + '° Min. ' + entity.attributes.forecast[0].templow + '°' ]]]" + - type: "vertical-stack" + cards: + - type: "custom:button-card" + template: "popup_weather_row" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_weather_entity_idx: 0 + - type: "custom:button-card" + template: "popup_weather_row" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_weather_entity_idx: 1 + - type: "custom:button-card" + template: "popup_weather_row" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_weather_entity_idx: 2 + - type: "custom:button-card" + template: "popup_weather_row" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_weather_entity_idx: 3 + - type: "custom:button-card" + template: "popup_weather_row" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_weather_entity_idx: 4 + - type: "custom:button-card" + template: "popup_weather_row" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_weather_entity_idx: 5 + buttons: + card: + type: "custom:button-card" + template: "list_2_items" + styles: + card: + - background: "none" + custom_fields: + item1: + card: + icon: "mdi:calendar-month" + type: "custom:button-card" + template: + - "popup_button" + - "popup_button_selected" + - "popup_button_forecast" + item2: + card: + icon: "mdi:radar" + type: "custom:button-card" + template: + - "popup_button" + - "popup_button_radar" + tap_action: + action: "fire-dom-event" + browser_mod: + command: "popup" + hide_header: true + card: + type: "custom:button-card" + template: "popup_weather_radar" + entity: "[[[ return entity.entity_id ]]]" + footer: + card: + type: "custom:button-card" + template: "popup_list_items" + custom_fields: + item1: + card: + type: "custom:button-card" + template: "popup_button_back" + content2: + card: + type: "custom:weather-radar-card" + square_map: true diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml new file mode 100644 index 000000000..701379617 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml @@ -0,0 +1,58 @@ +--- +popup_weather_radar: + template: "popup_weather_forecast" + styles: + grid: + - grid-template-areas: "'header' 'content2' 'buttons' 'footer'" + - grid-template-rows: "14vh 56vh 13vh 13vh" + - grid-template-columns: "1fr" + custom_fields: + content1: + - display: "none" + extra_styles: | + @media (max-width: 800px) { + #container { + grid-template-areas: "header" "content2" "buttons" "footer" !important; + grid-template-rows: 14vh 56vh 13vh 13vh !important; + grid-template-columns: 1fr !important; + } + #buttons { + display: block !important; + align-self: start !important; + } + #content1 { + display: none; + } + custom_fields: + buttons: + card: + type: "custom:button-card" + template: "list_2_items" + styles: + card: + - background: "none" + custom_fields: + item1: + card: + icon: "mdi:calendar-month" + type: "custom:button-card" + template: + - "popup_button" + - "popup_button_forecast" + tap_action: + action: "fire-dom-event" + browser_mod: + command: "popup" + hide_header: true + card: + type: "custom:button-card" + template: "popup_weather_forecast" + entity: "[[[ return entity.entity_id; ]]]" + item2: + card: + icon: "mdi:radar" + type: "custom:button-card" + template: + - "popup_button" + - "popup_button_selected" + - "popup_button_radar" diff --git a/custom_components/ui_lovelace_minimalist/translations/en.json b/custom_components/ui_lovelace_minimalist/translations/en.json index 4203cca40..c0ce54f02 100644 --- a/custom_components/ui_lovelace_minimalist/translations/en.json +++ b/custom_components/ui_lovelace_minimalist/translations/en.json @@ -6,7 +6,7 @@ "title": "UI Lovelace Minimalist Settings", "description": "", "data": { - "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require github authentication!" + "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require GitHub authentication!" } }, "device": { @@ -42,7 +42,7 @@ "adaptive_ui_icon": "adaptive panel icon", "theme": "Theme", "include_other_cards": "Include custom card resources it's depending on.", - "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require github authentication!", + "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require GitHub authentication!", "community_cards": "Select Community Cards you want to enable." } } @@ -52,7 +52,7 @@ "not_setup": "UI Lovelace Minimalist is not setup." }, "error": { - "github_cards": "Something went wrong when fetching cards from Github.", + "github_cards": "Something went wrong when fetching cards from GitHub.", "ack": "You need to acknowledge all statements.", "gh_token": "Github Token not set. Please re-install this integration to go through the setup procedure. (No custom configuration will be lost)" } diff --git a/custom_components/ui_lovelace_minimalist/translations/pl.json b/custom_components/ui_lovelace_minimalist/translations/pl.json index 713aad674..fd6883ca6 100644 --- a/custom_components/ui_lovelace_minimalist/translations/pl.json +++ b/custom_components/ui_lovelace_minimalist/translations/pl.json @@ -6,25 +6,25 @@ "title": "Ustawienia UI Lovelace Minimalist", "description": "", "data": { - "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require github authentication!" + "community_cards_enabled": "Włącz możliwość dodawania kart tworzonych przez społeczność. Wymaga uwierzytelnienia w serwisie GitHub!" } }, "device": { - "title": "Waiting for device activation" + "title": "Oczekiwanie na aktywację urządzenia" }, "reauth_confirm": { - "title": "Reauthentication needed", - "description": "You need to reauthenticate with GitHub." + "title": "Wymagane jest ponowne uwierzytelnienie", + "description": "Musisz ponownie uwierzytelnić się w serwisie GitHub." } }, "abort": { "single_instance_allowed": "Tylko jedna konfiguracja UI Lovelace Minimalist jest dozwolona.", "not_setup": "UI Lovelace Minimalist nie jest skonfigurowany.", - "github": "Could not authenticate with GitHub, try again later.", - "reauth_successful": "Reauthentication was successful." + "github": "Nie udało się uwierzytelnić w serwisie GitHub, spróbuj ponownie później.", + "reauth_successful": "Ponowne uwierzytelnienie zakończyło się sukcesem" }, "progress": { - "wait_for_device": "1. Open {url} \n2.Paste the following key to authorize ULM: \n```\n{code}\n```\n" + "wait_for_device": "1. Otwórz {url} \n2.Wklej poniższy klucz, aby autoryzować ULM: \n```\n{code}\n```\n" } }, "options": { @@ -37,13 +37,13 @@ "sidepanel_enabled": "Utwórz nowy Dashboard w panelu bocznym.", "sidepanel_icon": "Ikona w panelu bocznym", "sidepanel_title": "Tytuł w panelu bocznym", - "adaptive_ui_enabled": "Enable adaptive Dashboard with popup splitview", - "adaptive_ui_title": "adaptive panel title", - "adaptive_ui_icon": "adaptive panel icon", + "adaptive_ui_enabled": "Włącz wyświetlanie Dashboardu w trybie adaptatywnym", + "adaptive_ui_title": "tytuł panelu adaptatywnego", + "adaptive_ui_icon": "ikona panelu adaptatywnego", "theme": "Motyw", "include_other_cards": "Dołącz zasoby wymagane przez niestandardowe karty.", - "community_cards_enabled": "Enable the ability to configure community cards with this integrations, Does require github authentication!", - "community_cards": "Select Community Cards you want to enable." + "community_cards_enabled": "Włącz możliwość dodawania kart stworzonych przez społeczność. Wymaga uwierzytelnienia w serwisie GitHub!", + "community_cards": "Wybierz karty społeczności, które chcesz włączyć." } } }, @@ -52,9 +52,9 @@ "not_setup": "UI Lovelace Minimalist nie jest skonfigurowany." }, "error": { - "github_cards": "Something went wrong when fetching cards from Github.", - "ack": "You need to acknowledge all statements.", - "gh_token": "Github Token not set. Please re-install this integration to go throught the setup procedure. (No custom configuration will be lost)" + "github_cards": "Wystąpił błąd podczas pobierania kart z serwisu GitHub", + "ack": "Należy zaznaczyć wszystkie oświadczenia.", + "gh_token": "Token GitHub nie został ustawiony. Zainstaluj ponownie integrację, aby przejść przez proces konfiguracji. Żadna niestandardowa konfiguracja nie zostanie utracona." } } } diff --git a/docs/assets/img/popup_weather_phone.png b/docs/assets/img/popup_weather_phone.png new file mode 100644 index 000000000..1e5ee1728 Binary files /dev/null and b/docs/assets/img/popup_weather_phone.png differ diff --git a/docs/assets/img/popup_weather_tablet.png b/docs/assets/img/popup_weather_tablet.png new file mode 100644 index 000000000..869fb1c56 Binary files /dev/null and b/docs/assets/img/popup_weather_tablet.png differ diff --git a/docs/setup/custom_actions.md b/docs/setup/custom_actions.md index a85c725f5..be80fc9c0 100644 --- a/docs/setup/custom_actions.md +++ b/docs/setup/custom_actions.md @@ -39,6 +39,39 @@ Possible values for each variables are : | adaptive | Switch UI LOVELACE MINIMALIST popup on adaptive dashboard
if current dashboard is adaptive (if not `popup` action is used) | | navigate | Navigate to an other UI LOVELACE MINIMALIST view. Need additional variable (see below) | +## Haptic feedback + +Next to the action also the haptic feedback of the actions can be configured in the `custom_actions.yaml` file: + +For each action a haptic feedback could be configured: + +```yaml +--- +ulm_custom_actions: + variables: + ulm_card_tap_haptic: "medium" + ulm_card_tap_haptic: "none" + ulm_card_double_tap_haptic: "none" + ulm_icon_tap_haptic: "none" + ulm_icon_hold_haptic: "none" + ulm_icon_double_tap_haptic: "none" + ulm_name_tap_haptic: "medium" + ulm_name_hold_haptic: "none" + ulm_name_double_tap_haptic: "none" +``` + +Possible values for each variables (according to the underlying [button card]( +https://github.com/custom-cards/button-card)) are : + +- `none` +- `success` +- `warning` +- `failure` +- `light` +- `medium` +- `heavy` +- `selection` + !!! tip "Reloading" Once you have edited `custom_actions.yaml` file, you must reload `"UI LOVELACE MINIMALIST"` configuration. @@ -70,7 +103,7 @@ To define the path of `navigate` action, add one of the following depending on y ## Overwrite custom actions -When creating a dashboard, custom actions can be overwritten on your card definition. +When creating a dashboard, custom actions and the haptic feedback can be overwritten on your card definition. For example, this code will overwrite the tap action on card with `more-info` action : ```yaml @@ -79,9 +112,181 @@ For example, this code will overwrite the tap action on card with `more-info` ac entity: "cover.somfy_portail" variables: ulm_card_tap_action: "more-info" + ulm_card_tap_haptic: "success" ``` +## Custom Popups + +The implementation of the custom action now supports the configuration of individual popups. The custom popup +can be easily configured for each card. + +To enable a custom popup the variable `ulm_custom_popup` must be set within the card. +This variable have three subvariables `template`, `entity` and `popup_variables`. The template must be the name of the +template that should be loaded. The necessary configuration variables for the popup can be configured in +the variable `popup_variables`. + +Usually the popup uses the same entity as the card that calls the popup. It is also possible to overwrite the entity +for the popup. Therefore the entity can be set using the `entity` variable +within the `ulm_custom_popup`. This `entity` variable is optional. It is also possible to disable the entity of the +custom popup it the `entity` variable within the `ulm_custom_popup is set to`none`. + +```yaml +- type: 'custom:button-card' + template: card_power_outlet + entity: switch.power_outlet_livingroom + variables: + ulm_card_power_outlet_consumption_sensor: sensor.power_outlet_livingroom_consumption + ulm_card_power_outlet_name: Power Outlet Livingroom + ulm_custom_popup: + template: "popup_power_outlet_stats" + entity: switch.power_outlet_livingroom + popup_variables: + ulm_popup_power_outlet_sensor1: sensor.power_outlet_livingroom + ulm_popup_power_outlet_sensor2: sensor.power_outlet_livingroom_consumption + ulm_popup_power_outlet_graph_sensor: sensor.power_outlet_livingroom + ulm_popup_power_outlet_entity: switch.power_outlet_livingroom + +``` + +The available popup templates `popup_media_player_infos`, `popup_light_brightness`, `popup_thermostat_temperature` +or `popup_power_outlet_stats` can already be used with the custom popups. + +This implementation allows the easy creation of custom popups that can be loaded by other cards. + +!!! note "Light, Media Player, Thermostat" + + The `card_light`, `card_media_player` and `card_thermostat` uses a different approach. Therefore the popup can + be simply enabled by setting one of the variables `ulm_card_light_enable_popup`, `ulm_card_thermostat_enable_popup` + or `ulm_card_media_player_enable_popup` to true. + ## For developers -To enable action customization on your custom cards, use the following templates `icon_more_info_new` and `ulm_actions_card` +To enable action customization on your custom cards, use either the `icon_more_info_new`, `icon_more_info_alert` or +the `extended_card` template. There is no need to implement the `ulm_card_actions` template anymore. + +There are three possibilities to include the custom actions into your custom cards: + +### Use template `extend_card` as combination of two cards + +The simplest way to create a custom card that uses these custom actions is the combination of two cards. + +For enabling the feature the custom card must implement the template `extended_card`. +Then two custom fields must be used: + +- `item1` must be a card that already implements the template `icon_more_info_new`. + Most of the core cards already implements this template. +- `item2` can be any Lovelace card that should extend the card. + +If you add custom styles to `item2` then following code should be added into the `style` field + +```javascript +ha-card { + box-shadow: none; + border-radius: var(--border-radius); +} +``` + +The already available **Graph card** (`card_graph`) is an example for this implementation. As +`item1` a `generic_card` is used. The `item2` provides a mini-graph-card. + +??? note "Graph card as example" + + ```yaml title="card_binary_sensor_alert.yaml" + --8<-- "custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/2-line_cards/card_graph.yaml" + ``` + +### Use template `icon_more_info_new` or `icon_more_info_alert` + +The card must implement the template `icon_more_info_new`or `icon_more_info_alert`. Then it must implement a custom field +`item1` which is also a `custom:button-card`. This card must have the custom fields `item1`which represents the icon and +`item2`which represents the name. + +Most of the internal card templates uses this option. Take a look into the code. + +??? note "Generic card as example" + + ```yaml title="card_binary_sensor_alert.yaml" + --8<-- "custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml" + ``` + +### Individual implementation + +The following script shows the usage off all necessary variables and template that will be used by the custom actions. + +The card must implement the templates `ulm_custom_actions` and `ulm_action_card` in the correct order. +The example shows the custom fields `item1` that implements the redirection of an icon field and `item2` that implements the +redirecton of a name field. + +```yaml +--- +custom_card: + template: + - "ulm_custom_actions" + - "ulm_actions_card" + custom_fields: + item1: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: + - "ulm_actions_icon" + variables: + ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" + ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + ulm_icon_tap_action: "[[[ return variables.ulm_icon_tap_action; ]]]" + ulm_icon_tap_haptic: "[[[ return variables.ulm_icon_tap_haptic; ]]]" + ulm_icon_tap_navigate_path: "[[[ return variables.ulm_icon_tap_navigate_path; ]]]" + ulm_icon_hold_action: "[[[ return variables.ulm_icon_hold_action; ]]]" + ulm_icon_hold_haptic: "[[[ return variables.ulm_icon_hold_haptic; ]]]" + ulm_icon_hold_navigate_path: "[[[ return variables.ulm_icon_hold_navigate_path; ]]]" + ulm_icon_double_tap_action: "[[[ return variables.ulm_icon_double_tap_action; ]]]" + ulm_icon_double_tap_haptic: "[[[ return variables.ulm_icon_double_tap_haptic; ]]]" + ulm_icon_double_tap_navigate_path: "[[[ return variables.ulm_icon_double_tap_navigate_path; ]]]" + ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" + item2: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: + - "ulm_actions_name" + variables: + ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]" + ulm_input_select: "[[[ return variables.ulm_input_select; ]]]" + ulm_name_tap_action: "[[[ return variables.ulm_name_tap_action; ]]]" + ulm_name_tap_haptic: "[[[ return variables.ulm_name_tap_haptic; ]]]" + ulm_name_tap_navigate_path: "[[[ return variables.ulm_name_tap_navigate_path; ]]]" + ulm_name_hold_action: "[[[ return variables.ulm_name_hold_action; ]]]" + ulm_name_hold_haptic: "[[[ return variables.ulm_name_hold_haptic; ]]]" + ulm_name_hold_navigate_path: "[[[ return variables.ulm_name_hold_navigate_path; ]]]" + ulm_name_double_tap_action: "[[[ return variables.ulm_name_double_tap_action; ]]]" + ulm_name_double_tap_haptic: "[[[ return variables.ulm_name_double_tap_haptic; ]]]" + ulm_name_double_tap_navigate_path: "[[[ return variables.ulm_name_double_tap_navigate_path; ]]]" + ulm_custom_popup: "[[[ return variables.ulm_custom_popup; ]]]" + +``` + +!!! tip "For developes who have already implemented the custom actions on their card" + + There could be some breaking changes: + + - The custom card should either implement the `icon_more_info_new` or the `extended_card` + - The template ulm_actions_card can be removed + - The variable redirections for the ulm_*_action can be removed + + Also the custom popup feature has some breaking changes: + The variables `ulm_card_light_enable_popup`, `ulm_card_thermostat_enable_popup` and `ulm_card_media_player_enable_popup` + aren't used internally anymore. The are only working on their appropriate cards as configuration option for the end user + of the card. So the custom_popup variable should be used instead. + +## For developers of custom popups + +Custom popups must be a `custom:button-card`. It is also recommended to disable the icon, name and label within the +card configuration using + +```yaml +show_icon: false +show_name: false +show_label: false +show_units: false +``` diff --git a/docs/setup/custom_cards.md b/docs/setup/custom_cards.md index aee49da71..ce397607d 100644 --- a/docs/setup/custom_cards.md +++ b/docs/setup/custom_cards.md @@ -10,7 +10,7 @@ This 'theme' and his community do offer support for multiple great Custom-cards. !!! tip " 🚀 New Custom Card Selection Feature! 🚀" - Since the release of `v1.0.4` support has been build in to select custom/community cards that are available in the `main` branch on our Github Repository in the `custom_cards` folder. This Removes the need for copying over files from the Github Repo and put them in the `/config/ui_lovelace_minimlist/custom_cards` folder. + Since the release of `v1.1.0` support has been build in to select custom/community cards that are available in the `main` branch on our Github Repository in the `custom_cards` folder. This Removes the need for copying over files from the Github Repo and put them in the `/config/ui_lovelace_minimlist/custom_cards` folder. ### Custom Cards diff --git a/docs/usage/cards/card_person.md b/docs/usage/cards/card_person.md index 5b02b99ee..f70726ad1 100644 --- a/docs/usage/cards/card_person.md +++ b/docs/usage/cards/card_person.md @@ -18,6 +18,7 @@ The `card_person` shows if a person is `home` or `not_home`. If you have setup o | entity | | :material-check: | The person entity | | ulm_card_person_entity | | :material-check: | The person entity | | ulm_card_person_use_entity_picture | | :material-close: | If you set this to true, the card shows the entity picture from your user, otherwise (set to false) shows the icon. Default is false. | +| ulm_card_person_icon | mdi:face-man | :material-close: | Sets the icon to display if entity picture not shown. | | ulm_card_person_zone1 | | :material-close: | Set another zone (beside "home") to use for the card. You can set up two zones besides "home". | | ulm_card_person_zone2 | | :material-close: | Set another zone (beside "home") to use for the card. You can set up two zones besides "home". | | ulm_address | | :material-close: | Show an address as label, add an entity with a geo location | @@ -31,6 +32,7 @@ The `card_person` shows if a person is `home` or `not_home`. If you have setup o variables: ulm_card_person_entity: person.username ulm_card_person_use_entity_picture: true + ulm_card_person_icon: mdi:face-woman ulm_card_person_zone1: zone.work ulm_card_person_zone2: zone.school ulm_address: sensor.s10_mike_gegeocodeerde_locatie diff --git a/docs/usage/popups/popup_weather.md b/docs/usage/popups/popup_weather.md new file mode 100644 index 000000000..3538ab27d --- /dev/null +++ b/docs/usage/popups/popup_weather.md @@ -0,0 +1,30 @@ +--- +title: Weather Popup +hide: + - toc +--- + + +### Weather popup + +![Phone](../../assets/img/popup_weather_phone.png){ width="500" } +![Tablet](../../assets/img/popup_weather_tablet.png){ width="500" } + +#### Requirements + +- weather-radar-card (download for HACS) + +##### How to use + +To enable this popup, add the following code to your card: + +```yaml + ulm_custom_popup: + template: "popup_weather_forecast" + popup_variables: + ulm_popup_weather_entity: weather.xxx +``` + +## Credits + +- Designed by schumijo diff --git a/scripts/update-cards.py b/scripts/update-cards.py index 554b6fbee..68152e7d7 100755 --- a/scripts/update-cards.py +++ b/scripts/update-cards.py @@ -12,9 +12,10 @@ ('mini-media-player', 'https://github.com/kalkih/mini-media-player/releases/download/v1.16.4/mini-media-player-bundle.js'), ('my-cards', 'https://github.com/AnthonMS/my-cards/releases/download/v1.0.0/my-cards.js'), ('simple-weather-card', 'https://github.com/kalkih/simple-weather-card/releases/download/v0.8.3/simple-weather-card-bundle.js'), + ('weather-radar-card', 'https://github.com/Makin-Things/weather-radar-card/releases/download/v2.0.6/weather-radar-card.js'), # for adaptive dashboard ('lovelace-layout-card', 'https://raw.githubusercontent.com/thomasloven/lovelace-layout-card/2.4.2/layout-card.js'), - ('lovelace-state-switch', 'https://raw.githubusercontent.com/thomasloven/lovelace-state-switch/1.9.5/state-switch.js'), + ('lovelace-state-switch', 'https://raw.githubusercontent.com/thomasloven/lovelace-state-switch/1.9.3/state-switch.js'), ) for card, src in cards: