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

Bravia configurator fails #2744

Closed
audunmg opened this issue Aug 7, 2016 · 6 comments
Closed

Bravia configurator fails #2744

audunmg opened this issue Aug 7, 2016 · 6 comments

Comments

@audunmg
Copy link

audunmg commented Aug 7, 2016

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 (0.25.2):

Python release (3.5.2):

Component/platform:
bravia

Description of problem:
Multiple problems:

  • 'arp' command is installed in /usr/sbin/arp on latest debian, and is not in $PATH by default. There is no error checking to verify if the mac address is actually returned, and if it is not, the configurator succeeds anyways and leaves the system in a broken state.
  • There is no error checking on the bravia http interface, if the pin code is wrong, the bravia http interface returns with a '401 Unauthorized' and the configurator succeeds anyways and leaves the system in a broken state, and even saves the invalid pin.

Expected:
A basic level of error checking.

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

media_player:
  - platform: braviatv
    host: hostname.of.tv
    name: Livingroom TV
  1. Click configurator
  2. Enter 0000 to get PIN
  3. PIN 0000 is saved and the TV will not be configured

Traceback (if applicable):

INFO:homeassistant.core:Bus:Handling <Event call_service[L]: service=configure, domain=configurator, service_data=fields=pin=1, configure_id=139970502893752-1, service_call_id=1
39970800344256-1>
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): hostname.of.tv
INFO:braviarc.braviarc:{
    "id": 1,
    "error": [
        401,
        "Unauthorized"
    ]
}
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: old_state=<state configurator.livingroom_tv=configure; fields=[{'name': 'Enter the pin', 'id': 'pin', 'type': ''}], submit_caption=Confirm, configure_id=139970502893752-1, description=Enter the Pin shown on your Sony Bravia TV.If no Pin is shown, enter 0000 to let TV show you a Pin., friendly_name=Livingroom TV, description_image=/static/images/smart-tv.png @ 2016-08-08T01:00:32.393728+02:00>, new_state=<state configurator.livingroom_tv=configured @ 2016-08-08T01:00:58.010148+02:00>, entity_id=configurator.livingroom_tv>
INFO:homeassistant.components.media_player.braviatv:Discovery configuration done!
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): hostname.of.tv
INFO:braviarc.braviarc:{
    "id": 1,
    "error": [
        401,
        "Unauthorized"
    ]
}
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): hostname.of.tv
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): hostname.of.tv
ERROR:homeassistant.components.media_player.braviatv:'NoneType' object is not subscriptable

Additional info:

@jsg4
Copy link

jsg4 commented Aug 16, 2016

Noticed this also

@ttu
Copy link
Contributor

ttu commented Aug 19, 2016

I made a small fix to mac handler earlier that returns None correctly if regex fails (9c636ab fix is in version 0.26). This way configurator won't crash, but without correct mac wake-on-lan won't work.

Made a fix (antonioparraga/braviarc#4) to braviarc module, so it will raise HTTPErrors correctly. This will fix issue with a '401 Unauthorized'. Waiting for the new release of braviarc and will update braviatv's REQUIREMENTS.

Some issues I noticed and should create new issues from these after the braviarc module is updated:

  • When configuration file exists but home-assistant has been removed from tv's settings, component just tries to connect but will get unauthorized and will just show that tv is off. Should check braviarc's connect function's return value and do reconfiguring based on that.
  • Configuration logic would need a little fix as when wrong PIN is enterd, will get 'Request from remote device has been cancelled' from the tv and have to type 0000 again to get a new PIN. Also shows error message 'Failed to register, please try again.' after entering 0000 PIN.

@audunmg
Copy link
Author

audunmg commented Aug 19, 2016

Really nice, I'm looking forward to testing it!
Thank you for the quick response :)

@antonioparraga
Copy link
Contributor

Ok, I have merged the PR on the braviarc component and released it -> 0.3.4

@cgarwood
Copy link
Member

Did #2997 take care of this issue?

@emlove
Copy link
Contributor

emlove commented Mar 14, 2017

Assuming #2997 fixed unless otherwise noted.

@emlove emlove closed this as completed Mar 14, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants