From 371003bdc41366c3dfc4d8ef82181984c7c24257 Mon Sep 17 00:00:00 2001 From: RaHoni Date: Wed, 21 Apr 2021 13:31:09 +0200 Subject: [PATCH] Fixed a number error of range. --- src/main/scala/PrivateHome/Devices/MQTT/mqttController.scala | 2 +- version.sbt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/PrivateHome/Devices/MQTT/mqttController.scala b/src/main/scala/PrivateHome/Devices/MQTT/mqttController.scala index 077765a..1d053c0 100644 --- a/src/main/scala/PrivateHome/Devices/MQTT/mqttController.scala +++ b/src/main/scala/PrivateHome/Devices/MQTT/mqttController.scala @@ -113,7 +113,7 @@ class mqttController(val masterID: String, _key: Array[Byte], val name: String = val messageJson = parse(messageString) logger.debug("got parsed to {}",messageJson) val pin = (messageJson \ "pin").extract[Int] - val value: Float = (messageJson \ "value").extract[String].toFloat / 1024 + val value: Float = (messageJson \ "value").extract[String].toFloat / 1023 logger.debug("Setting pin {} to {}", pin, value) pins(pin).status = value } diff --git a/version.sbt b/version.sbt index f78cd17..b9ea942 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "0.4.2" +version in ThisBuild := "0.4.4-SNAPSHOT"