snicker / zwift_hass

Zwift Sensor Integration for HomeAssistant
53 stars 13 forks source link

fix gradient update fails error #22

Closed badguy99 closed 3 years ago

badguy99 commented 3 years ago

This fixes the following error I was seeing in my logs:

2021-04-01 17:54:16 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.zwift_gradient_<zwift_id> fails
  File "/config/custom_components/zwift/sensor.py", line 202, in update
  File "/config/custom_components/zwift/sensor.py", line 271, in gradient

It also adds a bit of debug level logging, as I'm not sure this will fix the issue I raised earlier, and I don't like running enough to be doing a lot of runs and saving them :)