Skip to content

Commit

Permalink
Update WallPanelService.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniomika authored Aug 17, 2023
1 parent fd06275 commit 31641bf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ class WallPanelService : LifecycleService(), MQTTModule.MQTTListener {

private fun getSensorDiscoveryDef(displayName: String, stateTopic: String, deviceClass: String?, unit: String?, sensorId: String): JSONObject {
val discoveryDef = JSONObject()
discoveryDef.put("name", "${configuration.mqttDiscoveryDeviceName} ${displayName}")
discoveryDef.put("name", "${displayName}")
discoveryDef.put("state_topic", "${configuration.mqttBaseTopic}${stateTopic}")
if (unit != null) {
discoveryDef.put("unit_of_measurement", unit)
Expand All @@ -828,7 +828,7 @@ class WallPanelService : LifecycleService(), MQTTModule.MQTTListener {

private fun getBinarySensorDiscoveryDef(displayName: String, stateTopic: String, fieldName: String, deviceClass: String, sensorId: String): JSONObject {
val discoveryDef = JSONObject()
discoveryDef.put("name", "${configuration.mqttDiscoveryDeviceName} ${displayName}")
discoveryDef.put("name", "${displayName}")
discoveryDef.put("state_topic", "${configuration.mqttBaseTopic}${stateTopic}")
discoveryDef.put("payload_on", true)
discoveryDef.put("payload_off", false)
Expand Down Expand Up @@ -1082,4 +1082,4 @@ class WallPanelService : LifecycleService(), MQTTModule.MQTTListener {
const val BROADCAST_SCREEN_BRIGHTNESS_CHANGE = "BROADCAST_SCREEN_BRIGHTNESS_CHANGE"
const val BROADCAST_CONNTED = "BROADCAST_SCREEN_BRIGHTNESS_CHANGE"
}
}
}

0 comments on commit 31641bf

Please sign in to comment.