Skip to content

Commit

Permalink
patch: fix wrong overrides being called
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenSrcerer committed Mar 23, 2024
1 parent 6d3bece commit 042e241
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class DaemonService(
schedules.map { mqtt.publish(it.id!!.toString()) }
.let { Flowable.concat(it) }
// Also turn the device off
.concatWith(mqtt.publish(daemonId, "off", qos = MqttQos.EXACTLY_ONCE))
.concatWith(mqtt.publish(daemonId, action = "off", qos = MqttQos.EXACTLY_ONCE))
.subscribe()

// Delete the daemon itself
Expand All @@ -67,7 +67,7 @@ class DaemonService(
daemonRepository.update(daemonId)
{ it.on = !it.on } ?: return false

mqtt.publish(daemonId, "toggle", qos = MqttQos.EXACTLY_ONCE)
mqtt.publish(daemonId, action = "toggle", qos = MqttQos.EXACTLY_ONCE)
?.subscribe()

return true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MqttController(
it.lastPing = Instant.now().epochSecond
}

mqtt.publish(daemonId, if (on) "on" else "off", qos = MqttQos.EXACTLY_ONCE)
mqtt.publish(daemonId, action = if (on) "on" else "off", qos = MqttQos.EXACTLY_ONCE)
?.subscribe()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class RxMqttClient(
// the application being loaded first, which can lead to publishes
// being lost. This needs to be checked at some point.
// So far it seems that it's not the case, but just to be sure.
fun publish(
private fun publish(
topic: String,
message: String,
qos: MqttQos
Expand Down

0 comments on commit 042e241

Please sign in to comment.