Skip to content

Commit

Permalink
script fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tube0013 committed Aug 26, 2024
1 parent 83a6345 commit 3cc0979
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tzb-cc2652-flasher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changelog
## 0.3.3.2
## 0.3.3.3
- Script fixes

## 0.3.3.1
Expand Down
2 changes: 1 addition & 1 deletion tzb-cc2652-flasher/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 0.3.3.2
version: 0.3.3.3
slug: tzb-cc2652-flasher
name: TubesZB TI CC2652 FW Flasher
description: TubesZB TI CC2652 firmware flasher add-on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ network_device_url=$(echo "$network_device" | sed 's/.\{5\}$//')

if bashio::config.true 'device_type'; then
device=$(bashio::config 'device')
bashio::log.info "Using USB Device " $(bashio::config 'device')
else
device="socket://${network_device}"
bashio::log.info "Using Network Device " ${cc2652p2_release_url}
fi

# Get Firmware

if bashio::config.true 'cc2652p2_fw'; then
curl --silent -L -o "/root/firmware.zip" ${cc2652p2_release_url}
bashio::log.info "Downloading " ${cc2652p2_release_url}
if [ ! -f "/root/firmware.zip" ]; then
bashio::log.warning "Downloading firmware failed"
exit 0
Expand All @@ -61,8 +64,9 @@ if bashio::config.true 'cc2652p2_fw'; then

firmware="firmware.hex"

if bashio::config.true 'cc2652p7_fw'; then
elif bashio::config.true 'cc2652p7_fw'; then
curl --silent -L -o "/root/firmware.zip" ${cc2652p7_release_url}
bashio::log.info "Downloading " ${cc2652p7_release_url}
if [ ! -f "/root/firmware.zip" ]; then
bashio::log.warning "Downloading firmware failed"
exit 0
Expand All @@ -76,8 +80,9 @@ if bashio::config.true 'cc2652p7_fw'; then

firmware="firmware.hex"

if bashio::config.has_value 'firmware_url'; then
elif bashio::config.has_value 'firmware_url'; then
curl --silent -L -o "/root/firmware.zip" "$(bashio::config 'firmware_url')"
bashio::log.info "Downloading " $(bashio::config 'firmware_url')
if [ ! -f "/root/firmware.zip" ]; then
bashio::log.warning "Firmware Download failed"
exit 0
Expand All @@ -92,7 +97,6 @@ if bashio::config.has_value 'firmware_url'; then
firmware="firmware.hex"
else
exit_no_firmware
bashio::log.warning "No Firmware Found"
fi

if bashio::config.true 'trigger_esphome_bsl'; then
Expand All @@ -102,11 +106,10 @@ if bashio::config.true 'trigger_esphome_bsl'; then
sleep 8s
fi


if bashio::config.true 'sonoff'; then
bashio::log.info "Starting CC2652P flasher with Sonoff ${device}"
cc1352-flasher.py -p ${device} -evw --bootloader-sonoff-usb "/root/${firmware}"
else
bashio::log.info "Starting cc2652 flasher with ${device}"
bashio::log.info "Starting cc2652P flasher with ${device}"
cc1352-flasher.py -p ${device} -evw "/root/${firmware}"
fi
2 changes: 1 addition & 1 deletion tzb-cc2652-flasher/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ configuration:
name: Flash USB Device
description: Flash USB device instead of Network Device (Requires you to trigger bootloader mode by holding BSL button while plugging in to USB)
sonoff:
name: Flashing a Sonoff Dongle-P?
name: Flashing a Sonoff Dongle-P7?
description: Select to enable the bsl trigger for the Sonoff Dongle-P
cc2652p2_fw:
name: Select for Current Recommended CC2652 P2 Firmware
Expand Down

0 comments on commit 3cc0979

Please sign in to comment.