From 47bfa9802c015886f438494827f3fc9b993f1972 Mon Sep 17 00:00:00 2001 From: Swordsteel Date: Sat, 30 Nov 2024 20:40:51 +0100 Subject: [PATCH] add Mapper.kt with Node.Response.toDeviceResponse --- src/main/kotlin/ltd/hlaeja/util/Mapper.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/main/kotlin/ltd/hlaeja/util/Mapper.kt diff --git a/src/main/kotlin/ltd/hlaeja/util/Mapper.kt b/src/main/kotlin/ltd/hlaeja/util/Mapper.kt new file mode 100644 index 0000000..fbfce5e --- /dev/null +++ b/src/main/kotlin/ltd/hlaeja/util/Mapper.kt @@ -0,0 +1,10 @@ +package ltd.hlaeja.util + +import ltd.hlaeja.library.deviceConfiguration.Node + +fun Node.Response.toDeviceResponse(): Map { + return mapOf( + "version" to timestamp.toEpochSecond().toString(), + "data" to configuration + ) +}