wuub / rxv

Automation Library for Yamaha RX-V473, RX-V573, RX-V673, RX-V773 receivers
Other
111 stars 44 forks source link

Yamaha Blu-ray player detected with wrong control url #20

Open torem opened 8 years ago

torem commented 8 years ago

rxv detects my Yamaha Blu-ray player, but gets the control url wrong.

As long as Blu-ray players are not supported by the library, they should not be detected.

>>> import rxv
>>> import requests
>>> r = rxv.find()
>>> r
[<RXV model_name="BD-S473" ctrl_url="http://[redacted]:50100/YamahaRemoteControl/ctrl" at 0x7fb96dd9ecd0>, <RXV model_name="RX-S600D" ctrl_url="http://[redacted]:80/YamahaRemoteControl/ctrl" at 0x7fb96dd9ea90>]
>>> r[1].on
True
>>> r[0].on
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/rxv/rxv.py", line 105, in on
    assert power in ["On", "Standby"]
AssertionError
>>> requests.get(r[0].ctrl_url).status_code
404
wuub commented 7 years ago

This library unfortunetely does not plan to support Blue ray players, and because I don't have one this was difficult for me to replicate.

If someone is willing to help, preferably filtering thos BD players out, I will accept it.

torem commented 7 years ago

Perhaps not the most elegant solution, but you could simply filter supported devices by model_name.startswith("RX-")? And whatever prefix the Aventage models use, I suppose those work as well.