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

Wait for cast device to boot before failing #366

Merged
merged 3 commits into from
Feb 3, 2023

Conversation

Ionshard
Copy link
Contributor

@Ionshard Ionshard commented Dec 8, 2022

I was running into the issues described in #334 and I saw the #339 PR which looked promising but has a bunch of syntax errors and appears to be abandoned.

This PR takes the implementation from that PR and brings it up to date with the latest commits and actually compiles.

@Johnito
Copy link

Johnito commented Dec 11, 2022

Just to add an input if needed ; i manually implemented the edits from this pull and it works just fine now. Whatever may be the state of my cast devices, they wake up just fine to play music.

@Ionshard thank you

@Mincka
Copy link

Mincka commented Jan 5, 2023

I can also confirm that this PR works great and completely fixes #334. Thank you.

@jaguge
Copy link

jaguge commented Jan 13, 2023

I have implemented the edits and the error is gone! Thank you!

@fcusson
Copy link
Collaborator

fcusson commented Jan 21, 2023

Hi @Ionshard, I finally have time to review PR. I'm taking care of your PR next. I made some changes to the code when implementing two (2) other PRs you currently have two (2) merge conflicts with the master branch. Can you resolve them? I will be reviewing the rest of the code while you do that.

Copy link
Collaborator

@fcusson fcusson left a comment

Choose a reason for hiding this comment

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

Small changes, purely for documentation. The code itself seems all good. When the merge conflicts are resolved, I'll merge the branch and make regression tests.

@@ -41,7 +41,7 @@
WS_TYPE_SPOTCAST_PLAYER,
WS_TYPE_SPOTCAST_PLAYLISTS,
)
from .helpers import async_wrap, get_cast_devices, get_spotify_devices
from .helpers import async_wrap, get_cast_devices, get_spotify_devices, get_spotify_media_player
Copy link
Collaborator

Choose a reason for hiding this comment

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

please see merge conflicts, due to the line getting long, I moved to a parentheses block import for the helper methods

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have fixed the merge conflict here.

def get_spotify_devices(hass, spotify_user_id):
def get_spotify_media_player(hass: ha_core.HomeAssistant, spotify_user_id: str) -> SpotifyMediaPlayer:
"""
Get the spotify media player entity from hass.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm trying to clean up code documentation and move it toward the PEP8 format. could you rewrite this comment section using that format?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not a Python developer so I am not 100% certain on the PEP8 format. I looked it up and I think all I really needed to do was ensure the docstring was all on one line for a single line doc string correct?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No problem, I actually just learned that I am not using the PEP8 version of docstring (because there are none... my bad) but the google convention. So basically, it's:

"""Returns the sum of two decimal numbers in binary digits.

Args:
    a (int): A decimal integer
    b (int): Another decimal integer

Returns:
    bool: Binary string of the sum of a and b
"""

Anyway, no need to rewrite, I'm going to review the code, mostly I needed the merge conflict to be resolved in order to integrate your change.

@Ionshard
Copy link
Contributor Author

Sorry for the delay, I am currently on vacation. It may take me a couple days to be able to make the requested changes. I will update the PR when I return.

@yjamal01
Copy link

I manually copied the code and seems to be working without errors. Thank you both for your time with this.

@Ionshard
Copy link
Contributor Author

Thank you for your patience. I have returned from vacation and have addressed the comments.

@Ionshard Ionshard requested a review from fcusson January 31, 2023 19:21
Copy link
Collaborator

@fcusson fcusson left a comment

Choose a reason for hiding this comment

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

Regression test completed and working

@fcusson fcusson merged commit 4c5811e into fondberg:master Feb 3, 2023
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

6 participants