diff --git a/src/controllerSoftware/run.py b/src/controllerSoftware/run.py index d1fec9c..9d8b5df 100644 --- a/src/controllerSoftware/run.py +++ b/src/controllerSoftware/run.py @@ -21,14 +21,14 @@ def sectionInitializer(): def sectionSerializer(section): result = sectionInitializer() - sectionResult = LampArray["Center"] + LampArray[section] + sectionResult = LampArray[section] for pos in sectionResult: result[pos] = 1 return result def posColorByte(pos, section, color): intColor = int(color, 16) - result = intColor * section[pos] + result = int(intColor * section[pos]) print(result) return result.to_bytes(3) @@ -36,10 +36,13 @@ async def setOnUserInput(client, chars): while True: configZone = input("Input Zone [Up, Down, Left, Right, Inner, Outer]: ") configColor = input("Input Color [000000]: ") - await setLampToColor(client, chars, configZone, configColor) + configColorCenter = input("Input Color for Center Lamp [000000]: ") + await setLampToColor(client, chars, configZone, configColor, configColorCenter) -async def setLampToColor(bleClient, bleChars, section, color): +async def setLampToColor(bleClient, bleChars, section, color, colorCenter): sectionSerial = sectionSerializer(section) + colorCenterFactor = int(colorCenter, 16)/int(color,16) + sectionSerial[0] = colorCenterFactor for char in bleChars: lampPos = bleChars.index(char) print(f"Setting Lamp number {lampPos}")