diff --git a/README.md b/README.md
index 0da43101b..5fd02e91c 100644
--- a/README.md
+++ b/README.md
@@ -61,7 +61,6 @@ The following dependencies are required to install before launching Device Simul
You will be prompted to install the Python dependencies during the first use.
- _**[Visual Studio Code](https://code.visualstudio.com/)**_
-- _**[Node](https://nodejs.org/en/download/)**_
- _**[Python 3.7+](https://www.python.org/downloads/)**_: Make sure you've added Python and pip to your PATH in your environment variables. (1)
- _**[Python VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)**_: This will be installed automatically from the marketplace when you install Device Simulator Express.
diff --git a/src/base_circuitpython/displayio/group.py b/src/base_circuitpython/displayio/group.py
index c5dccf90a..5acc1f2a8 100644
--- a/src/base_circuitpython/displayio/group.py
+++ b/src/base_circuitpython/displayio/group.py
@@ -3,7 +3,7 @@
from PIL import Image
import adafruit_display_text
-from .tile_grid import TileGrid
+from displayio.tile_grid import TileGrid
from . import constants as CONSTANTS
import common
diff --git a/src/base_circuitpython/displayio/test/test_group.py b/src/base_circuitpython/displayio/test/test_group.py
index 4d943ffc8..3e4b3601e 100644
--- a/src/base_circuitpython/displayio/test/test_group.py
+++ b/src/base_circuitpython/displayio/test/test_group.py
@@ -7,10 +7,10 @@
from common import utils
-from ..tile_grid import TileGrid
-from ..group import Group
-from ..palette import Palette
-from ..bitmap import Bitmap
+from displayio.tile_grid import TileGrid
+from displayio.group import Group
+from displayio.palette import Palette
+from displayio.bitmap import Bitmap
from .. import constants as CONSTANTS
from PIL import Image
diff --git a/src/debug_user_code.py b/src/debug_user_code.py
index 8be4792fb..a1ad6cb16 100644
--- a/src/debug_user_code.py
+++ b/src/debug_user_code.py
@@ -32,12 +32,12 @@
# Insert absolute path to Circuitpython libraries for CLUE into sys.path
sys.path.insert(0, os.path.join(abs_path_to_parent_dir, CONSTANTS.CIRCUITPYTHON))
-# get board so we can get terminal handle
-import board
-
# This import must happen after the sys.path is modified
from common import debugger_communication_client
+# get board so we can get terminal handle
+import board
+
# get handle to terminal for clue
curr_terminal = board.DISPLAY.terminal
diff --git a/src/debuggerCommunicationServer.ts b/src/debuggerCommunicationServer.ts
index 86a4aeef2..0fa4a65cc 100644
--- a/src/debuggerCommunicationServer.ts
+++ b/src/debuggerCommunicationServer.ts
@@ -5,6 +5,7 @@ import * as http from "http";
import * as socketio from "socket.io";
import { WebviewPanel } from "vscode";
import { SERVER_INFO } from "./constants";
+import { DeviceSelectionService } from "./service/deviceSelectionService";
export const DEBUGGER_MESSAGES = {
EMITTER: {
@@ -24,14 +25,14 @@ export class DebuggerCommunicationServer {
private serverHttp: http.Server;
private serverIo: socketio.Server;
private simulatorWebview: WebviewPanel | undefined;
- private currentActiveDevice;
+ private deviceSelectionService: DeviceSelectionService;
private isPendingResponse = false;
private pendingCallbacks: Function[] = [];
constructor(
webviewPanel: WebviewPanel | undefined,
port = SERVER_INFO.DEFAULT_SERVER_PORT,
- currentActiveDevice: string
+ deviceSelectionService: DeviceSelectionService
) {
this.port = port;
this.serverHttp = new http.Server();
@@ -42,7 +43,7 @@ export class DebuggerCommunicationServer {
this.initEventsHandlers();
console.info(`Server running on port ${this.port}`);
- this.currentActiveDevice = currentActiveDevice;
+ this.deviceSelectionService = deviceSelectionService;
}
// send the message to start closing the connection
@@ -119,12 +120,16 @@ export class DebuggerCommunicationServer {
try {
const messageToWebview = JSON.parse(data);
if (messageToWebview.type === "state") {
- console.log(`State recieved: ${messageToWebview.data}`);
- if (this.simulatorWebview) {
+ const messageState = JSON.parse(messageToWebview.data);
+ if (
+ this.simulatorWebview &&
+ messageState.device_name ===
+ this.deviceSelectionService.getCurrentActiveDevice()
+ ) {
this.simulatorWebview.webview.postMessage({
- active_device: this.currentActiveDevice,
+ active_device: this.deviceSelectionService.getCurrentActiveDevice(),
command: "set-state",
- state: JSON.parse(messageToWebview.data),
+ state: messageState,
});
}
}
diff --git a/src/extension.ts b/src/extension.ts
index b733129f0..74e2bf1bf 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -947,7 +947,7 @@ export async function activate(context: vscode.ExtensionContext) {
new DebuggerCommunicationServer(
currentPanel,
utils.getServerPortConfig(),
- deviceSelectionService.getCurrentActiveDevice()
+ deviceSelectionService
)
);
diff --git a/src/latest_release_note.ts b/src/latest_release_note.ts
index 3d9971054..ed9357870 100644
--- a/src/latest_release_note.ts
+++ b/src/latest_release_note.ts
@@ -5,8 +5,7 @@ export const LATEST_RELEASE_NOTE = `
Device Simulator Express Release Notes
-📝 April 21, 2020
-
+📝 April 22, 2020
Changes:
- Increased precision for certain sensors on the CLUE and CPX.
diff --git a/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap b/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap
index 40de21d57..dce8f43ff 100644
--- a/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap
+++ b/src/view/components/clue/__snapshots__/Clue.spec.tsx.snap
@@ -1248,9 +1248,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Push Button
-
Created with Sketch.
@@ -1315,9 +1312,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- neon_pixel
-
Created with Sketch.
@@ -1418,9 +1412,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Temperature Sensor
-
-
- Light sensor
-
-
- GPIO
-
Created with Sketch.
@@ -2109,9 +2094,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Sound Sensor
-
Created with Sketch.
@@ -2185,9 +2167,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Speaker
-
Created with Sketch.
diff --git a/src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap b/src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap
index 3a41b60f6..960f9b501 100644
--- a/src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap
+++ b/src/view/components/cpx/__snapshots__/Cpx.spec.tsx.snap
@@ -3968,9 +3968,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Switch
-
Created with Sketch.
@@ -4035,9 +4032,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Push Button
-
Created with Sketch.
@@ -4102,9 +4096,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Red LED
-
Created with Sketch.
@@ -4167,9 +4158,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Sound Sensor
-
Created with Sketch.
@@ -4243,9 +4231,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Temperature Sensor
-
-
- Light sensor
-
-
- neon_pixel
-
Created with Sketch.
@@ -4480,9 +4459,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Speaker
-
Created with Sketch.
@@ -4602,9 +4578,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- IR
-
Created with Sketch.
@@ -4662,9 +4635,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- GPIO
-
Created with Sketch.
diff --git a/src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap b/src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap
index 1ab115851..9e167bbca 100644
--- a/src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap
+++ b/src/view/components/microbit/__snapshots__/Microbit.spec.tsx.snap
@@ -2669,9 +2669,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Push Button
-
Created with Sketch.
@@ -2736,9 +2733,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Red LED
-
Created with Sketch.
@@ -2801,9 +2795,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Temperature Sensor
-
-
- Light sensor
-
-
- GPIO
-
Created with Sketch.
@@ -3164,9 +3149,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Speaker
-
Created with Sketch.
@@ -3224,9 +3206,6 @@ Array [
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Bluetooth and Radio
-
-
- Light sensor
-
-
- Push Button
-
Created with Sketch.
@@ -2738,9 +2735,6 @@ exports[`Device component should render correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Red LED
-
Created with Sketch.
@@ -2803,9 +2797,6 @@ exports[`Device component should render correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Temperature Sensor
-
-
- Light sensor
-
-
- GPIO
-
Created with Sketch.
@@ -3166,9 +3151,6 @@ exports[`Device component should render correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Speaker
-
Created with Sketch.
@@ -3226,9 +3208,6 @@ exports[`Device component should render correctly 1`] = `
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
-
- Bluetooth and Radio
-
- GPIO
Created with Sketch.
- IR
Created with Sketch.
- {TOOLBAR_ICON_LABEL.LIGHT}
-
- neon_pixel
Created with Sketch.
- {TOOLBAR_ICON_LABEL.PUSH_BUTTON}
Created with Sketch.
- {TOOLBAR_ICON_LABEL.RED_LED}
Created with Sketch.
- {TOOLBAR_ICON_LABEL.SWITCH}
Created with Sketch.
- {TOOLBAR_ICON_LABEL.SOUND}
Created with Sketch.
- {TOOLBAR_ICON_LABEL.SPEAKER}
Created with Sketch.
- {TOOLBAR_ICON_LABEL.TEMPERATURE}
-
- {TOOLBAR_ICON_LABEL.WIRELESS}
-