cgarwood / homeassistant-fullykiosk

Fully Kiosk Browser integration for Home Assistant
Apache License 2.0
153 stars 27 forks source link

Unstable connection results in exceptions #7

Closed tribut closed 4 years ago

tribut commented 4 years ago

In the log, I'm seeing a lot of errors like this:

2020-06-11 12:46:34 INFO (MainThread) [custom_components.fullykiosk] Fetching deviceInfo data recovered                                  
Timeout error                                                                                                                            
2020-06-11 12:46:54 ERROR (MainThread) [custom_components.fullykiosk] Unexpected error fetching deviceInfo data: local variable 'result' 
referenced before assignment                                                                                                             
Traceback (most recent call last):                                                                                                       
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 136, in async_refresh                                  
    self.data = await self._async_update_data()                                                                                          
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 124, in _async_update_data                             
    return await self.update_method()                                                                                                    
  File "/config/custom_components/fullykiosk/__init__.py", line 44, in async_update_data                                                 
    data = await hass.async_add_executor_job(fully.getDeviceInfo)                                                                        
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run                                                          
    result = self.fn(*self.args, **self.kwargs)                                                                                          
  File "/var/tmp/homeassistant-venv/lib/python3.7/site-packages/fullykiosk/__init__.py", line 27, in getDeviceInfo                       
    result = self.sendCommand("deviceInfo")                                                                                              
  File "/var/tmp/homeassistant-venv/lib/python3.7/site-packages/fullykiosk/__init__.py", line 24, in sendCommand                        
    return result                                                                                                                        
UnboundLocalError: local variable 'result' referenced before assignment