Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Changed the rendering of the stock float sensor values
  • Loading branch information
jsiegmund committed Dec 12, 2016
1 parent bd88629 commit 2600d28
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Mobile/MobileApp/scripts/directives/sensor-controller.ts
Expand Up @@ -53,7 +53,7 @@ namespace Submerged.Directives {
result = value.toFixed(2);
break;
case Statics.SENSORTYPES.STOCKFLOAT:
result = value != true ? "LEVEL OK" : "LEVEL LOW";
result = value == 0 ? "LEVEL OK" : "LEVEL LOW";
break;
case Statics.SENSORTYPES.MOISTURE:
result = value != true ? "DRY" : "WET";
Expand All @@ -78,7 +78,7 @@ namespace Submerged.Directives {
case Statics.SENSORTYPES.PH:
return this.calculateSensorClassByThreshold(sensor);
case Statics.SENSORTYPES.STOCKFLOAT:
return this.calculateSensorClassByBool(sensor, false, true);
return this.calculateSensorClassByBool(sensor, false, false);
case Statics.SENSORTYPES.TEMPERATURE:
return this.calculateSensorClassByThreshold(sensor);
default:
Expand All @@ -91,8 +91,10 @@ namespace Submerged.Directives {

if (sensor.reading === undefined || sensor.reading === null)
result = nullIsOk;
else
result = sensor.reading === okState;
else {
var okReading = okState ? 1 : 0;
result = sensor.reading === okReading;
}

if (result)
return "npt-kpigreen";
Expand Down

0 comments on commit 2600d28

Please sign in to comment.