Skip to content

Commit

Permalink
Rename thresholds to temperature thresholds, fix value variable mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
user890104 committed Oct 23, 2024
1 parent 86a0a6b commit da033ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widgets/SensorReading/SensorReading.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const units = {
battery: '%',
};

const thresholds = [18, 24, 26, 32];
const temperatureThresholds = [18, 24, 26, 32];

const SensorReading = ({
label,
Expand All @@ -30,7 +30,7 @@ const SensorReading = ({
).map(([type, value]) => [type, {
...value,
dt: new Date(value.timestamp),
thermometerState: type === 'temperature' ? thresholds.filter(threshold => threshold < value).length : 0,
thermometerState: type === 'temperature' ? temperatureThresholds.filter(threshold => threshold < value.value).length : 0,
unit: units[type],
}]).map(([type, value]) => [type, {
...value,
Expand Down

0 comments on commit da033ad

Please sign in to comment.