Fixing #1504: WeDo2: Distance sensor not being cleared on device disconnect.
This commit is contained in:
1 parent
3659973101
commit
f4e9212249
1 file changed
+8
-1
@@ -479,7 +479,14 @@ class WeDo2 {
|
||||
*/
|
||||
// TODO: rename disconnect?
|
||||
disconnectSession () {
|
||||
// window.clearInterval(this._timeoutID);
|
||||
this._ports = ['none', 'none'];
|
||||
this._motors = [null, null];
|
||||
this._sensors = {
|
||||
tiltX: 0,
|
||||
tiltY: 0,
|
||||
distance: 0
|
||||
};
|
||||
|
||||
this._ble.disconnectSession();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user