This commit is contained in:
thelsing 2020-06-23 00:21:00 +02:00 committed by GitHub
parent d3788d3ee4
commit 5855f35eef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -416,11 +416,11 @@ int busValueToUnsigned8(const uint8_t* payload, size_t payload_length, const Dpt
switch (datatype.subGroup) switch (datatype.subGroup)
{ {
case 1: case 1:
value = (uint8_t)(unsigned8FromPayload(payload, 0) * 100.0 / 255.0); value = (uint8_t)round(unsigned8FromPayload(payload, 0) * 100.0 / 255.0);
return true; return true;
case 3: case 3:
value = (uint8_t)unsigned8FromPayload(payload, 0) * 360.0 / 255.0; value = (uint8_t)round(unsigned8FromPayload(payload, 0) * 360.0 / 255.0);
return true; return true;
case 6: case 6: