mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
satisfy linter
This commit is contained in:
parent
deab7dd209
commit
a0cccba3be
1 changed files with 22 additions and 26 deletions
|
@ -3,9 +3,7 @@ const BlockType = require('../../extension-support/block-type');
|
|||
const log = require('../../util/log');
|
||||
// const cast = require('../../util/cast');
|
||||
const formatMessage = require('format-message');
|
||||
const BLE = require('../../io/ble');
|
||||
const Base64Util = require('../../util/base64-util');
|
||||
//const ScratchLinkProxy = require('./scratch-link-proxy');
|
||||
// const ScratchLinkProxy = require('./scratch-link-proxy');
|
||||
const createDevice = require('@vernier/godirect').default.createDevice;
|
||||
|
||||
/**
|
||||
|
@ -56,10 +54,10 @@ class GdxFor {
|
|||
force: 0,
|
||||
accelerationX: 0,
|
||||
accelerationY: 0,
|
||||
accelerationX: 0,
|
||||
accelerationZ: 0,
|
||||
angularVelocityX: 0,
|
||||
angularVelocityY: 0,
|
||||
angularVelocityX: 0,
|
||||
angularVelocityZ: 0
|
||||
};
|
||||
|
||||
this.disconnect = this.disconnect.bind(this);
|
||||
|
@ -78,11 +76,10 @@ class GdxFor {
|
|||
}
|
||||
|
||||
navigator.bluetooth.requestDevice({
|
||||
filters: [{ namePrefix: 'GDX' }],
|
||||
filters: [{namePrefix: 'GDX'}],
|
||||
optionalServices: ['d91714ef-28b9-4f91-ba16-f0d9a604f112']
|
||||
}).then((bleWbtDevice) => {
|
||||
return createDevice(bleWbtDevice, {open: false});
|
||||
}).then((device) => {
|
||||
}).then(bleWbtDevice => createDevice(bleWbtDevice, {open: false}))
|
||||
.then(device => {
|
||||
this._ble = device;
|
||||
this._ble.open(false); // false prevents starting of measurements
|
||||
this._ble.on('device-opened', this._onConnect);
|
||||
|
@ -133,11 +130,11 @@ class GdxFor {
|
|||
sensor.setEnabled(true);
|
||||
|
||||
// do some calculations here?
|
||||
sensor.on('value-changed', (sensor) => {
|
||||
sensor.on('value-changed', changedSensor => {
|
||||
|
||||
// We don't need this list, essentially.
|
||||
if (sensor.values.length > 1000) {
|
||||
sensor.clear();
|
||||
if (changedSensor.values.length > 1000) {
|
||||
changedSensor.clear();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -379,7 +376,7 @@ class Scratch3GdxForBlocks {
|
|||
],
|
||||
menus: {
|
||||
directionOptions: this.DIRECTIONS_MENU,
|
||||
compareOptions: this.COMPARE_MENU,
|
||||
compareOptions: this.COMPARE_MENU
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -394,7 +391,6 @@ class Scratch3GdxForBlocks {
|
|||
return Promise.resolve();
|
||||
}
|
||||
getAcceleration (args) {
|
||||
console.log(args);
|
||||
switch (args.DIRECTION) {
|
||||
case 'x':
|
||||
return this._peripheral.getAccelerationX();
|
||||
|
|
Loading…
Reference in a new issue