[#432] - Use valve number max value instead of 100 (#434)

Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
This commit is contained in:
Jean-Marc Collin
2024-03-31 20:47:04 +02:00
committed by GitHub
parent c49545d9e3
commit 1595ff32a2
2 changed files with 11 additions and 19 deletions

View File

@@ -861,7 +861,7 @@ class UnderlyingValve(UnderlyingEntity):
min_val = valve_state.attributes["min"]
max_val = valve_state.attributes["max"]
new_value = round(max(min_val, min(value, max_val)))
new_value = round(max(min_val, min(value / 100 * max_val, max_val)))
else:
_LOGGER.debug("%s - no min and max attributes on underlying", self)
new_value = value