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
72.6k stars 30.37k forks source link

Serial access not synchronized/Inefficient status update for Russound RNET devices #9604

Closed altersis closed 6 years ago

altersis commented 7 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): found in 0.37, still present in 0.54

Python release (python3 --version): 3.4

Component/platform: Russound RNET

Description of problem: This issue is necessary to cover the fix for issue #6 in the russound rnet component. There are 3 issues documented in there, the third point is the one that needs changes in the russound_rnet.py component:

  1. The Update method of RussoundRNETDevice on the Home Assistant file called russound_rnet.py calls get_power, get_source/get_volume functions in russound.py ; those three functions call the get_zone_info function, which translates into three identical requests to the Russound device with each call only using a different part of the response. This multiplies the amount of network traffic and processing by 3. This fix is necessary to invoke only one function to get a complete status update. This change is being coordinated with @laf and @acambitsis. Once they've had a chance to verify the fix on their systems, both changes will have to be merged at the same time.

Expected: An update for each zone should only be making one request per Russound zone.

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

any use of the russound component will reproduce these issues, for example:

media_player:
  - platform: russound_rnet
    host: 192.148.23.11
    port: 7777
    name: RussCont
    zones:
      1:
        name: Living room
      2:
        name: Backyard

Traceback (if applicable):

Additional info: Users suffering this issue will see something similar in their log file:

2017-09-18 14:44:13 WARNING (Thread-8) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 3. 2017-09-18 14:44:13 WARNING (Thread-7) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 1. 2017-09-18 14:44:14 WARNING (Thread-9) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 2. 2017-09-18 14:44:14 WARNING (Thread-11) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 4. 2017-09-18 14:44:14 WARNING (Thread-4) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 5. 2017-09-18 14:44:14 WARNING (MainThread) [homeassistant.setup] Setup of sensor is taking over 10 seconds. 2017-09-18 14:44:14 WARNING (MainThread) [homeassistant.setup] Setup of media_player is taking over 10 seconds. 2017-09-18 14:44:15 WARNING (Thread-8) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 3. 2017-09-18 14:44:15 WARNING (Thread-7) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 1. 2017-09-18 14:44:15 WARNING (Thread-9) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 6. 2017-09-18 14:44:15 WARNING (Thread-11) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 4. 2017-09-18 14:44:15 WARNING (Thread-4) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 5. 2017-09-18 14:44:16 WARNING (Thread-8) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 3. 2017-09-18 14:44:16 WARNING (Thread-9) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 6. 2017-09-18 14:44:16 WARNING (Thread-11) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 4. 2017-09-18 14:44:16 WARNING (Thread-4) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 5. 2017-09-18 14:44:17 WARNING (Thread-9) [russound.russound] Did not receive expected Russound power state for controller 1 and zone 6.

altersis commented 7 years ago

Code fix has been coordinated with @acambitsis and @laf. Version 0.1.9 of the russound RNET component has been tested and uploaded to PYPI. Will now open PR in home assistant to incorporate new version of the Russound_RNET component that makes the proper calls to the enhanced code.