From 72267be957c4fe21cf46b420922bf06282dac9fe Mon Sep 17 00:00:00 2001 From: Alexandre Esse Date: Tue, 11 Jun 2024 01:21:41 +0200 Subject: [PATCH 1/4] examples: add shebang Signed-off-by: Alexandre Esse --- examples/noise-amps-at-freqs.py | 2 ++ examples/noise-profile.py | 2 ++ examples/sensorcommunity_combined.py | 2 ++ 3 files changed, 6 insertions(+) diff --git a/examples/noise-amps-at-freqs.py b/examples/noise-amps-at-freqs.py index 957511b4..75497df2 100755 --- a/examples/noise-amps-at-freqs.py +++ b/examples/noise-amps-at-freqs.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import st7735 from PIL import Image, ImageDraw diff --git a/examples/noise-profile.py b/examples/noise-profile.py index be6a1855..480815e6 100755 --- a/examples/noise-profile.py +++ b/examples/noise-profile.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import st7735 from PIL import Image, ImageDraw diff --git a/examples/sensorcommunity_combined.py b/examples/sensorcommunity_combined.py index a7aeb7b8..bb9869d6 100644 --- a/examples/sensorcommunity_combined.py +++ b/examples/sensorcommunity_combined.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import colorsys import logging import time From b6fd390e03843d16d20970a331635c382f1176e5 Mon Sep 17 00:00:00 2001 From: Alexandre Esse Date: Tue, 11 Jun 2024 03:15:48 +0200 Subject: [PATCH 2/4] mqtt-all: fix display box The previous display box function wasn't properly used. This fix the information displayed on the enviro+ display. Signed-off-by: Alexandre Esse --- examples/mqtt-all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mqtt-all.py b/examples/mqtt-all.py index ecab4a35..db4cf875 100755 --- a/examples/mqtt-all.py +++ b/examples/mqtt-all.py @@ -136,7 +136,7 @@ def display_status(disp, mqtt_broker): message = f"{device_serial_number}\nWi-Fi: {wifi_status}\nmqtt-broker: {mqtt_broker}" img = Image.new("RGB", (WIDTH, HEIGHT), color=(0, 0, 0)) draw = ImageDraw.Draw(img) - x1, y1, x2, y2 = font.getbbox(message) + x1, y1, x2, y2 = draw.textbbox((0,0), message, font=font) size_x = x2 - x1 size_y = y2 - y1 x = (WIDTH - size_x) / 2 From f32e560580d32356858fddae2a3e18ef2eabb0ae Mon Sep 17 00:00:00 2001 From: Alexandre Esse Date: Tue, 11 Jun 2024 03:22:26 +0200 Subject: [PATCH 3/4] mqtt-all: update display message Signed-off-by: Alexandre Esse --- examples/mqtt-all.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mqtt-all.py b/examples/mqtt-all.py index db4cf875..b4fd19ef 100755 --- a/examples/mqtt-all.py +++ b/examples/mqtt-all.py @@ -133,7 +133,7 @@ def display_status(disp, mqtt_broker): text_colour = (255, 255, 255) back_colour = (0, 170, 170) if check_wifi() else (85, 15, 15) device_serial_number = get_serial_number() - message = f"{device_serial_number}\nWi-Fi: {wifi_status}\nmqtt-broker: {mqtt_broker}" + message = f"Serial: {device_serial_number}\nWi-Fi: {wifi_status}\nmqtt-broker: {mqtt_broker}" img = Image.new("RGB", (WIDTH, HEIGHT), color=(0, 0, 0)) draw = ImageDraw.Draw(img) x1, y1, x2, y2 = draw.textbbox((0,0), message, font=font) From e85fab90893f2ed34b4c9deeabfaecb83f1475d9 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Fri, 11 Jul 2025 14:55:38 +0100 Subject: [PATCH 4/4] Prefer pip binary installs for #154. --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 61f1a4a6..d2d973a9 100755 --- a/install.sh +++ b/install.sh @@ -162,13 +162,13 @@ function apt_pkg_install { function pip_pkg_install { # A null Keyring prevents pip stalling in the background - PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --upgrade "$@" + PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --prefer-binary --upgrade "$@" check_for_error } function pip_requirements_install { # A null Keyring prevents pip stalling in the background - PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install -r "$@" + PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring $PYTHON -m pip install --prefer-binary -r "$@" check_for_error }