tesla-local-control / tesla_ble_mqtt_core

Core content for the tesla_ble tools
Apache License 2.0
3 stars 2 forks source link

Display relevant info in the device's HA panel WIP #58

Closed baylanger closed 3 months ago

baylanger commented 4 months ago

This PR is to try to minimize information shows in the device's HA panel.

  1. When a new car is added:

    • If presence detection is active, the Presence entity will be shown for the car
    • The Generate Keys Button will be available
  2. Once the keys have been generate

    • The Deploy Button will show up in the panel
  3. Public key has been deployed (we don't have confirmation yet, WIP)

    • Once the pub key has been deployed, only then all buttons to send commands to the car will show up
baylanger commented 4 months ago

Now sure if the panel will automatically show the newly added buttons/etc or if a browser refresh will be required. To be tested.

raphmur commented 4 months ago

Nice addition. I will take time to read through today

baylanger commented 4 months ago

I just added a check to on "send_key" result but it doesn't mean that the key was added to the car.

We could probably do better... call for tesla-control "ping" and only once we can communicate with the car that we populate the device's car panel.

baylanger commented 4 months ago

New car with Presence On ... Only Presence and Generate Keys is shown:

2024-07-08_23-29-16

After pressing Generate Keys Button, the Deploy Key shows up:

2024-07-08_23-30-31

I can't continue but so far, this works pretty good. Just need to decide how much logic / time we want to put.

I find it's a nice improvement to start with, might need to adjust a few more things and this PR will be ready to go.

baylanger commented 4 months ago

Now that the keys are generated, currently there's no way for the addon to know if the pub was deployed successfully or not. We could drop a file ~ $vin_key.deployed

We could also rely on presence detection and/or "tesla-control ping" to show or not the all "command buttons".

"tesla-control ping" - if the car is present - could tell us if the key is valid or not.

baylanger commented 3 months ago

Closing this PR, new PR #75