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

Support HEOS devices not logged in to HEOS account #22913

Merged
merged 1 commit into from
Apr 9, 2019

Conversation

andrewsayre
Copy link
Member

Description:

Adds support for connecting to HEOS devices that are not logged in to the user's HEOS account. All control features are still available, with the exception of loading favorites into source selection. A warning message is printed in the log upon startup when the device is not logged in. Prior to this change, the HEOS config entry would fail to load.

This PR also fixes a data-type issue in async_set_volume_level that resulted in a failure to set the volume level to 0.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@codecov
Copy link

codecov bot commented Apr 9, 2019

Codecov Report

Merging #22913 into dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev   #22913   +/-   ##
=======================================
  Coverage   93.83%   93.83%           
=======================================
  Files         448      448           
  Lines       36578    36578           
=======================================
  Hits        34324    34324           
  Misses       2254     2254
Impacted Files Coverage Δ
homeassistant/components/heos/media_player.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38f063a...a211ff0. Read the comment docs.

controller.get_favorites(),
controller.get_input_sources()
)
players = await controller.get_players()
Copy link
Member

Choose a reason for hiding this comment

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

We could still gather this and controller.get_input_sources, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, but it doesn't materially improve performance as there's still only 1 underlying telnet connection to the controller and these commands respond instantaneously. I kept it separate to increase readability of the flow, but can gather it back up if desired.

Copy link
Member

@MartinHjelmare MartinHjelmare Apr 9, 2019

Choose a reason for hiding this comment

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

Ok, it's fine. I'll always comment on awaiting in "loops", since sometimes it does make a difference.

@MartinHjelmare MartinHjelmare merged commit 4110bd0 into dev Apr 9, 2019
@delete-merged-branch delete-merged-branch bot deleted the heos_not_logged_in_support branch April 9, 2019 16:21
@ghost ghost removed the in progress label Apr 9, 2019
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.

3 participants