ofalvai / home-assistant-szep-kartya

Custom component for tracking the balance of an OTP SZÉP Kártya
19 stars 5 forks source link

Error while setting up szep_kartya platform for sensor #13

Closed amaximus closed 1 year ago

amaximus commented 1 year ago

Home Assistant Core: 2023.1.2

It used to work in previous major version 2022.12.9.

2023-01-09 09:39:48.391 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up szep_kartya platform for sensor
Traceback (most recent call last):
  File "/home/pi/ha_venv3_9/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 289, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/homeassistant_conf/custom_components/szep_kartya/sensor.py", line 48, in setup_platform
    sensor.update()
  File "/home/pi/homeassistant_conf/custom_components/szep_kartya/sensor.py", line 94, in update
    self.scrape_tokens()
  File "/home/pi/homeassistant_conf/custom_components/szep_kartya/sensor.py", line 101, in scrape_tokens
    script_tag_text = soup.find('script', text=re.compile('ajax_token')).string
AttributeError: 'NoneType' object has no attribute 'string'
amaximus commented 1 year ago

After a new restart this error doesn't appear anymore.