Fixed Mario initializer, Technic and Mindstorms angular motors
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Nathan Kellenicki 2021-04-05 21:08:37 -07:00
parent a3f66d5df0
commit 08489819ec
5 changed files with 4389 additions and 578 deletions

4943
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "node-poweredup",
"version": "6.9.1",
"version": "6.10.0",
"description": "A Javascript module to interface with LEGO Powered Up components.",
"homepage": "https://github.com/nathankellenicki/node-poweredup/",
"main": "dist/node/index-node.js",
@ -18,22 +18,22 @@
"author": "Nathan Kellenicki <nathan@kellenicki.com>",
"license": "MIT",
"dependencies": {
"@abandonware/noble": "1.9.2-13",
"compare-versions": "^3.6.0",
"debug": "^4.3.1",
"@abandonware/noble": "1.9.2-10"
"debug": "^4.3.1"
},
"devDependencies": {
"@types/debug": "4.1.5",
"@types/node": "^14.14.14",
"@types/node": "^14.14.37",
"@types/web-bluetooth": "0.0.9",
"buffer": "^6.0.3",
"ink-docstrap": "^1.3.2",
"jsdoc": "^3.6.6",
"jsdoc-to-markdown": "^6.0.1",
"ts-loader": "^8.0.12",
"jsdoc-to-markdown": "^7.0.1",
"ts-loader": "^8.1.0",
"tslint": "^6.1.3",
"typescript": "^4.1.3",
"webpack": "^5.11.0",
"webpack-cli": "^4.2.0"
"typescript": "^4.2.3",
"webpack": "^5.30.0",
"webpack-cli": "^4.6.0"
}
}

View File

@ -88,7 +88,7 @@ export enum DeviceType {
MARIO_ACCELEROMETER = 71,
MARIO_BARCODE_SENSOR = 73,
MARIO_PANTS_SENSOR = 74,
TECHNIC_MEDIUM_ANGULAR_MOTOR_GREY = 75, // Technic Control+
TECHNIC_MEDIUM_ANGULAR_MOTOR_GREY = 75, // Mindstorms
TECHNIC_LARGE_ANGULAR_MOTOR_GREY = 76, // Technic Control+
}

View File

@ -423,6 +423,8 @@ export class BaseHub extends EventEmitter {
[Consts.DeviceType.MARIO_ACCELEROMETER]: MarioAccelerometer,
[Consts.DeviceType.MARIO_BARCODE_SENSOR]: MarioBarcodeSensor,
[Consts.DeviceType.MARIO_PANTS_SENSOR]: MarioPantsSensor,
[Consts.DeviceType.TECHNIC_MEDIUM_ANGULAR_MOTOR_GREY]: TechnicMediumAngularMotor,
[Consts.DeviceType.TECHNIC_LARGE_ANGULAR_MOTOR_GREY]: TechnicLargeAngularMotor,
};
constructor = deviceConstructors[deviceType as Consts.DeviceType];

View File

@ -32,7 +32,7 @@ export class Mario extends LPF2Hub {
}
constructor (device: IBLEAbstraction) {
super(device, PortMap, Consts.HubType.MOVE_HUB);
super(device, PortMap, Consts.HubType.MARIO);
debug("Discovered Mario");
}