-
Notifications
You must be signed in to change notification settings - Fork 22
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
get_battery_data: 'NoneType' object cannot be interpreted as an integer #71
Comments
Pasted the code and the error to ChatGPT: The error message you provided indicates that there's an issue in the To help you further, I will inspect the From the code snippet, the error occurs at this line: for sensor in range(0, sensorCount): Here, sensorCount = rscpFindTagIndex(info, "BAT_DCB_NR_SENSOR") It seems that the function To resolve this issue, you could:
Here's a suggestion on how to handle it: sensorCount = rscpFindTagIndex(info, "BAT_DCB_NR_SENSOR")
if sensorCount is None:
sensorCount = 0 # Or handle this case in some other appropriate way
for sensor in range(0, sensorCount):
... This will prevent the error by setting Would you like to apply this fix or investigate further? |
Same problem here with a S10 X Compact 14. Please also see torbennehmer/hacs-e3dc#45, some tests are already documented there. If I can help in diagnosing it by running some more commands, I'm happy to help @fsantini @torbennehmer ! |
Get this error when i run e3dc-to-mqtt (https://github.com/mdhom/e3dc-to-mqtt)
File "/home/pi/gitstuff/e3dc-to-mqtt/e3dc_to_mqtt/e3dc_to_mqtt_base.py", line 164, in run
battery_data = await self.e3dc.get_battery_data()
File "/home/pi/gitstuff/e3dc-to-mqtt/e3dc_to_mqtt/e3dc_to_mqtt_base.py", line 299, in get_battery_data
battery_data = self.__e3dc.get_battery_data(batIndex=i)
File "/root/.local/lib/python3.7/site-packages/e3dc/_e3dc.py", line 1324, in get_battery_data
for sensor in range(0, sensorCount):
TypeError: 'NoneType' object cannot be interpreted as an integer
The text was updated successfully, but these errors were encountered: