Traceback (most recent call last):


 "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state

await self.async_device_update()


 "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update

await self.hass.async_add_executor_job(self.update)


 "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run

result = self.fn(*self.args, **self.kwargs)


 "/usr/src/homeassistant/homeassistant/components/qbittorrent/sensor.py", line 120, in update

if data is None:
UnboundLocalError: local variable 'data' referenced before assignment

Traceback (most recent call last):


 "/usr/src/app/homeassistant/setup.py", line 154, in _async_setup_component

component.setup, hass, processed_config)
# type: ignore


 "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run

result = self.fn(*self.args, **self.kwargs)


 "/usr/src/app/homeassistant/components/xiaomi_aqara/__init__.py", line 124, in setup

xiaomi.discover_gateways()


 "/usr/local/lib/python3.7/site-packages/xiaomi_gateway/__init__.py", line 108, in discover_gateways

discovery_retries, self._interface,
UnboundLocalError: local variable 'discovery_retries' referenced before assignment
