Add picture elements support.
This commit is contained in:
@@ -7,6 +7,7 @@ import type {
|
||||
BrowseMediaSource,
|
||||
ExtendedHomeAssistant,
|
||||
MediaLoadInfo,
|
||||
Message,
|
||||
} from './types';
|
||||
import { browseMediaSourceSchema } from './types';
|
||||
|
||||
@@ -144,6 +145,28 @@ export function dispatchMediaLoadEvent(
|
||||
}
|
||||
}
|
||||
|
||||
export function dispatchMessageEvent(
|
||||
element: HTMLElement,
|
||||
message: string,
|
||||
icon?: string,
|
||||
): void {
|
||||
dispatchEvent<Message>(element, 'message', {
|
||||
message: message,
|
||||
type: 'info',
|
||||
icon: icon,
|
||||
});
|
||||
}
|
||||
|
||||
export function dispatchErrorMessageEvent(
|
||||
element: HTMLElement,
|
||||
message: string,
|
||||
): void {
|
||||
dispatchEvent<Message>(element, 'message', {
|
||||
message: message,
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
// Determine whether the card should be updated based on Home Assistant changes.
|
||||
export function shouldUpdateBasedOnHass(
|
||||
newHass: HomeAssistant | null,
|
||||
|
||||
Reference in New Issue
Block a user