When the car is asleep, the exporter will error because it's trying to take action on None or NoneType
Example Error:
Traceback (most recent call last):
File "/home/jstelmach/teslafi/teslafi_exporter/exporter.py", line 1029, in <module>
TESLAFI_COLLECTOR = TeslaFiCollector(teslafi_api_token)
File "/home/jstelmach/teslafi/teslafi_exporter/exporter.py", line 32, in __init__
registry.register(self)
File "/usr/local/lib/python3.8/dist-packages/prometheus_client/registry.py", line 40, in register
names = self._get_names(collector)
File "/usr/local/lib/python3.8/dist-packages/prometheus_client/registry.py", line 80, in _get_names
for metric in desc_func():
File "/home/jstelmach/teslafi/teslafi_exporter/exporter.py", line 158, in collect
value=float(self.getSetData(teslafi_data, teslafi_data_old, "odometer"))*1609.344)
TypeError: float() argument must be a string or a number, not 'NoneType'
Is this expected or by design? If not, should we add error checking to see if the value exists then exit gracefully?
Howdy!
When the car is asleep, the exporter will error because it's trying to take action on
None
orNoneType
Example Error:
Is this expected or by design? If not, should we add error checking to see if the value exists then exit gracefully?
Thanks!