From b0c72ac370c574ed151b4f24c5c055c03cb102f4 Mon Sep 17 00:00:00 2001 From: xnkevinnguyen Date: Mon, 20 Apr 2020 09:07:27 -0700 Subject: [PATCH 1/2] Fix inverse switch --- src/adafruit_circuitplayground/express.py | 2 +- src/view/components/cpx/CpxImage.tsx | 2 +- src/view/components/cpx/CpxSimulator.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/adafruit_circuitplayground/express.py b/src/adafruit_circuitplayground/express.py index 7f2857508..84fa68c7e 100644 --- a/src/adafruit_circuitplayground/express.py +++ b/src/adafruit_circuitplayground/express.py @@ -37,7 +37,7 @@ def __init__(self): (0, 0, 0), ] self.__state[CONSTANTS.EXPRESS_STATE.RED_LED] = False - self.__state[CONSTANTS.EXPRESS_STATE.SWITCH] = False + self.__state[CONSTANTS.EXPRESS_STATE.SWITCH] = True self.__state[CONSTANTS.EXPRESS_STATE.TEMPERATURE] = 0 self.__state[CONSTANTS.EXPRESS_STATE.LIGHT] = 0 self.__state[CONSTANTS.EXPRESS_STATE.MOTION_X] = 0 diff --git a/src/view/components/cpx/CpxImage.tsx b/src/view/components/cpx/CpxImage.tsx index 7163b67c3..48aef4e64 100644 --- a/src/view/components/cpx/CpxImage.tsx +++ b/src/view/components/cpx/CpxImage.tsx @@ -380,7 +380,7 @@ export const updateSwitch = (switchState: boolean): void => { if (switchElement && switchInner) { svg.addClass(switchInner, "sim-slide-switch-inner"); - if (switchState) { + if (!switchState) { svg.addClass(switchInner, "on"); switchInner.setAttribute("transform", "translate(-5,0)"); } else { diff --git a/src/view/components/cpx/CpxSimulator.tsx b/src/view/components/cpx/CpxSimulator.tsx index b0d77f441..2a0ee0c11 100644 --- a/src/view/components/cpx/CpxSimulator.tsx +++ b/src/view/components/cpx/CpxSimulator.tsx @@ -49,7 +49,7 @@ const DEFAULT_CPX_STATE: ICpxState = { [0, 0, 0], ], red_led: false, - switch: false, + switch: true, touch: [false, false, false, false, false, false, false], shake: false, }; From 80bc804a8e2b3a6a355c8194a4fc538b0f33d7b0 Mon Sep 17 00:00:00 2001 From: xnkevinnguyen Date: Mon, 20 Apr 2020 09:28:26 -0700 Subject: [PATCH 2/2] Switch default is false --- src/adafruit_circuitplayground/express.py | 2 +- src/view/components/cpx/CpxSimulator.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adafruit_circuitplayground/express.py b/src/adafruit_circuitplayground/express.py index 84fa68c7e..7f2857508 100644 --- a/src/adafruit_circuitplayground/express.py +++ b/src/adafruit_circuitplayground/express.py @@ -37,7 +37,7 @@ def __init__(self): (0, 0, 0), ] self.__state[CONSTANTS.EXPRESS_STATE.RED_LED] = False - self.__state[CONSTANTS.EXPRESS_STATE.SWITCH] = True + self.__state[CONSTANTS.EXPRESS_STATE.SWITCH] = False self.__state[CONSTANTS.EXPRESS_STATE.TEMPERATURE] = 0 self.__state[CONSTANTS.EXPRESS_STATE.LIGHT] = 0 self.__state[CONSTANTS.EXPRESS_STATE.MOTION_X] = 0 diff --git a/src/view/components/cpx/CpxSimulator.tsx b/src/view/components/cpx/CpxSimulator.tsx index 2a0ee0c11..b0d77f441 100644 --- a/src/view/components/cpx/CpxSimulator.tsx +++ b/src/view/components/cpx/CpxSimulator.tsx @@ -49,7 +49,7 @@ const DEFAULT_CPX_STATE: ICpxState = { [0, 0, 0], ], red_led: false, - switch: true, + switch: false, touch: [false, false, false, false, false, false, false], shake: false, };