Clone
app/com.example.retroha.network/index
Gitea Bot edited this page 2026-06-14 05:43:57 +00:00

//app/com.example.retroha.network

Package-level declarations

Types

Name Summary
BrightnessRequest [main]
data class BrightnessRequest(val entity_id: String, val brightness: Int)
Request body for setting light brightness.
HaApiService [main]
interface HaApiService
Retrofit interface defining the Home Assistant REST API endpoints.
HaAttributes [main]
data class HaAttributes(val friendly_name: String?, val unit_of_measurement: String?, val brightness: Int? = null)
Data Transfer Object representing entity attributes (metadata).
HaClient [main]
object HaClient
Singleton factory for managing and providing the HaApiService instance. Handles Retrofit initialization, interceptors for authentication, and caching.
HaState [main]
data class HaState(val entity_id: String, val state: String, val attributes: HaAttributes)
Data Transfer Object representing the state of an entity returned by HA.
HaStateAdapter [main]
class HaStateAdapter
Custom GSON TypeAdapter for HaState. Manually parses the Home Assistant state object to handle dynamic attributes and deep nesting while maintaining high performance.
HaWebSocketManager [main]
class HaWebSocketManager(context: <Error class: unknown class>, onStateChanged: (HaState) -> Unit)
Manages a persistent WebSocket connection to Home Assistant. Handles authentication, automatic reconnection, and event subscriptions.
ToggleRequest [main]
data class ToggleRequest(val entity_id: String)
Request body for the toggle service.