Skip to content

Commit

Permalink
feat: add support for wi-fi signal strength on Daemons
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenSrcerer committed Apr 12, 2024
1 parent cb2731e commit c5c7b2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/kotlin/online/danielstefani/paddy/daemon/Daemon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ open class Daemon() {
constructor(daemon: Daemon) : this() {
this.id = daemon.id
this.user = daemon.user
this.lastRssi = daemon.lastRssi
this.lastPing = daemon.lastPing
}

Expand All @@ -25,6 +26,9 @@ open class Daemon() {

var on: Boolean = false

// Wi-Fi Signal Strength
var lastRssi: Int? = null

var lastPing: Long = 0

var recovery: Boolean = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class MqttController(

daemonRepository.update(daemonId) {
it.recovery = false
it.lastRssi = body?.toInt()
it.lastPing = Instant.now().epochSecond
}

Expand Down

0 comments on commit c5c7b2b

Please sign in to comment.