jesserockz / ha-leafspy

A Home Assistant integration to receive live data sent from the LeafSpy app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not parsing properly

wtadler opened this issue · comments

Describe the bug

My device_tracker entity seems not to update reliably. And when it does update it is only updated with the attributes source_type, battery_level, latitude, longitude, gps_accuracy, and friendly_name. I can see from the logs that the other attributes (like odometer), with proper values, are indeed making it to HA, but that something is going wrong with the parsing.

This change might be related to 2022.4, but I'm not totally sure.

Debug log

Exception in async_handle_message when dispatching 'leafspy': (<homeassistant.core.HomeAssistant object at 0x7f8ee69e80>, <custom_components.leafspy.LeafSpyContext object at 0x7f854f1b50>, <MultiDictProxy('user': '<CarName>', 'pass': 'xxxxx', 'DevBat': 'xxxxx', 'Gids': 'xxxxx', 'Lat': 'xxxxx', 'Long': 'xxxxx', 'Elv': 'xxxxx', 'Seq': 'xxxxx', 'Trip': 'xxxxx', 'Odo': '3741.14', 'SOC': 'xxxxx', 'AHr': 'xxxxx', 'BatTemp': 'xxxxx', 'Amb': 'xxxxx', 'Wpr': 'xxxxx', 'PlugState': 'xxxxx', 'ChrgMode': 'xxxxx', 'ChrgPwr': 'xxxxx', 'VIN': 'xxxxx', 'PwrSw': 'xxxxx', 'Tunits': 'xxxxx', 'RPM': 'xxxxx', 'SOH': 'xxxxx')>) Traceback (most recent call last): File "/config/custom_components/leafspy/", line 196, in async_handle_message args = _parse_see_args(message) File "/config/custom_components/leafspy/", line 173, in _parse_see_args 'odometer': int(message['Odo']), ValueError: invalid literal for int() with base 10: '3741.14'

[Actual values censored or fictionalized]

Yes there was a change in HA. I will release a fix soon. Thanks

ezoic increase your site revenue