solar heat assistance, rounding custom entities #2763

This commit is contained in:
MichaelDvP
2025-11-26 18:11:48 +01:00
parent a738cc36dd
commit 084d90e714
4 changed files with 41 additions and 3 deletions

View File

@@ -196,7 +196,7 @@ bool WebCustomEntityService::command_setvalue(const char * value, const int8_t i
if (!Helpers::value2float(value, f)) {
return false;
}
int v = f / entityItem.factor;
int v = (f / entityItem.factor + 0.5);
if (entityItem.value_type == DeviceValueType::UINT8 || entityItem.value_type == DeviceValueType::INT8) {
EMSESP::send_write_request(entityItem.type_id, entityItem.device_id, entityItem.offset, v, 0);
} else if (entityItem.value_type == DeviceValueType::UINT16 || entityItem.value_type == DeviceValueType::INT16) {