Begun adding support for Powered Up peripherals
This commit is contained in:
parent
a6c2161968
commit
58a4ceb7b1
@ -6,7 +6,7 @@ const Consts = {
|
|||||||
POWERED_UP_HUB: 3
|
POWERED_UP_HUB: 3
|
||||||
},
|
},
|
||||||
Devices: {
|
Devices: {
|
||||||
WEDO2_MOTOR: 1,
|
BASIC_MOTOR: 1,
|
||||||
BOOST_LED: 22,
|
BOOST_LED: 22,
|
||||||
WEDO2_TILT: 34,
|
WEDO2_TILT: 34,
|
||||||
WEDO2_DISTANCE: 35,
|
WEDO2_DISTANCE: 35,
|
||||||
@ -35,7 +35,9 @@ const Consts = {
|
|||||||
BLE: {
|
BLE: {
|
||||||
Name: {
|
Name: {
|
||||||
WEDO2_SMART_HUB_NAME: "LPF2 Smart Hub 2 I/O",
|
WEDO2_SMART_HUB_NAME: "LPF2 Smart Hub 2 I/O",
|
||||||
BOOST_MOVE_HUB_NAME: "LEGO Move Hub"
|
BOOST_MOVE_HUB_NAME: "LEGO Move Hub",
|
||||||
|
POWERED_UP_HUB_NAME: "HUB NO.4",
|
||||||
|
POWERED_UP_REMOTE_NAME: "Handset"
|
||||||
},
|
},
|
||||||
Services: {
|
Services: {
|
||||||
WEDO2_SMART_HUB: "000015231212efde1523785feabcd123",
|
WEDO2_SMART_HUB: "000015231212efde1523785feabcd123",
|
||||||
|
6
hub.js
6
hub.js
@ -114,10 +114,10 @@ class Hub extends EventEmitter {
|
|||||||
this._activatePortDevice(port.value, port.type, 0x00, 0x00);
|
this._activatePortDevice(port.value, port.type, 0x00, 0x00);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Consts.Devices.WEDO2_MOTOR:
|
case Consts.Devices.BASIC_MOTOR:
|
||||||
{
|
{
|
||||||
port.type = Consts.Devices.WEDO2_MOTOR;
|
port.type = Consts.Devices.BASIC_MOTOR;
|
||||||
debug(`Port ${port.id} connected, detected WEDO2_MOTOR`);
|
debug(`Port ${port.id} connected, detected BASIC_MOTOR`);
|
||||||
this._activatePortDevice(port.value, port.type, 0x02, 0x00);
|
this._activatePortDevice(port.value, port.type, 0x02, 0x00);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user