kia_uvo icon indicating copy to clipboard operation
kia_uvo copied to clipboard

Last Action Tracking

Open cdnninja opened this issue 2 years ago • 3 comments

Implement last action tracking in 2.0.

cdnninja avatar Nov 15 '22 19:11 cdnninja

This is the file that references how it was done in 1.8 https://github.com/Hyundai-Kia-Connect/kia_uvo/blob/ce22857dcf4d660c472dfc0c2164b603ac14b3b6/custom_components/kia_uvo/Vehicle.py

cdnninja avatar Dec 16 '22 02:12 cdnninja

@tobiasbayer Interested to see thoughts. What I am thinking is update the vehicle class here: https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api/blob/master/hyundai_kia_connect_api/Vehicle.py to store the "last action id" as well as potentially a flag set by the API for if that car supports it. Then the logic in home assistant is almost identical to the above link.

It means no need to start attributes about the last action for the car. We purely start calling to check for last action status. When it returns true we move on to call a car update.

cdnninja avatar Dec 16 '22 02:12 cdnninja

Hey guys, I'm working on a solution for action tracking, see pull request linked above. Thankful for your thoughts! I've tested it in my own Home Assistant setup and it works.

Note that in the CA api, the rmtsts command used by check_last_action_status returns the latest vehicle information once the action has completed successfully. I use that to refresh vehicle data, so there is no need to do a refresh.

I'm not sure if the solution I'm proposing will work universally as I don't know anything about the EU and US implementations.

torbjornaxelsson avatar Dec 17 '22 22:12 torbjornaxelsson