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