Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type annotations to examples #823

Merged
merged 1 commit into from Feb 7, 2024
Merged

Conversation

emontnemery
Copy link
Collaborator

No description provided.

Comment on lines +23 to 25
^examples/plex_multi_example\.py$
| ^pychromecast/generated/ # The protobuf autogenerated files are not annotated
| ^pychromecast/controllers/plex\.py$
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In a separate PR, the plex controller and the example will be type annotated

print("[", time.ctime(), " - ", self.name, "] status media change:")
print(status)

def load_media_failed(self, item, error_code):
def load_media_failed(self, item: int, error_code: int) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the item represent?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's to identify which item of a queue failed to play, Google calls it itemId.

We should update the docstring for MediaStatusListener and maybe also rename the parameter to queue_item or queue_item_id to make it clearer what it is.

@emontnemery emontnemery merged commit 955b8da into master Feb 7, 2024
1 check passed
@emontnemery emontnemery deleted the type_annotate_examples branch February 7, 2024 12:48
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.

None yet

2 participants