Fixing #1504: WeDo2: Distance sensor not being cleared on device disconnect.

This commit is contained in:
Evelyn Eastmond 2018-08-21 11:18:58 -04:00
parent 3659973101
commit f4e9212249

View file

@ -479,7 +479,14 @@ class WeDo2 {
*/ */
// TODO: rename disconnect? // TODO: rename disconnect?
disconnectSession () { disconnectSession () {
// window.clearInterval(this._timeoutID); this._ports = ['none', 'none'];
this._motors = [null, null];
this._sensors = {
tiltX: 0,
tiltY: 0,
distance: 0
};
this._ble.disconnectSession(); this._ble.disconnectSession();
} }