Deye 3p hybrid: fix curtailed script for whole-number limits (#33161)

This commit is contained in:
Dennis Klipp 2026-08-25 14:22:45 +02:00 • committed by GitHub
parent e4e5c2db26
commit 022171ffde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -311,8 +311,9 @@ render: |
scale: 10
{{- end }}
script: |
// float64 is required: a whole-number input arrives as an int literal
// round, the watt conversion does not reproduce the written percent exactly
p := int(limit*100/{{ maxf .maxacpower 1 }} + 0.5)
p := int(float64(limit)*100/{{ maxf .maxacpower 1 }} + 0.5)
if p > 100 {
p = 100
}