Formatting
This commit is contained in:
parent
ba05088342
commit
4a1c1dd1d8
8 changed files with 18 additions and 10 deletions
|
@ -2,6 +2,8 @@ import java.io.FileInputStream
|
|||
import java.util.Properties
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
|
||||
|
||||
val keystoreProperties = Properties ()
|
||||
keystoreProperties . load ( FileInputStream ( rootProject . file ("keystore.properties") ) )
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.kernelmaft.zanbur
|
||||
|
||||
|
||||
|
||||
object AppState {
|
||||
val groups : List <Group> get () = groupsAsMutable
|
||||
private var groupsAsMutable : List <Group> = emptyList ()
|
||||
|
|
|
@ -22,6 +22,7 @@ import androidx.datastore.preferences.core.stringPreferencesKey
|
|||
import androidx.lifecycle.lifecycleScope
|
||||
|
||||
|
||||
|
||||
class MainActivity : ComponentActivity () {
|
||||
override fun onCreate ( savedInstanceState : Bundle ? ) {
|
||||
super . onCreate (savedInstanceState)
|
||||
|
|
|
@ -14,6 +14,7 @@ import mqtt.packets.Qos.AT_MOST_ONCE
|
|||
import mqtt.packets.mqtt.MQTTPublish
|
||||
|
||||
|
||||
|
||||
typealias MqttPublishHandler = ( MQTTPublish , Json ) -> Unit
|
||||
|
||||
object MqttClient {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.kernelmaft.zanbur
|
||||
|
||||
|
||||
|
||||
data class Group (
|
||||
val id : Int ,
|
||||
val name : String ,
|
||||
|
|
|
@ -6,4 +6,5 @@ import androidx.datastore.preferences.core.Preferences
|
|||
import androidx.datastore.preferences.preferencesDataStore
|
||||
|
||||
|
||||
|
||||
val Context. dataStore : DataStore<Preferences> by preferencesDataStore ("state")
|
||||
|
|
|
@ -6,6 +6,7 @@ import kotlinx.serialization.encodeToString
|
|||
import kotlinx.serialization.json.Json
|
||||
|
||||
|
||||
|
||||
fun publishSceneChange ( group : Group , newScene : Scene ) {
|
||||
val topic = Config . MQTT_TOPIC + "/" + group . name + "/set"
|
||||
val packet = Json . encodeToString ( SceneRecallPacket ( newScene . id ) )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue