aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt2
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt12
2 files changed, 13 insertions, 1 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt
index 7b66bd3..9a9f85c 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/UnitRenderData.kt
@@ -148,7 +148,7 @@ class UnitRenderData {
}
/* Hourmeter */
- position.attributes["hours"]?.longOrNull?.let {
+ unit.getHourmeter()?.let {
if (it > 0) {
details.add(
Triple(
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt
new file mode 100644
index 0000000..bacdb40
--- /dev/null
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt
@@ -0,0 +1,12 @@
+package mx.trackermap.TrackerMap.controllers
+
+import mx.trackermap.TrackerMap.client.apis.CommandsApi
+import mx.trackermap.TrackerMap.client.models.Command
+
+class CommandsController(
+ private val commandsApi: CommandsApi
+) {
+ suspend fun fetchCommands(deviceId: Int): List<Command> {
+ return commandsApi.commandsGet(deviceId = deviceId).toList()
+ }
+} \ No newline at end of file