From 8e9ff46bab6e93da35be9137aa3ba5f7a3e18e5a Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Fri, 30 Nov 2018 07:17:52 -0600 Subject: [PATCH] Extract media-player constants to src/data (#2149) --- src/data/media-player.ts | 4 ++++ .../entity-rows/hui-media-player-entity-row.ts | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 src/data/media-player.ts diff --git a/src/data/media-player.ts b/src/data/media-player.ts new file mode 100644 index 0000000000..7d89d4d544 --- /dev/null +++ b/src/data/media-player.ts @@ -0,0 +1,4 @@ +export const SUPPORT_PAUSE = 1; +export const SUPPORT_NEXT_TRACK = 32; +export const SUPPORTS_PLAY = 16384; +export const OFF_STATES = ["off", "idle"]; diff --git a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts index 10c3860b67..907255ed3b 100644 --- a/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts +++ b/src/panels/lovelace/entity-rows/hui-media-player-entity-row.ts @@ -8,11 +8,12 @@ import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin"; import { EntityRow, EntityConfig } from "./types"; import { HomeAssistant } from "../../../types"; import { HassEntity } from "home-assistant-js-websocket"; - -const SUPPORT_PAUSE = 1; -const SUPPORT_NEXT_TRACK = 32; -const SUPPORTS_PLAY = 16384; -const OFF_STATES = ["off", "idle"]; +import { + SUPPORTS_PLAY, + SUPPORT_NEXT_TRACK, + OFF_STATES, + SUPPORT_PAUSE, +} from "../../../data/media-player"; class HuiMediaPlayerEntityRow extends hassLocalizeLitMixin(LitElement) implements EntityRow {