mirror of
https://github.com/home-assistant/frontend.git
synced 2026-10-01 17:29:02 +01:00
16 lines
453 B
TypeScript
16 lines
453 B
TypeScript
import type {
|
|
HassEntityAttributeBase,
|
|
HassEntityBase,
|
|
} from "home-assistant-js-websocket";
|
|
|
|
interface ImageEntityAttributes extends HassEntityAttributeBase {
|
|
access_token: string;
|
|
}
|
|
|
|
export interface ImageEntity extends HassEntityBase {
|
|
attributes: ImageEntityAttributes;
|
|
}
|
|
|
|
export const computeImageUrl = (entity: ImageEntity): string =>
|
|
`/api/image_proxy/${entity.entity_id}?token=${entity.attributes.access_token}&state=${entity.state}`;
|