Compare commits

..

1 Commits

Author SHA1 Message Date
9ba93ccfe1 Update .HA_VERSION 2026-04-14 19:17:10 -04:00
4 changed files with 16 additions and 30 deletions

View File

@@ -1 +1 @@
2026.4.1
2026.4.2

View File

@@ -6,20 +6,18 @@
state = hass?.states[this.config?.entity]?.state || '';
}
let off_color = this.config?.state_color_button?.off_color
? `var(--${this.config.state_color_button.off_color})`
: 'var(--bubble-main-background-color)';
let bg_color = 'var(--bubble-main-background-color)';
// Use the configured color or default to accent color
let on_color = this.config?.state_color_button?.on_color
? `var(--${this.config.state_color_button.on_color})`
let on_color = this.config?.state_color_button?.color
? `var(--${this.config.state_color_button.color})`
: 'var(--bubble-accent-color)';
// Main button background
const mainButton = card?.querySelector('.bubble-button-background');
if (mainButton) {
mainButton.style.opacity = '1';
mainButton.style.backgroundColor = state === 'on' ? on_color : off_color;
mainButton.style.backgroundColor = state === 'on' ? on_color : bg_color;
mainButton.style.transition = 'background-color 1s';
}

View File

@@ -1,10 +1,5 @@
- name: on_color
label: On Color (CSS Variable)
selector:
text: {}
required: false
- name: off_color
label: Off Color (CSS Variable)
- name: color
label: Color (CSS Variable)
selector:
text: {}
required: false

View File

@@ -1,6 +1,6 @@
state_color_button:
name: State Color Button
version: 2.0.0
version: 1.2.0
creator: Tony Stork
supported:
- button
@@ -14,7 +14,7 @@ state_color_button:
alt_entity: sensor.your_face
</pre></code-block>
code: |-
`${(() => {
${(() => {
let state;
if (this.config?.state_color_button?.alt_entity) {
state = hass?.states[this.config?.state_color_button?.alt_entity]?.state || '';
@@ -22,20 +22,18 @@ state_color_button:
state = hass?.states[this.config?.entity]?.state || '';
}
let off_color = this.config?.state_color_button?.off_color
? `var(--${this.config.state_color_button.off_color})`
: 'var(--bubble-main-background-color)';
let bg_color = 'var(--bubble-main-background-color)';
// Use the configured color or default to accent color
let on_color = this.config?.state_color_button?.on_color
? `var(--${this.config.state_color_button.on_color})`
let on_color = this.config?.state_color_button?.color
? `var(--${this.config.state_color_button.color})`
: 'var(--bubble-accent-color)';
// Main button background
const mainButton = card?.querySelector('.bubble-button-background');
if (mainButton) {
mainButton.style.opacity = '1';
mainButton.style.backgroundColor = state === 'on' ? on_color : off_color;
mainButton.style.backgroundColor = state === 'on' ? on_color : bg_color;
mainButton.style.transition = 'background-color 1s';
}
@@ -56,15 +54,10 @@ state_color_button:
// No CSS string needed
return '';
})()}`
})()}
editor:
- name: on_color
label: On Color (CSS Variable)
selector:
text: {}
required: false
- name: off_color
label: Off Color (CSS Variable)
- name: color
label: Color (CSS Variable)
selector:
text: {}
required: false