miracle2k / onkyo-eiscp

Control Onkyo A/V receivers over the network; usuable as a script, or as a Python library.
MIT License
470 stars 110 forks source link

Error setting volume on Pioneer Receivers #106

Closed prairiesnpr closed 4 years ago

prairiesnpr commented 5 years ago

Version: 1.2.5

Command: onkyo --verbose volume=160

Result:

sending to VSX-1131: volume=160                                                 
Traceback (most recent call last):                                              
  File "/srv/homeassistant/bin/onkyo", line 10, in <module>                     
    sys.exit(run())                                                             
  File "/srv/homeassistant/lib/python3.5/site-packages/eiscp/script.py", line 17
9, in run                                                                       
    sys.exit(main() or 0)                                                       
  File "/srv/homeassistant/lib/python3.5/site-packages/eiscp/script.py", line 13
2, in main                                                                      
    iscp_message = command_to_iscp(command)                                     
  File "/srv/homeassistant/lib/python3.5/site-packages/eiscp/core.py", line 228,
 in command_to_iscp                                                             
    return '{}{}'.format(prefix, value)                                         
UnboundLocalError: local variable 'value' referenced before assignment          

Re-sending the command immediately will often result in success. Initially thought this was related to volume levels > 80, but get the same error on lower levels as well.

Another reference to the same error: https://github.com/home-assistant/home-assistant/issues/18657#

bsantero commented 5 years ago

Confirmed, I'm having the same strange bug as well.

prairiesnpr commented 5 years ago

Submitted PR to resolve this issue. https://github.com/miracle2k/onkyo-eiscp/pull/107