diff --git a/src/panels/lovelace/cards/hui-light-card.ts b/src/panels/lovelace/cards/hui-light-card.ts index 9720f7ecd4..b161d8bb59 100644 --- a/src/panels/lovelace/cards/hui-light-card.ts +++ b/src/panels/lovelace/cards/hui-light-card.ts @@ -13,15 +13,16 @@ import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin"; import { LovelaceCard } from "../types"; import { LovelaceCardConfig } from "../../../data/lovelace"; import { longPress } from "../common/directives/long-press-directive"; +import { hasConfigOrEntityChanged } from "../common/has-changed"; +import { loadRoundslider } from "../../../resources/jquery.roundslider.ondemand"; +import { toggleEntity } from "../common/entity/toggle-entity"; import stateIcon from "../../../common/entity/state_icon"; import computeStateName from "../../../common/entity/compute_state_name"; import applyThemesOnElement from "../../../common/dom/apply_themes_on_element"; -import { hasConfigOrEntityChanged } from "../common/has-changed"; import "../../../components/ha-card"; import "../../../components/ha-icon"; -import { loadRoundslider } from "../../../resources/jquery.roundslider.ondemand"; const lightConfig = { radius: 80, @@ -102,14 +103,14 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement) color: this._computeColor(stateObj), }) }" - @ha-click="${() => this._handleClick(false)}" - @ha-hold="${() => this._handleClick(true)}" + @ha-click="${this._handleTap}" + @ha-hold="${this._handleHold}" .longPress="${longPress()}" >