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
73.45k stars 30.69k forks source link

Panasonic Viera component fails to load if the TV is turned off when Home Assistant starts #5340

Closed Flavien closed 7 years ago

Flavien commented 7 years ago

Home Assistant release (hass --version): 0.32.2

Python release (python3 --version): 3.5

Component/platform: Panasonic Viera

Description of problem:

The Panasonic Viera component fails to load if the TV is turned off when Home Assistant starts.

An initial HTTP call is made to the TV, and if the TV is off (standby mode), it will respond with an HTTP error 400, causing Home Assistant to skip loading the component. The component is then completely unavailable until next restart.

TV Model: Panasonic Viera DX700 series.

Expected:

The component should still be loaded even in case of 400 response from the TV, as you might turn it on later, in which case it would respond to REST commands.

Problem-relevant configuration.yaml entries:

media_player tv:
  - platform: panasonic_viera
    host: 192.168.0.250
    mac: 28:XX:XX:XX:XX:1D
    name: "Panasonic TV"

(I X'ed out the mac address)

Steps to reproduce:

  1. Make sure the TV is turned off
  2. Restart home assistant
  3. The Panasonic Viera component will not be available in home assistant.

Logs:

This is logged when home assistant starts if the TV is off:

17-01-14 11:10:57 homeassistant.components.media_player.panasonic_viera: Panasonic Viera TV is not available at 192.168.0.250:55000: HTTP Error 400: Bad Request
arsaboo commented 7 years ago

You are several releases behind. This was fixed in #4888

Flavien commented 7 years ago

Yes, thanks it works.