From 57647318c46c66cd44c600b3c9430f6c3371728d Mon Sep 17 00:00:00 2001 From: Michal Moskal Date: Fri, 27 Oct 2017 19:18:56 +0100 Subject: [PATCH] Sensor fixes --- libs/core/input.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/core/input.ts b/libs/core/input.ts index 386b0238..fa901452 100644 --- a/libs/core/input.ts +++ b/libs/core/input.ts @@ -119,7 +119,8 @@ namespace input.internal { si.sensor = null } if (si.devType != DAL.DEVICE_TYPE_NONE) { - si.sensor = si.sensors.filter(s => s._deviceType() == si.devType)[0] || null + // TODO figure out compiler problem when '|| null' is added here! + si.sensor = si.sensors.filter(s => s._deviceType() == si.devType)[0] if (si.sensor == null) { control.dmesg(`sensor not found for type=${si.devType} at ${si.port}`) } else { @@ -139,6 +140,7 @@ namespace input.internal { control.panic(120) this.port = port_ - 1 init() + sensorInfos[this.port].sensors.push(this) } _activated() { }