mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-25 22:20:27 +00:00
Merge branch 'master' into rework-ch341
This commit is contained in:
commit
53e15663e3
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,5 +1,6 @@
|
|||||||
meshtasticd (2.5.19.0) UNRELEASED; urgency=medium
|
meshtasticd (2.5.20.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* Initial packaging
|
* Initial packaging
|
||||||
|
* GitHub Actions Automatic version bump
|
||||||
|
|
||||||
-- Austin Lane <vidplace7@gmail.com> Thu, 02 Jan 2025 12:00:00 +0000
|
-- Austin Lane <github-actions[bot]@users.noreply.github.com> Mon, 13 Jan 2025 19:24:14 +0000
|
||||||
|
@ -222,7 +222,11 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Display "Env. From: ..." on its own
|
// Display "Env. From: ..." on its own
|
||||||
display->drawString(x, y, "Env. From: " + String(lastSender) + "(" + String(agoSecs) + "s)");
|
display->drawString(x, y, "Env. From: " + String(lastSender) + " (" + String(agoSecs) + "s)");
|
||||||
|
|
||||||
|
// Prepare sensor data strings
|
||||||
|
String sensorData[10];
|
||||||
|
int sensorCount = 0;
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.has_temperature ||
|
if (lastMeasurement.variant.environment_metrics.has_temperature ||
|
||||||
lastMeasurement.variant.environment_metrics.has_relative_humidity) {
|
lastMeasurement.variant.environment_metrics.has_relative_humidity) {
|
||||||
@ -232,48 +236,73 @@ void EnvironmentTelemetryModule::drawFrame(OLEDDisplay *display, OLEDDisplayUiSt
|
|||||||
String(UnitConversions::CelsiusToFahrenheit(lastMeasurement.variant.environment_metrics.temperature), 0) + "°F";
|
String(UnitConversions::CelsiusToFahrenheit(lastMeasurement.variant.environment_metrics.temperature), 0) + "°F";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Continue with the remaining details
|
sensorData[sensorCount++] =
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
"Temp/Hum: " + last_temp + " / " + String(lastMeasurement.variant.environment_metrics.relative_humidity, 0) + "%";
|
||||||
"Temp/Hum: " + last_temp + " / " +
|
|
||||||
String(lastMeasurement.variant.environment_metrics.relative_humidity, 0) + "%");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.barometric_pressure != 0) {
|
if (lastMeasurement.variant.environment_metrics.barometric_pressure != 0) {
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
sensorData[sensorCount++] =
|
||||||
"Press: " + String(lastMeasurement.variant.environment_metrics.barometric_pressure, 0) + "hPA");
|
"Press: " + String(lastMeasurement.variant.environment_metrics.barometric_pressure, 0) + "hPA";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.voltage != 0) {
|
if (lastMeasurement.variant.environment_metrics.voltage != 0) {
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
sensorData[sensorCount++] = "Volt/Cur: " + String(lastMeasurement.variant.environment_metrics.voltage, 0) + "V / " +
|
||||||
"Volt/Cur: " + String(lastMeasurement.variant.environment_metrics.voltage, 0) + "V / " +
|
String(lastMeasurement.variant.environment_metrics.current, 0) + "mA";
|
||||||
String(lastMeasurement.variant.environment_metrics.current, 0) + "mA");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.iaq != 0) {
|
if (lastMeasurement.variant.environment_metrics.iaq != 0) {
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL), "IAQ: " + String(lastMeasurement.variant.environment_metrics.iaq));
|
sensorData[sensorCount++] = "IAQ: " + String(lastMeasurement.variant.environment_metrics.iaq);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastMeasurement.variant.environment_metrics.distance != 0) {
|
||||||
|
sensorData[sensorCount++] = "Water Level: " + String(lastMeasurement.variant.environment_metrics.distance, 0) + "mm";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastMeasurement.variant.environment_metrics.weight != 0) {
|
||||||
|
sensorData[sensorCount++] = "Weight: " + String(lastMeasurement.variant.environment_metrics.weight, 0) + "kg";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lastMeasurement.variant.environment_metrics.radiation != 0) {
|
||||||
|
sensorData[sensorCount++] = "Rad: " + String(lastMeasurement.variant.environment_metrics.radiation, 2) + "µR/h";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.lux != 0) {
|
if (lastMeasurement.variant.environment_metrics.lux != 0) {
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
sensorData[sensorCount++] = "Illuminance: " + String(lastMeasurement.variant.environment_metrics.lux, 2) + "lx";
|
||||||
"Illuminance: " + String(lastMeasurement.variant.environment_metrics.lux, 2) + "lx");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.white_lux != 0) {
|
if (lastMeasurement.variant.environment_metrics.white_lux != 0) {
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
sensorData[sensorCount++] = "W_Lux: " + String(lastMeasurement.variant.environment_metrics.white_lux, 2) + "lx";
|
||||||
"W_Lux: " + String(lastMeasurement.variant.environment_metrics.white_lux, 2) + "lx");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.distance != 0)
|
static int scrollOffset = 0;
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
static bool scrollingDown = true;
|
||||||
"Water Level: " + String(lastMeasurement.variant.environment_metrics.distance, 0) + "mm");
|
static uint32_t lastScrollTime = millis();
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.weight != 0)
|
// Draw up to 3 sensor data lines
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
int linesToShow = min(3, sensorCount);
|
||||||
"Weight: " + String(lastMeasurement.variant.environment_metrics.weight, 0) + "kg");
|
for (int i = 0; i < linesToShow; i++) {
|
||||||
|
int index = (scrollOffset + i) % sensorCount;
|
||||||
|
display->drawString(x, y += _fontHeight(FONT_SMALL), sensorData[index]);
|
||||||
|
}
|
||||||
|
|
||||||
if (lastMeasurement.variant.environment_metrics.radiation != 0)
|
// Only scroll if there are more than 3 sensor data lines
|
||||||
display->drawString(x, y += _fontHeight(FONT_SMALL),
|
if (sensorCount > 3) {
|
||||||
"Rad: " + String(lastMeasurement.variant.environment_metrics.radiation, 2) + "µR/h");
|
// Update scroll offset every 5 seconds
|
||||||
|
if (millis() - lastScrollTime > 5000) {
|
||||||
|
if (scrollingDown) {
|
||||||
|
scrollOffset++;
|
||||||
|
if (scrollOffset + linesToShow >= sensorCount) {
|
||||||
|
scrollingDown = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
scrollOffset--;
|
||||||
|
if (scrollOffset <= 0) {
|
||||||
|
scrollingDown = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lastScrollTime = millis();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t)
|
bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_Telemetry *t)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[VERSION]
|
[VERSION]
|
||||||
major = 2
|
major = 2
|
||||||
minor = 5
|
minor = 5
|
||||||
build = 19
|
build = 20
|
||||||
|
Loading…
Reference in New Issue
Block a user