feat: Add Status Message module support (#4163)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-01-25 08:15:47 -06:00 committed by GitHub
parent df592d4d86
commit 355d2260e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1195 additions and 9 deletions

File diff suppressed because it is too large Load diff

View file

@ -91,8 +91,9 @@ import org.meshtastic.core.database.entity.TracerouteNodePositionEntity
AutoMigration(from = 30, to = 31),
AutoMigration(from = 31, to = 32),
AutoMigration(from = 32, to = 33),
AutoMigration(from = 33, to = 34),
],
version = 33,
version = 34,
exportSchema = true,
)
@TypeConverters(Converters::class)

View file

@ -62,6 +62,7 @@ data class NodeWithRelations(
paxcounter = paxcounter,
notes = notes,
manuallyVerified = manuallyVerified,
nodeStatus = nodeStatus,
)
}
@ -85,6 +86,7 @@ data class NodeWithRelations(
paxcounter = paxcounter,
notes = notes,
manuallyVerified = manuallyVerified,
nodeStatus = nodeStatus,
)
}
}
@ -139,6 +141,7 @@ data class NodeEntity(
@ColumnInfo(name = "notes", defaultValue = "") var notes: String = "",
@ColumnInfo(name = "manually_verified", defaultValue = "0")
var manuallyVerified: Boolean = false, // ONLY set true when scanned/imported manually
@ColumnInfo(name = "node_status") var nodeStatus: String? = null,
) {
val deviceMetrics: TelemetryProtos.DeviceMetrics
get() = deviceTelemetry.deviceMetrics
@ -194,6 +197,7 @@ data class NodeEntity(
paxcounter = paxcounter,
publicKey = publicKey ?: user.publicKey,
notes = notes,
nodeStatus = nodeStatus,
)
fun toNodeInfo() = NodeInfo(

View file

@ -55,6 +55,7 @@ data class Node(
val publicKey: ByteString? = null,
val notes: String = "",
val manuallyVerified: Boolean = false,
val nodeStatus: String? = null,
) {
val capabilities: Capabilities by lazy { Capabilities(metadata?.firmwareVersion) }

View file

@ -90,10 +90,11 @@ data class DataPacket(
/** If this is a text message, return the string, otherwise null */
val text: String?
get() =
if (dataType == Portnums.PortNum.TEXT_MESSAGE_APP_VALUE) {
bytes?.decodeToString()
} else {
null
when (dataType) {
Portnums.PortNum.TEXT_MESSAGE_APP_VALUE -> bytes?.decodeToString()
// Portnums.PortNum.NODE_STATUS_APP_VALUE ->
// MeshProtos.StatusMessage.parseFrom(bytes).status
else -> null
}
val alert: String?

View file

@ -141,6 +141,8 @@ object SettingsRoutes {
@Serializable data object Paxcounter : Route
@Serializable data object StatusMessage : Route
// endregion
// region advanced config routes

View file

@ -659,6 +659,9 @@
<string name="subnet">Subnet</string>
<string name="paxcounter_config">Paxcounter Config</string>
<string name="paxcounter_enabled">Paxcounter enabled</string>
<string name="status_message">Status Message</string>
<string name="status_message_config">Status Message Config</string>
<string name="node_status_summary">The actual status string</string>
<string name="wifi_rssi_threshold_defaults_to_80">WiFi RSSI threshold (defaults to -80)</string>
<string name="ble_rssi_threshold_defaults_to_80">BLE RSSI threshold (defaults to -80)</string>
<string name="position_config">Position</string>