diff --git a/boostmovehub.ts b/boostmovehub.ts index d967622..8b8525f 100644 --- a/boostmovehub.ts +++ b/boostmovehub.ts @@ -114,6 +114,9 @@ export class BoostMoveHub extends LPF2Hub { */ public setMotorAngle (port: string, angle: number, speed: number = 100) { const portObj = this._ports[port]; + if (!(portObj.type === Consts.Devices.BOOST_INTERACTIVE_MOTOR || portObj.type === Consts.Devices.BOOST_MOVE_HUB_MOTOR)) { + throw new Error("Angle rotation is only available when using a Boost Interactive Motor or Boost Move Hub Motor"); + } return new Promise((resolve, reject) => { portObj.busy = true; const data = Buffer.from([0x0e, 0x00, 0x81, portObj.value, 0x11, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0x7f, 0x03]); diff --git a/puphub.ts b/puphub.ts index a16afac..5c43dca 100644 --- a/puphub.ts +++ b/puphub.ts @@ -36,8 +36,7 @@ export class PUPHub extends LPF2Hub { this.type = Consts.Hubs.POWERED_UP_HUB; this._ports = { "A": new Port("A", 0), - "B": new Port("B", 1), - "AB": new Port("AB", 57) + "B": new Port("B", 1) }; debug("Discovered Powered Up Hub"); }