home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.53k stars 29.91k forks source link

Yamaha AVR fails to load on 0.26 (both .0 and .1) #2819

Closed Kernald closed 7 years ago

Kernald commented 8 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version): 0.26, 0.26.1

Python release (python3 --version): 3.5.2

Component/platform: media_player.yamaha

Description of problem: While I can't see any relevant entries in the logs, the component doesn't show up (neither in the frontend, nor in the dev-state page).

Expected: The AVR should show up.

Problem-relevant configuration.yaml entries and steps to reproduce:

- platform: yamaha
  name: AVR
  source_ignore:
    - "JUKE"
    - "AUX"
    - "AV1"
    - "AV2"
    - "AirPlay"
    - "Bluetooth"
    - "HDMI3"
    - "HDMI4"
    - "HDMI5"
    - "HDMI6"
    - "MusicCast Link"
    - "NET RADIO"
    - "SERVER"
    - "Spotify"
    - "TUNER"
    - "USB"
    - "iPod (USB)"
  source_names:
    AV3: "CD"
    AV4: "TV"
    AV5: "Vinyl"
    AV6: "SNES"
    HDMI1: "Shield"
    HDMI2: "PC"

Traceback (if applicable):

Additional info: Just reverting to 0.25.2 works fine (I'm using the docker image).

jwl17330536 commented 8 years ago

I had never used the "source_ignore" or "source_names" until I saw this post. I tried it today on 0.27.2 and get mixed results.

With both "source_ignore" and "source_names" I get:

Sep 09 10:42:49 automation hass[22786]: ERROR:homeassistant.components.media_player:Error while setting up platform yamaha
Sep 09 10:42:49 automation hass[22786]: Traceback (most recent call last):
Sep 09 10:42:49 automation hass[22786]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 98, in _setup_platform
Sep 09 10:42:49 automation hass[22786]: discovery_info)
Sep 09 10:42:49 automation hass[22786]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/yamaha.py", line 34, in setup_platform
Sep 09 10:42:49 automation hass[22786]: for receiver in rxv.find())
Sep 09 10:42:49 automation hass[22786]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 154, in add_entities
Sep 09 10:42:49 automation hass[22786]: for entity in new_entities:
Sep 09 10:42:49 automation hass[22786]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/yamaha.py", line 34, in <genexpr>
Sep 09 10:42:49 automation hass[22786]: for receiver in rxv.find())
Sep 09 10:42:49 automation hass[22786]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/yamaha.py", line 53, in __init__
Sep 09 10:42:49 automation hass[22786]: self.update()
Sep 09 10:42:49 automation hass[22786]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/yamaha.py", line 66, in update
Sep 09 10:42:49 automation hass[22786]: self.build_source_list()
Sep 09 10:42:49 automation hass[22786]: File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/media_player/yamaha.py", line 75, in build_source_list
Sep 09 10:42:49 automation hass[22786]: self._source_names.items()}
Sep 09 10:42:49 automation hass[22786]: AttributeError: 'list' object has no attribute 'items'

Removing the "source_names" all works great!

Here is my configuration.yaml:

media_player:
  - platform: yamaha
    name: 'Family Room Receiver'
    source_ignore:
      - "AUDIO1"
      - "AUDIO2"
      - "AV1"
      - "AV2"
      - "AV3"
      - "AV5"
      - "AV6"
      - "HDMI1"
      - "HDMI2"
      - "HDMI3"
      - "HDMI4"
      - "HDMI5"
      - "Pandora"
      - "Rhapsody"
      - "SERVER"
      - "SiriusXM"
      - "Spotify"
      - "TUNER"
      - "USB"
      - "V-AUX"
      - "iPod (USB)"
      - "NET RADIO"
    source_names:
      - AV4: "TV"
Kernald commented 8 years ago

The source_names works great for me. Anyway, I can't reproduce the issue since the 0.27 release, maybe this should probably be closed?

poldim commented 7 years ago

Running 0.30.2, can replicate this problem if there is more than one source_ignore or source_names. I copied the example directly into the config directly from the components page. Commenting out the array and referencing just one input is successful and does not create the error.

@fabaff - Since you did the most recent update, any thoughts?

homeassistant.bootstrap: Invalid config for [media_player.yamaha]: expected a dictionary for dictionary value @ data['source_names']. Got [OrderedDict([('HDMI1', 'ChromeCast')]), OrderedDict([('AV4', 'Vinyl')])]. Please check the docs at https://home-assistant.io/components/media_player.yamaha/

Kernald commented 7 years ago

The weird part is that the sample configuration on the documentation is a copy/paste of mine… and works fine on 0.30.2 on my end. Maybe an indentation issue?

sdague commented 7 years ago

IIRC 0.26 was the first time this showed up, and there were issues with the ssdp discovery that was causing the issue. As this is working in 0.32, closing.