From 54a02ad1491d0befec7d76badb1eb99e986ae83e Mon Sep 17 00:00:00 2001 From: Tempest Date: Mon, 4 Aug 2025 17:42:26 +0700 Subject: [PATCH] Corrected the characteristic order to properly address lamps --- src/controllerSoftware/run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/controllerSoftware/run.py b/src/controllerSoftware/run.py index b1031ed..36f22fb 100644 --- a/src/controllerSoftware/run.py +++ b/src/controllerSoftware/run.py @@ -35,6 +35,8 @@ def posColorByte(pos, section, color): async def setOnUserInput(client, chars): while True: configZone = input("Input Zone [Up, Down, Left, Right, Inner, Outer]: ") + if configZone not in list(LampArray.keys()): + continue configColor = input("Input Color [000000]: ") configColorCenter = input("Input Color for Center Lamp [000000]: ") await setLampToColor(client, chars, configZone, configColor, configColorCenter) @@ -106,7 +108,7 @@ async def connect_to_ble_device(device_name): # await setLampToColor(client, service.characteristics, Right, color) # await setLampToColor(client, service.characteristics, Inner, color) # await setLampToColor(client, service.characteristics, Outer, color) - if service.uuid != 1: + if service.handle != 1: await setOnUserInput(client, sorted_characteristics) else: