Skip to content

Commit

Permalink
Merge pull request #127 from SpartanWorks/fixbits
Browse files Browse the repository at this point in the history
A bunch of small fixes accumulated over time.
  • Loading branch information
Idorobots authored Jan 6, 2024
2 parents 79c0c1b + 78c99b6 commit b136b6e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ jobs:
name: test-results
path: agent/target/test-reports/

- name: Build an Uberjar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./agent
run: sbt assembly

- name: Build a Docker image
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
9 changes: 7 additions & 2 deletions agent/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,16 @@ lazy val root = project
dockerEntrypoint := Seq("/opt/docker/bin/spartan-sensor-mesh", "/opt/docker/data/agent_config.json"),
dockerExposedPorts ++= Seq(8080),

// GraalVM packaging:
// Uberjar
assembly / mainClass := Some("ssm.Main"),
assembly / assemblyJarName := s"${packageName.value}_3-${version.value}.jar",
graalVMNativeImageGraalVersion := Some("22.3.1"),
assemblyMergeStrategy := {
case PathList(ps @ _*) if ps.last.endsWith("module-info.class") => MergeStrategy.first
case x => (assemblyMergeStrategy).value(x)
},

// GraalVM packaging:
graalVMNativeImageGraalVersion := Some("22.3.1"),
graalVMNativeImageOptions ++= Seq(
"--no-fallback",
"--static",
Expand Down
1 change: 1 addition & 0 deletions agent/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ssm {
logRequests = false

dataPath = "./data"
dataPath = ${?REST_DATA_PATH}
}

mdns {
Expand Down
4 changes: 2 additions & 2 deletions device/src/sensors/SDS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ SDS* SDS::create(JSONVar &config) {
JSONVar cfg = readings[i]["widget"];

if (type == "pm10") {
sds->pm10 = new Reading<float>(name, "SDS", type, new WindowedValue<float>(window, "μg/m³", 0, 1000), cfg);
sds->pm10 = new Reading<float>(name, "SDS", type, new WindowedValue<float>(window, "μg/m³", 0, 2000), cfg);
} else if (type == "pm2.5") {
sds->pm25 = new Reading<float>(name, "SDS", type, new WindowedValue<float>(window, "μg/m³", 0, 1000), cfg);
sds->pm25 = new Reading<float>(name, "SDS", type, new WindowedValue<float>(window, "μg/m³", 0, 2000), cfg);
}
}

Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/components/gauge/tiered.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as preact from "preact";
import { ColorGauge, ColorBand } from "./color";
import { ColorBand, ColorGauge } from "./color";

function identifyTier(value: number, tiers: ColorBand[], defaultTier: ColorBand): ColorBand {
const needle = tiers.find((tier) => (tier.min <= value && tier.max > value));
Expand Down

0 comments on commit b136b6e

Please sign in to comment.