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

Fatal error if GrDF returns no start index/end index/volume/energy data in the record #72

Closed
ssenart opened this issue Dec 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ssenart
Copy link
Owner

ssenart commented Dec 9, 2024

2024-12-09 14:01:08.922 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1046, in _async_update_entity_states
await entity.async_update_ha_state(True)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
self.__async_calculate_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/config/custom_components/gazpar/sensor.py", line 239, in state
return Util.toState(self._dataByFrequency)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/gazpar/util.py", line 38, in toState
while (currentIndex < len(dailyData)) and (float(dailyData[currentIndex][PropertyName.START_INDEX.value]) == float(dailyData[currentIndex][PropertyName.END_INDEX.value])):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'

@ssenart ssenart added the bug Something isn't working label Dec 9, 2024
@C-Duv
Copy link

C-Duv commented Dec 9, 2024

Note: You have irrelevant "zigbee2mqtt" logs in there.

@ssenart
Copy link
Owner Author

ssenart commented Dec 21, 2024

It has been fixed in pre-release 1.3.11-alpha.0.

@ssenart ssenart closed this as completed Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants