tesla-local-control / tesla_ble_mqtt_core

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

[feat] Info Bluetooth Adapter #88

Closed baylanger closed 2 months ago

baylanger commented 2 months ago

It runs the following commands:

This replaces the previous scan-ble-macaddr

baylanger commented 2 months ago

Did you test it? I guess yes. Maybe update already the changelog as this will change the entity name.

Yes but I wasn't happy with the result. The output was mixed with Bluetooth advertisement received from devices. To change that, the output now goes in a variable and also spit it out using log_notice.

It looks really nice now, give it a try I think you'll like it as well.

Once approved we can merge it in stage.

baylanger commented 2 months ago

I just added this to put a warning if the Bluez version isn't recommended.

  bltctlVersion=$(echo "$BLTCTL_OUT" | grep ^Version | sed -e 's/^Version //g')
  bltctlMinVersion=5.63
  if awk -v n1="$bltctlMinVersion" -v n2="$bltctlVersion" 'BEGIN {exit !(n1 > n2)}'; then
    log_warning "Minimum recommended version of Bluez:$bltctlMinVersion; your system version:$bltctlVersion"
  else
    log_debug "Minimum recommended version of Bluez:$bltctlMinVersion; your system version:$bltctlVersion"
  fi
baylanger commented 2 months ago

Thank you @iainbullock for approving.