Skip to content

Feature/icloud media browser#162001

Open
timlaing wants to merge 23 commits into
home-assistant:devfrom
timlaing:feature/icloud-media-browser
Open

Feature/icloud media browser#162001
timlaing wants to merge 23 commits into
home-assistant:devfrom
timlaing:feature/icloud-media-browser

Conversation

@timlaing

@timlaing timlaing commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

Proposed change

Added support for a media source based on iCloud albums.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant

Copy link
Copy Markdown
Contributor

Hey there @Quentame, @nzapponi, mind taking a look at this pull request as it has been labeled with an integration (icloud) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of icloud can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign icloud Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

@timlaing timlaing marked this pull request as ready for review February 1, 2026 09:45
Copilot AI review requested due to automatic review settings February 1, 2026 09:45
@timlaing timlaing requested a review from Quentame as a code owner February 1, 2026 09:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new media source for the iCloud integration that exposes iCloud photo albums (including shared streams) as browsable and playable media, along with the necessary HTTP endpoint and tests.

Changes:

  • Introduces IcloudMediaSource and related helpers to browse iCloud accounts, album types (albums vs shared streams), individual albums, and their photos/videos.
  • Adds IcloudMediaSourceView HTTP view to stream original and thumbnail media from iCloud with a simple in-memory PhotoCache to avoid repeated asset lookups.
  • Wires the media source into the iCloud integration setup and declares the http dependency, plus a comprehensive new test suite for the media source functionality.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
homeassistant/components/icloud/media_source.py Implements the iCloud media source, identifier parsing, photo caching, album/photo browsing helpers, and the HTTP view that proxies media from iCloud.
homeassistant/components/icloud/__init__.py Hooks media source setup into the integration’s top-level async_setup so the HTTP view and media source are registered when the integration is set up.
homeassistant/components/icloud/manifest.json Adds the http dependency to ensure the HTTP component is available before registering the media source view.
tests/components/icloud/test_media_source.py Adds extensive tests covering identifier parsing, cache behavior, album/photo browsing, media resolution, and HTTP view behavior (including response headers and timeout handling).

Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
@joostlek joostlek marked this pull request as draft February 6, 2026 21:28
@timlaing timlaing marked this pull request as ready for review February 22, 2026 20:30
Copilot AI review requested due to automatic review settings February 22, 2026 20:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Comment thread homeassistant/components/icloud/media_source.py
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread tests/components/icloud/test_media_source.py Outdated
@timlaing timlaing marked this pull request as draft February 22, 2026 20:44
Copilot AI review requested due to automatic review settings June 7, 2026 20:36
@home-assistant home-assistant Bot requested review from joostlek and tr4nt0r June 7, 2026 20:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread tests/components/icloud/test_media_source.py
Comment thread tests/components/icloud/test_media_source.py Outdated
Comment thread tests/components/icloud/test_media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
@timlaing timlaing marked this pull request as draft June 7, 2026 21:11
Copilot AI review requested due to automatic review settings June 8, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread homeassistant/components/icloud/media_source.py
Comment thread homeassistant/components/icloud/media_source.py
@timlaing timlaing marked this pull request as ready for review June 8, 2026 21:15
Copilot AI review requested due to automatic review settings June 8, 2026 21:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/icloud/media_source.py Outdated
Copilot AI review requested due to automatic review settings June 9, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread tests/components/icloud/test_media_source.py
@timlaing timlaing marked this pull request as draft June 9, 2026 15:27
Copilot AI review requested due to automatic review settings June 9, 2026 18:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread tests/components/icloud/test_media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py
Comment thread tests/components/icloud/test_media_source.py
@timlaing timlaing marked this pull request as ready for review June 9, 2026 18:38
Copilot AI review requested due to automatic review settings June 9, 2026 18:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py Outdated
Comment thread homeassistant/components/icloud/media_source.py

@joostlek joostlek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than this I think this looks good

Comment thread tests/components/icloud/test_media_source.py
Copilot AI review requested due to automatic review settings June 9, 2026 22:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Comment thread tests/components/icloud/test_media_source.py
Comment thread homeassistant/components/icloud/media_source.py
Comment thread homeassistant/components/icloud/media_source.py
Comment thread homeassistant/components/icloud/media_source.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants