I am receiving a ValueError runtime exception when attempting to pull back history from my Aranet4:
% pyaranet4 --history
Traceback (most recent call last):
File "/<redacted>/pyaranet4/.venv/bin/pyaranet4", line 8, in <module>
sys.exit(main())
File "/<redacted>/pyaranet4/.venv/lib/python3.10/site-packages/pyaranet4/__main__.py", line 56, in main
collect_data(a4, args, sensors)
File "/<redacted>/pyaranet4/.venv/lib/python3.10/site-packages/pyaranet4/__main__.py", line 114, in collect_data
history = a4.get_history(sensors)
File "/<redacted>/pyaranet4/.venv/lib/python3.10/site-packages/pyaranet4/pyaranet4.py", line 219, in get_history
return self.loop.run_until_complete(self._get_history(sensors, start, end))
File "/<redacted>/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/<redacted>/pyaranet4/.venv/lib/python3.10/site-packages/pyaranet4/pyaranet4.py", line 410, in _get_history
index_map[max(self._datapoints)] = last_timestamp
ValueError: max() arg is an empty sequence
%
I can pull back the most recent measurement without issue using pyaranet4:
% pyaranet4
--------------------------------------
Connected: Aranet4 03263 | v0.4.10
Updated 40 s ago. Intervals: 60 s
5040 total readings
--------------------------------------
CO2: 846 ppm
Temperature: 20.00 C
Humidity: 32 %
Pressure: 980.50 hPa
Battery: 33 %
--------------------------------------
But for some reason when I pass the --history flag, I get the ValueError exception. Based on the detail message max() arg is an empty sequence, I wonder if self._datapoints isn't getting set for some reason.
Desired Resolution:
Can you provide any guidance on why I might be receiving this error, and how to resolve it?
Please let me know if I can provide any additional details!
Issue Summary:
pyaranet4 --history
raisesValueError
exception. SeeIssue Details
section below for more information.Python Version Details:
Aranet4 Sensor Details:
Issue Details:
I am receiving a ValueError runtime exception when attempting to pull back history from my Aranet4:
I can pull back the most recent measurement without issue using
pyaranet4
:But for some reason when I pass the
--history
flag, I get the ValueError exception. Based on the detail messagemax() arg is an empty sequence
, I wonder ifself._datapoints
isn't getting set for some reason.Desired Resolution:
Can you provide any guidance on why I might be receiving this error, and how to resolve it?
Please let me know if I can provide any additional details!