Move SUPPORT_BROWSE_MEDIA to const.ts

This commit is contained in:
Felipe Santos
2022-05-09 20:52:48 -03:00
parent 11d6b7bf87
commit b66f02551e
2 changed files with 5 additions and 5 deletions
+2 -5
View File
@@ -36,7 +36,7 @@ import type {
Message,
} from './types.js';
import { CAMERA_BIRDSEYE, CARD_VERSION, REPO_URL } from './const.js';
import { CAMERA_BIRDSEYE, CARD_VERSION, MEDIA_PLAYER_SUPPORT_BROWSE_MEDIA, REPO_URL } from './const.js';
import { FrigateCardElements } from './components/elements.js';
import { FrigateCardImage } from './components/image.js';
import { FRIGATE_BUTTON_MENU_ICON, FrigateCardMenu } from './components/menu.js';
@@ -475,10 +475,7 @@ export class FrigateCard extends LitElement {
if (entity.startsWith('media_player.')) {
const stateObj = this._hass?.states[entity];
// Taken from https://github.dev/home-assistant/frontend/blob/b5861869e39290fd2e15737e89571dfc543b3ad3/src/data/media-player.ts#L93
const SUPPORT_BROWSE_MEDIA = 131072;
if (stateObj && supportsFeature(stateObj, SUPPORT_BROWSE_MEDIA)) {
if (stateObj && supportsFeature(stateObj, MEDIA_PLAYER_SUPPORT_BROWSE_MEDIA)) {
return true;
}
}
+3
View File
@@ -140,3 +140,6 @@ export const CONF_DIMENSIONS_ASPECT_RATIO_MODE =
`${CONF_DIMENSIONS}.aspect_ratio_mode` as const;
export const CONF_OVERRIDES = 'overrides' as const;
// Taken from https://github.dev/home-assistant/frontend/blob/b5861869e39290fd2e15737e89571dfc543b3ad3/src/data/media-player.ts#L93
export const MEDIA_PLAYER_SUPPORT_BROWSE_MEDIA = 131072;