Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to finish install when no battery is connected to system #7

Closed
jshill103 opened this issue May 26, 2022 · 2 comments
Closed

Fails to finish install when no battery is connected to system #7

jshill103 opened this issue May 26, 2022 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jshill103
Copy link

2022-05-25 15:54:53 ERROR (MainThread) [custom_components.enphase_envoy] Unexpected error fetching envoy Envoy ############ data: division by zero
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 191, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
return await self.update_method()
File "/config/custom_components/enphase_envoy/init.py", line 78, in async_update_data
data[description.key] = round(battery_sum / len(battery_data), 2)
ZeroDivisionError: division by zero
2022-05-25 15:54:53 DEBUG (MainThread) [custom_components.enphase_envoy] Finished fetching envoy Envoy ############ data in 3.165 seconds (success: False)

temp solution is to wrap the math on line 78 in a try catch. Fixed it locally on my system,.

@jshill103 jshill103 mentioned this issue May 26, 2022
@jshill103
Copy link
Author

made a pull request to fix this issue:
#8

@briancmpbll briancmpbll added bug Something isn't working help wanted Extra attention is needed labels Jun 24, 2022
@briancmpbll
Copy link
Owner

This should be fixed by #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants