Skip to content

Refactored AppleTV integration with new structure#107

Open
albaintor wants to merge 9 commits intounfoldedcircle:mainfrom
albaintor:refactor
Open

Refactored AppleTV integration with new structure#107
albaintor wants to merge 9 commits intounfoldedcircle:mainfrom
albaintor:refactor

Conversation

@albaintor
Copy link
Copy Markdown
Contributor

@albaintor albaintor commented Apr 2, 2026

Hi,

I refactored the code of AppleTV integration like the others and to be able to handle additional entity types
It is tested locally and it works so far on my system
I also used the new Python integration API from repository which explains the build error

Copy link
Copy Markdown
Contributor

@zehnm zehnm left a comment

Choose a reason for hiding this comment

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

Please fix the linting error. PRs must pass the automated tests.

Smaller PRs with one change only are highly appreciated. It greatly simplifies reviewing them and getting changes merged more quickly.
E.g. there are too many changes in the driver.py file and it can't be easily diffed anymore, since it was moved and heavily changed with the extraction of the MediaPlayer functionality.
One PR with project structure refactoring and another one with extracting the MediaPlayer and eventually another one with further changes.

@albaintor
Copy link
Copy Markdown
Contributor Author

Hi, I have removed some changes, moving of files in particular.
I am not sure how I can split this more : the only big move is modifying the project structure which requested to split the logic between the device and the entity which was mixed up.
The other move is to import ucapi 0.6.0 but this implies minor changes for this one.
Please let me know how I could split this better

@albaintor albaintor requested a review from zehnm April 16, 2026 10:47
Copy link
Copy Markdown
Contributor

@zehnm zehnm left a comment

Choose a reason for hiding this comment

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

PRs must pass the automated checks.
Please fix the linting issues, then I'll check the PR.

<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="pyelectroluxocp.oneAppApi.OneAppApi.*" />
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.

This seems to be from another project

Comment thread intg-appletv/tv.py
FeatureName,
FeatureState,
InputAction,
MediaType,
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.

You have updated ucapi to 0.6.0 in requirements.txt that renamed MediaType to MediaContentType: https://github.com/unfoldedcircle/integration-python-library/releases/tag/v0.6.0
If you don't need new features from 0.6.0 or fixed all breaking changes, then the ucapi udpate should be in a separate PR. Otherwise, integrate all breaking changes in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not the MediaType from ucapi but from pyatv : I imported this pyatv.MediaType to define a mapping to ucapi.MediaContentType

If you want I can revert all changes from 0.6.0 to keep only this one

@albaintor albaintor requested a review from zehnm April 21, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants