8000 Fix "argument of type 'NoneType' is not iterable" during discovery by sdague · Pull Request #4279 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix "argument of type 'NoneType' is not iterable" during discovery #4279

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

Merged
merged 3 commits into from
Nov 11, 2016

Conversation

sdague
Copy link
Contributor
@sdague sdague commented Nov 7, 2016

Related issue (if applicable): fixes #4226

When yamaha receivers are dynamically discovered, there config is
empty, which means that we need to set zone_ignore to [] otherwise the
iteration over receivers fails.

@mention-bot
Copy link

@sdague, thanks for your PR! By analyzing the history of the files in this pull request, we identified @postlund, @aoakeson and @TheRealLink to be potential reviewers.

@sdague sdague force-pushed the zone_ignore_discover branch from 9b91c0f to ec52c9e Compare November 7, 2016 12:43
rxv version 0.3 will issue the play_status command even for sources
that don't support it, causing stack traces during updates when
receivers are on HDMI inputs.

This was fixed in rxv 0.3.1. Bump to fix bug home-assistant#4226.
When yamaha receivers are dynamically discovered, there config is
empty, which means that we need to set zone_ignore to [] otherwise the
iteration over receivers fails.
@sdague sdague force-pushed the zone_ignore_discover branch from ec52c9e to add693f Compare November 8, 2016 19:41
@sdague sdague added the bug label Nov 8, 2016
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the Yamaha platform."""
import rxv
global KNOWN_RECEIVERS
Copy link
Member

Choose a reason for hiding this comment

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

Instead of a global, please use hass.data which is a dict for all components/platforms to use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ACK, will respin with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in latest change set, let me know if there is a different way you want me to handle namespacing.

The discovery component doesn't know anything about already configured
receivers. This means that specifying a receiver manually will make it
show up twice if you have the discovery component enabled.

This puts a platform specific work around here that ensures that if
the media_player is found, we ignore the discovery system.
@sdague sdague force-pushed the zone_ignore_discover branch from add693f to 3a03b25 Compare November 9, 2016 14:10
@balloob balloob merged commit e9d19c1 into home-assistant:dev Nov 11, 2016
@balloob balloob added this to the 0.32.3 milestone Nov 11, 2016
balloob pushed a commit that referenced this pull request Nov 11, 2016
…4279)

* Fix "argument of type 'NoneType' is not iterable" during discovery

When yamaha receivers are dynamically discovered, there config is
empty, which means that we need to set zone_ignore to [] otherwise the
iteration over receivers fails.

* Bump rxv library version to fix play_status bug

rxv version 0.3 will issue the play_status command even for sources
that don't support it, causing stack traces during updates when
receivers are on HDMI inputs.

This was fixed in rxv 0.3.1. Bump to fix bug #4226.

* Don't discovery receivers that we've already configured

The discovery component doesn't know anything about already configured
receivers. This means that specifying a receiver manually will make it
show up twice if you have the discovery component enabled.

This puts a platform specific work around here that ensures that if
the media_player is found, we ignore the discovery system.
@sdague sdague deleted the zone_ignore_discover branch November 11, 2016 12:07
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0.32 broke media_player.yamaha
3 participants
0