mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Fixing linting errors.
This commit is contained in:
parent
b1976d6fec
commit
190f4b5796
2 changed files with 6 additions and 8 deletions
|
@ -187,7 +187,7 @@ class EV3 {
|
|||
}
|
||||
|
||||
get distance () {
|
||||
if (!this.connected) return;
|
||||
if (!this.connected) return 0;
|
||||
|
||||
// https://shop.lego.com/en-US/EV3-Ultrasonic-Sensor-45504
|
||||
// Measures distances between one and 250 cm (one to 100 in.)
|
||||
|
@ -199,19 +199,18 @@ class EV3 {
|
|||
}
|
||||
|
||||
get brightness () {
|
||||
if (!this.connected) return;
|
||||
if (!this.connected) return 0;
|
||||
|
||||
return this._sensors.brightness;
|
||||
}
|
||||
|
||||
getMotorPosition (port) {
|
||||
if (!this.connected) return;
|
||||
|
||||
return this._motorPositions[port];
|
||||
// TODO: read motor position data
|
||||
log.info(`return motor ${args} position`);
|
||||
}
|
||||
|
||||
isButtonPressed (args) {
|
||||
isButtonPressed (/* args */) {
|
||||
if (!this.connected) return;
|
||||
|
||||
return this._sensors.button;
|
||||
|
@ -545,7 +544,6 @@ class EV3 {
|
|||
if (this._sensorPorts.length === 0) {
|
||||
// SENSOR LIST
|
||||
// JAABAAIefn5+fn5+fn5+fn5+fn5+Bwd+fn5+fn5+fn5+fn5+fgA=
|
||||
// [36, 0, 1, 0, 2, 30, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 7, 7, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 0]
|
||||
log.info(`device array: ${array}`);
|
||||
this._sensorPorts[0] = EV_DEVICE_TYPES[array[5]];
|
||||
this._sensorPorts[1] = EV_DEVICE_TYPES[array[6]];
|
||||
|
@ -563,7 +561,7 @@ class EV3 {
|
|||
// TODO: window?
|
||||
this._pollingIntervalID = window.setInterval(this._getSessionData.bind(this), 100);
|
||||
} else {
|
||||
//log.info(`received compound command result: ${array}`);
|
||||
// log.info(`received compound command result: ${array}`);
|
||||
let offset = 5;
|
||||
for (let i = 0; i < this._sensorPorts.length; i++) {
|
||||
if (this._sensorPorts[i] !== 'none') {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const JSONRPC = require('./jsonrpc');
|
||||
const log = require('../util/log');
|
||||
// const log = require('../util/log');
|
||||
|
||||
class JSONRPCWebSocket extends JSONRPC {
|
||||
constructor (webSocket) {
|
||||
|
|
Loading…
Reference in a new issue