Merge branch 'master' of github.com:nathankellenicki/node-poweredup

This commit is contained in:
Nathan Kellenicki 2022-01-18 17:34:57 -08:00
commit e6c575a0da

View File

@ -131,10 +131,10 @@ export class ColorDistanceSensor extends Device {
const partial = message[7]; const partial = message[7];
if (partial > 0) { if (partial > 0) {
distance += 1.0 / partial; distance = 1.0 / partial;
} }
distance = Math.floor(distance * 25.4) - 20; distance = Math.floor(distance * 25.4);
/** /**
* A combined color and distance event, emits when the sensor is activated. * A combined color and distance event, emits when the sensor is activated.