Initial commit

This commit is contained in:
Krzysztof Cieślik
2026-06-13 21:43:53 +02:00
commit 22a3e0fe7e
80 changed files with 4175 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
package com.example.retroha.model
enum class EntityState { ON, OFF, UNAVAILABLE, TOGGLING }

View File

@@ -0,0 +1,11 @@
package com.example.retroha.model
data class WidgetConfig(
val id: Long,
val entityId: String,
val label: String,
val value: String,
val secondary: String,
val domain: String,
val state: EntityState,
val brightness: Int? = null
)

View File

@@ -0,0 +1,15 @@
package com.example.retroha.model
enum class WidgetInteraction { TOGGLE, EXECUTE, READ_ONLY }
fun String.toWidgetInteraction(): WidgetInteraction = when (this) {
"light",
"switch",
"fan",
"input_boolean",
"automation",
"lock" -> WidgetInteraction.TOGGLE
"script",
"scene",
"button",
"input_button" -> WidgetInteraction.EXECUTE
else -> WidgetInteraction.READ_ONLY
}