unable to parse 'None' using ['%Y-%m-%dT%H:%M:%S.%f%z', '%Y-%m-%dT%H:%M:%S%z', '%Y-%m-%dT%H:%M:%S.%fZ', '%Y-%m-%dT%H:%M:%SZ']
For the car there is no "lastFetched" in attributes.
I think this code in bimmer_connected/utils.py:
def parse_datetime(date_str: str) -> Optional[datetime.datetime]: """Convert a time string into datetime.""" if not date_str: return None date_formats = ["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%dT%H:%M:%S%z", "%Y-%m-%dT%H:%M:%S.%fZ", "%Y-%m-%dT%H:%M:%SZ"]
should rather be:
def parse_datetime(date_str: str) -> Optional[datetime.datetime]: """Convert a time string into datetime.""" if not date_str or date_str = "None": return None date_formats = ["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%dT%H:%M:%S%z", "%Y-%m-%dT%H:%M:%S.%fZ", "%Y-%m-%dT%H:%M:%SZ"]
The calling vehicle/vehicle.py converts None to "None"...
Expected behavior
avoid the error message
Which Home Assistant version are you using?
bimmerconnected cli
What was the last working version of Home Assistant Core?
n/a
What is your region?
Rest of world
MyBMW website
[X] I can still successfully login to the BMW MyBMW website and the car status is available there.
[X] I have MyBMW enabled for my vehicle.
Number of cars
[ ] I have 2 or more cars linked to the MyBMW account.
Describe the issue
I get this error:
For the car there is no "lastFetched" in attributes.
I think this code in bimmer_connected/utils.py:
def parse_datetime(date_str: str) -> Optional[datetime.datetime]: """Convert a time string into datetime.""" if not date_str: return None date_formats = ["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%dT%H:%M:%S%z", "%Y-%m-%dT%H:%M:%S.%fZ", "%Y-%m-%dT%H:%M:%SZ"]
should rather be:def parse_datetime(date_str: str) -> Optional[datetime.datetime]: """Convert a time string into datetime.""" if not date_str or date_str = "None": return None date_formats = ["%Y-%m-%dT%H:%M:%S.%f%z", "%Y-%m-%dT%H:%M:%S%z", "%Y-%m-%dT%H:%M:%S.%fZ", "%Y-%m-%dT%H:%M:%SZ"]
The calling vehicle/vehicle.py converts None to "None"...
Expected behavior
avoid the error message
Which Home Assistant version are you using?
bimmerconnected cli
What was the last working version of Home Assistant Core?
n/a
What is your region?
Rest of world
MyBMW website
Number of cars
Output of bimmer_connected fingerprint
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response