Skip to content

Commit 03aaaac

Browse files
committed
add $UNIQUE_ID to PWC_HOTSPOT_SSID
1 parent 4b3d65f commit 03aaaac

File tree

3 files changed

+14
-28
lines changed

3 files changed

+14
-28
lines changed

.github/workflows/balena-deploy.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
env:
1111
REGISTRY: ghcr.io
12-
IMAGE_NAME: balena-labs-research/python-wifi-connect
12+
IMAGE_NAME: coderbotorg/python-wifi-connect
1313

1414
jobs:
1515
build-and-push-image:
@@ -20,20 +20,20 @@ jobs:
2020

2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
2424

2525
- name: Set up QEMU
26-
uses: docker/setup-qemu-action@v1
26+
uses: docker/setup-qemu-action@v2
2727

2828
- name: Set up Docker Buildx
2929
id: buildx
30-
uses: docker/setup-buildx-action@v1
30+
uses: docker/setup-buildx-action@v3
3131

3232
- name: Available platforms
3333
run: echo ${{ steps.buildx.outputs.platforms }}
3434

3535
- name: Log in to the Container registry
36-
uses: docker/login-action@v1
36+
uses: docker/login-action@v2
3737
with:
3838
registry: ${{ env.REGISTRY }}
3939
username: ${{ github.actor }}
@@ -54,7 +54,7 @@ jobs:
5454
with:
5555
context: .
5656
file: ./Dockerfile
57-
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/386
57+
platforms: linux/arm64,linux/arm/v7,linux/arm/v6
5858
push: true
5959
tags: ${{ steps.meta.outputs.tags }}
6060
labels: ${{ steps.meta.outputs.labels }}

src/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
else:
2626
hotspot_ssid = "Python Wi-Fi Connect"
2727

28+
if "$UNIQUE_ID" in hotspot_ssid:
29+
with open("/proc/cpuinfo") as f:
30+
for line in f:
31+
if "Serial" in line:
32+
serial = line.replace(" ","").split(":")[1]
33+
hotspot_ssid.replace("$UNIQUE_ID", serial[-5:-1])
34+
35+
hotspot_ssid.replace("$UNIQUE_ID", )
2836
# Set default hotspot password.
2937
if "PWC_HOTSPOT_PASSWORD" in env_file:
3038
hotspot_password = env_file["PWC_HOTSPOT_PASSWORD"]

0 commit comments

Comments
 (0)