Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Problems with the sensor #69

Open
mfabiani53 opened this issue Jan 4, 2023 · 3 comments
Open

Problems with the sensor #69

mfabiani53 opened this issue Jan 4, 2023 · 3 comments

Comments

@mfabiani53
Copy link

Everytime i try to configure the card with the sensor i get the following errors that make the log grow so i am forced to disable the sensor and the card.

2023-01-04 17:42:45.211 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.formula_one_sensor_races fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 372, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 402, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 527, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 722, in async_device_update
    raise exc
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/formulaone_api/formulaonesensor.py", line 60, in update
    self.set_state()
  File "/config/custom_components/formulaone_api/racessensor.py", line 45, in set_state
    all_attr = self.get_race_data()
  File "/config/custom_components/formulaone_api/racessensor.py", line 19, in get_race_data
    races = f1.season_schedule(season=now.year).json
  File "/config/custom_components/formulaone_api/ergast.py", line 39, in json
    return self._json.json()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

These errors are repeating every few seconds....

@WizBangCrash
Copy link

After updating I am getting the same errors.

@silvannn
Copy link

silvannn commented Jan 6, 2023

all sensors are empty. only last result is fine.

@delzear
Copy link
Owner

delzear commented Jan 6, 2023

My server is having problems communicating with the Ergast API. I am working on it. Sorry for the problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants