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,39 @@
package com.example.retroha.i18n
enum class StringKey {
STATE_ON,
STATE_OFF,
STATE_UNAVAILABLE,
STATE_TOGGLING,
BTN_SETTINGS,
TOAST_WIDGET_ADD,
TAB_ALL,
TAB_LIGHTING,
TAB_SOCKETS,
TAB_POWER,
TAB_WEATHER,
TITLE_SETTINGS,
TITLE_CONNECTION,
TITLE_INSTRUCTIONS,
INSTRUCTION_1,
INSTRUCTION_2,
INSTRUCTION_3,
INSTRUCTION_4,
INSTRUCTION_5,
LABEL_URL,
LABEL_TOKEN,
LABEL_REFRESH,
BTN_TEST_SAVE,
BTN_DELETE_ALL,
BTN_SAVE_SELECTED,
BTN_CHANGE_LANG,
STATUS_CONNECTING,
STATUS_CONNECTED,
STATUS_OFFLINE,
STATUS_ERROR_HA,
STATUS_NO_TOKEN,
CONFIRM_DELETE_ALL,
CONFIRM_CHANGE_CONN,
DIALOG_BRIGHTNESS,
DIALOG_USTAW,
DIALOG_ANULUJ
}

View File

@@ -0,0 +1,4 @@
package com.example.retroha.i18n
interface Strings {
operator fun get(key: StringKey): String
}

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
}

View File

@@ -0,0 +1,28 @@
package com.example.retroha.theme
object Colors {
const val BLACK = 0xFF000000.toInt()
const val WHITE = 0xFFFFFFFF.toInt()
const val RED = 0xFFE23A24.toInt()
const val YELLOW = 0xFFFAD02C.toInt()
const val BLUE = 0xFF0056B3.toInt()
const val ORANGE = 0xFFF4801A.toInt()
const val GREEN = 0xFF2D7D46.toInt()
const val VIOLET = 0xFF6B3FA0.toInt()
const val GRAY_LIGHT = 0xFFCCCCCC.toInt()
const val GRAY_MID = 0xFF888888.toInt()
const val GRAY_DARK = 0xFF444444.toInt()
const val STATUS_ON = YELLOW
const val STATUS_OFF = WHITE
const val STATUS_UNAVAILABLE = GRAY_LIGHT
const val STATUS_TOGGLING = WHITE
const val BORDER_DEFAULT = BLACK
const val BORDER_TOGGLING = BLUE
const val BORDER_UNAVAILABLE = GRAY_MID
const val STRIPE_LIGHT = ORANGE
const val STRIPE_SWITCH = BLUE
const val STRIPE_SENSOR = VIOLET
const val STRIPE_BINARY_SENSOR = VIOLET
const val STRIPE_SCRIPT = RED
const val STRIPE_AUTOMATION = RED
const val STRIPE_DEFAULT = GRAY_DARK
}