data is set on line 461 but if IncompleteCredentials triggers, it does a reload and still return data that is not existing. I think a return after lin 474 would fix the exception.
Debug log
2024-03-13 21:29:00.273 ERROR (MainThread) [custom_components.tesla_custom] Unexpected error fetching tesla_custom data: cannot access local variable 'data' where it is not associated with a value
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/tesla_custom/__init__.py", line 484, in _async_update_data return data
^^^^ UnboundLocalError: cannot access local variable 'data' where it is not associated with a value
Version of the custom_component
HEAD as of now; 1c59bc28e2091737998906d52db38c87d488c5c7
Describe the bug
https://github.com/alandtse/tesla/blob/1c59bc28e2091737998906d52db38c87d488c5c7/custom_components/tesla_custom/__init__.py#L484
data is set on line 461 but if IncompleteCredentials triggers, it does a reload and still return data that is not existing. I think a return after lin 474 would fix the exception.
Debug log