File tree Expand file tree Collapse file tree
data/src/main/java/com/github/umercodez/sensorspot/data/sensorpublisher
ui/src/main/java/com/github/umercodez/sensorspot/ui/screens/sensors/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ class SensorPublisher(
8585
8686 private fun getTopic (mqttConfig : MqttConfig , sensorType : String ) : String {
8787 return if (mqttConfig.dedicatedTopics){
88- " ${mqttConfig.topic} /${sensorType.split(' .' ).last()} "
88+ " ${mqttConfig.topic} /${ if ( sensorType.contains( " . " )) sensorType. split(' .' ).last() else sensorType } "
8989 } else {
9090 mqttConfig.topic
9191 }
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ fun SensorItem(
7070 headlineContent = { Text (text = sensor.name) },
7171 supportingContent = {
7272 val subText = if (dedicatedTopics) {
73- " topic = ${mqttTopic} /${sensor.stringType.split(' .' ).last()} "
73+ " topic = ${mqttTopic} /${ if ( sensor.stringType.contains( " . " )) sensor.stringType. split(' .' ).last() else sensor.stringType } "
7474 } else {
7575 " type = ${sensor.stringType} "
7676 }
You can’t perform that action at this time.
0 commit comments