Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing on fuel_economy #15

Closed
mm98 opened this issue Oct 26, 2023 · 2 comments
Closed

Failing on fuel_economy #15

mm98 opened this issue Oct 26, 2023 · 2 comments

Comments

@mm98
Copy link

mm98 commented Oct 26, 2023

Hi,

Am I the only one having 203 occurrences of this error today, because fuel_economy can't be found? 😅 Integration is working - I just have a bunch of these logged.

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:732
First occurred: 12:08:26 (207 occurrences)
Last logged: 15:34:27

Update for sensor.audi_a5_fuel_economy fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 732, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 991, in async_device_update
    await self.async_update()
  File "/config/custom_components/connectedcars_io/sensor.py", line 428, in async_update
    self._state = round(
                  ^^^^^^
TypeError: type NoneType doesn't define __round__ method

if self._itemName == "fuel economy":
self._state = round(
await self._connectedcarsclient.get_value(
self._vehicle["id"], ["fuelEconomy"]
),
1,
)

@jnxxx
Copy link
Owner

jnxxx commented Oct 26, 2023

Yeah, I get it too.
It seems the API started to return null as fuelEconomy last night.

The integration was meant to check for this, but apparently only does so at startup.
And it fails to round null/None...

Ways to get rid of the error without a code change:

  • Restart
  • Reconfigure the integration, and choose some other option (restarts the integration)
  • Disable the sensor

Either of these should do it.
If still enabled, it should appear as Unavailable.

@mm98
Copy link
Author

mm98 commented Nov 17, 2023

Thanks! - I'll close this, since i don't see these events logged anymore!

@mm98 mm98 closed this as completed Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants