@@ -45,7 +45,7 @@ import copy from 'fast-copy';
45
45
import * as pjson from '../package.json' ;
46
46
import { deepEqual } from './deep-equal' ;
47
47
import { stateColorCss } from './common/state_color' ;
48
- import { DOMAINS_TOGGLE } from './common/const' ;
48
+ import { AUTO_COLORS , DOMAINS_TOGGLE } from './common/const' ;
49
49
import { handleAction } from './handle-action' ;
50
50
import { fireEvent } from './common/fire-event' ;
51
51
import { HomeAssistant } from './types/homeassistant' ;
@@ -515,7 +515,7 @@ class ButtonCard extends LitElement {
515
515
} else if ( this . _config ! . color ) {
516
516
colorValue = this . _config ! . color ;
517
517
}
518
- if ( colorValue == 'auto' || colorValue == 'auto-no-temperature' ) {
518
+ if ( AUTO_COLORS . includes ( colorValue ) ) {
519
519
color = this . _getColorForLightEntity ( state , colorValue !== 'auto-no-temperature' ) ;
520
520
} else if ( colorValue ) {
521
521
color = colorValue ;
@@ -827,9 +827,9 @@ class ButtonCard extends LitElement {
827
827
private _cardHtml ( ) : TemplateResult {
828
828
const configState = this . _getMatchingConfigState ( this . _stateObj ) ;
829
829
let color : string = 'var(--state-inactive-color)' ;
830
- if ( ! ! configState ?. color ) {
830
+ if ( ! ! configState ?. color && ! AUTO_COLORS . includes ( configState . color ) ) {
831
831
color = configState . color ;
832
- } else if ( ! ! this . _config ?. color ) {
832
+ } else if ( ! ! this . _config ?. color && ! AUTO_COLORS . includes ( this . _config . color ) ) {
833
833
if ( this . _stateObj ) {
834
834
if ( stateActive ( this . _stateObj ) ) {
835
835
color = this . _config ?. color || color ;
0 commit comments