Get vehicle_name from vehicle_state or set to VIN or ID when not available#599
Get vehicle_name from vehicle_state or set to VIN or ID when not available#599ngardiner merged 1 commit intongardiner:mainfrom
Conversation
|
This looks like good improvement over #597. Yes, please. |
|
One thing that this doesn't completely fix -- not a blocker, but perhaps future work -- is that the display name appears to be collected from vehicle_data after the cached MQTT data has already come in, meaning that the correlation between MQTT data and vehicle remains broken. (Unless the vehicle's name actually changes, anyway.) I think any fix here relies on noticing when a vehicle's name "changes":
The second is a better long-term solution, but depends on being ready to merge the other MQTT work. |
|
I think you are referring to MQTT data received from TeslaMate and db2d104 ? I don't use TeslaMate myself so I can't test this. I agree that acting on the change of vehicle_name is the way to fix it. |
|
Agreed, let's merge this to avoid the exception, then follow up with MQTT vehicle name change logic - my preference would be to merge your MQTT fixes @MikeBishop and leverage that for vehicle name change support |
I restarted TWCManager this morging and noticed these errors:
It seems in the Fleet API response for /api/1/vehicles
display_nameis now defined asnull.I made the code more robust so that
self.namealways is a string and it updates to thevehicle_namefromvehicle_statewhen present.