question: you get some response from teslas server that the command was successfully sent to the car (I.e. Hvac on), but does the app just assume the action was executed properly or does the app get a response from the car via teslas server or whatever, that the hvac is actually on in the car?
The timeline goes something like this in version 2.0 (in version 1.x, there's no messages or notifications or sound effects):
1st second:
User presses HVAC On
App assumes that it works, and HVAC On button becomes HVAC Off
App sends command to Teslas servers
App plays a sound effect for the button press
App writes a message to the user saying that the command is being sent
1-2 seconds later:
App gets back response from Tesla servers
App reads response and plays back a sound according to either failure or success
If it's a failure, it notifies the user either with a popup alert, or if the user closes the app before the response is returned, a local notification popup. This message should contain the reason for the failure.
If it's a failure, revert the HVAC Off button back to HVAC On.
If it's a success, a message to the user says that the command was successful
5 seconds later:
App asks and gets an update for the car's full status. At this point, things like fan speed will be displayed if the HVAC is on.
The 5 second delay is there because some commands take a while to complete, and if the app asks for the car's full status, the status might conflict with what the user pressed. For example, if the roof didn't fully open yet, the app will display that the roof is not fully open yet. So I left the 5 second delay to let the car finish doing the command. In the official Tesla app, the delay is in the form of a spinning car after each command. But this blocks you from seeing the stats in the time. So in my app, I don't block the user from app after each command issued. I handle the effects for when the command fails or succeeds. However, this delay may also make people think that the command didn't work. That's why in version 2.0, I keep the user informed of what's going on, so that they know within a second or two whether the command succeeded or failed.