From f5953d23e650b2411b09392bb682a68b931167a8 Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Sun, 13 Jul 2025 21:42:01 -0400 Subject: [PATCH] Remove Main Button State Red as no longer used --- bubble/Main Button State Red/code.js | 24 ----------------- bubble/Main Button State Red/import.yaml | 33 ------------------------ 2 files changed, 57 deletions(-) delete mode 100644 bubble/Main Button State Red/code.js delete mode 100644 bubble/Main Button State Red/import.yaml diff --git a/bubble/Main Button State Red/code.js b/bubble/Main Button State Red/code.js deleted file mode 100644 index fad42b5..0000000 --- a/bubble/Main Button State Red/code.js +++ /dev/null @@ -1,24 +0,0 @@ -`${(() => { - const state = hass?.states[this.config?.entity]?.state || ''; - - let bg_color = 'var(--bubble-main-background-color)'; - let red_color = 'var(--error-color)'; - - // Main button background - const mainButton = card?.querySelector('.bubble-button-background'); - if (mainButton) { - mainButton.style.opacity = '1'; - mainButton.style.backgroundColor = state === 'on' ? red_color : bg_color; - mainButton.style.transition = 'background-color 1s'; - } - - // Unavailable state - if (mainButton && state === 'unavailable') { - mainButton.classList.add('is-unavailable'); - } else if (mainButton) { - mainButton.classList.remove('is-unavailable'); - } - - // No CSS string needed - return ''; -})()}` diff --git a/bubble/Main Button State Red/import.yaml b/bubble/Main Button State Red/import.yaml deleted file mode 100644 index 573237c..0000000 --- a/bubble/Main Button State Red/import.yaml +++ /dev/null @@ -1,33 +0,0 @@ -main_button_state_red: - name: Main Button State Red - version: '1.1' - creator: Tony Stork - supported: - - button - description: Will turn the button red if the entity state is on, otherwise default style applies - code: |- - ${(() => { - const state = hass?.states[this.config?.entity]?.state || ''; - - let bg_color = 'var(--bubble-main-background-color)'; - let red_color = 'var(--error-color)'; - - // Main button background - const mainButton = card?.querySelector('.bubble-button-background'); - if (mainButton) { - mainButton.style.opacity = '1'; - mainButton.style.backgroundColor = state === 'on' ? red_color : bg_color; - mainButton.style.transition = 'background-color 1s'; - } - - // Unavailable state - if (mainButton && state === 'unavailable') { - mainButton.classList.add('is-unavailable'); - } else if (mainButton) { - mainButton.classList.remove('is-unavailable'); - } - - // No CSS string needed - return ''; - })()} - editor: ''