Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.google_photos.media_source Namespace Reference

Classes

class  GooglePhotosMediaSource
 
class  PhotosIdentifier
 
class  PhotosIdentifierType
 

Functions

BrowseMediaSource _build_account (GooglePhotosConfigEntry config_entry, PhotosIdentifier identifier)
 
BrowseMediaSource _build_album (str title, PhotosIdentifier identifier, str|None thumbnail_url=None)
 
BrowseMediaSource _build_media_item (PhotosIdentifier identifier, MediaItem media_item)
 
str _cover_photo_url (Album album, int max_size)
 
str _media_url (MediaItem media_item, int max_size)
 
str _video_url (MediaItem media_item)
 
MediaSource async_get_media_source (HomeAssistant hass)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
int ALBUM_PAGE_SIZE = 50
 
int LARGE_IMAGE_SIZE = 2160
 
int MEDIA_ITEMS_PAGE_SIZE = 100
 
int THUMBNAIL_SIZE = 256
 

Detailed Description

Media source for Google Photos.

Function Documentation

◆ _build_account()

BrowseMediaSource homeassistant.components.google_photos.media_source._build_account ( GooglePhotosConfigEntry  config_entry,
PhotosIdentifier  identifier 
)
private
Build the root node for a Google Photos account for a config entry.

Definition at line 235 of file media_source.py.

◆ _build_album()

BrowseMediaSource homeassistant.components.google_photos.media_source._build_album ( str  title,
PhotosIdentifier  identifier,
str | None   thumbnail_url = None 
)
private
Build an album node.

Definition at line 251 of file media_source.py.

◆ _build_media_item()

BrowseMediaSource homeassistant.components.google_photos.media_source._build_media_item ( PhotosIdentifier  identifier,
MediaItem  media_item 
)
private
Build the node for an individual photo or video.

Definition at line 267 of file media_source.py.

◆ _cover_photo_url()

str homeassistant.components.google_photos.media_source._cover_photo_url ( Album  album,
int  max_size 
)
private
Return a media item url for the cover photo of the album.

Definition at line 303 of file media_source.py.

◆ _media_url()

str homeassistant.components.google_photos.media_source._media_url ( MediaItem  media_item,
int  max_size 
)
private
Return a media item url with the specified max thumbnail size on the longest edge.

See https://developers.google.com/photos/library/guides/access-media-items#base-urls

Definition at line 287 of file media_source.py.

◆ _video_url()

str homeassistant.components.google_photos.media_source._video_url ( MediaItem  media_item)
private
Return a video url for the item.

See https://developers.google.com/photos/library/guides/access-media-items#base-urls

Definition at line 295 of file media_source.py.

◆ async_get_media_source()

MediaSource homeassistant.components.google_photos.media_source.async_get_media_source ( HomeAssistant  hass)
Set up Google Photos media source.

Definition at line 99 of file media_source.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.google_photos.media_source._LOGGER = logging.getLogger(__name__)
private

Definition at line 26 of file media_source.py.

◆ ALBUM_PAGE_SIZE

int homeassistant.components.google_photos.media_source.ALBUM_PAGE_SIZE = 50

Definition at line 29 of file media_source.py.

◆ LARGE_IMAGE_SIZE

int homeassistant.components.google_photos.media_source.LARGE_IMAGE_SIZE = 2160

Definition at line 32 of file media_source.py.

◆ MEDIA_ITEMS_PAGE_SIZE

int homeassistant.components.google_photos.media_source.MEDIA_ITEMS_PAGE_SIZE = 100

Definition at line 28 of file media_source.py.

◆ THUMBNAIL_SIZE

int homeassistant.components.google_photos.media_source.THUMBNAIL_SIZE = 256

Definition at line 31 of file media_source.py.