hunterjm / hassio-addons

Control your Xbox One from your Home Assistant device.
MIT License
55 stars 50 forks source link

Lot of errors in the log #7

Closed gerard33 closed 5 years ago

gerard33 commented 5 years ago

First of all, thanks for this great addon!

When turning the Xbox off with the addon I noticed some errors in the log.

Failed to connect to FD00600201XXX111
22:10 custom_components/media_player/xboxone.py (ERROR)
Failed to connect to console FD00600201XXX111: {'message': 'Exceeded retries', 'success': False}
22:10 custom_components/media_player/xboxone.py (ERROR)
Updating xboxone media_player took longer than the scheduled update interval 0:00:10
22:10 helpers/entity_platform.py (WARNING)
Update of media_player.xbox_one_office is taking over 10 seconds
22:10 core.py (WARNING)

Maybe this can be fixed by changing this.

def turn_off(self):
    """Turn off the device."""
    self._xboxone.poweroff()

to

def turn_off(self):
    """Turn off the device."""
    self._xboxone.poweroff()
    self._state = STATE_OFF

Not sure if it fixes it though. What do you think?

hunterjm commented 5 years ago

Changed some of the logging in the component on the develop branch. Let me know if you see this issue still after loading in that component.

gerard33 commented 5 years ago

The errors are gone now :grinning:

Only have this error once after shutting down, but that could be unrelated.

Update for media_player.xbox_one_office fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
    yield from self.async_device_update()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 353, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/media_player/xboxone.py", line 557, in update
    self._xboxone.refresh()
  File "/config/custom_components/media_player/xboxone.py", line 442, in refresh
    self._volume_controls = self._get_volume_controls()
  File "/config/custom_components/media_player/xboxone.py", line 283, in _get_volume_controls
    controls = response.get('avr') or response.get('tv')
UnboundLocalError: local variable 'response' referenced before assignment
tuxuser commented 5 years ago

@gerard33 Fixed with PR #17

hunterjm commented 5 years ago

Fixed in 1.1.0