Skip to content

Commit

Permalink
Use 0..1 range
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Jan 12, 2025
1 parent 12027dc commit 632db68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions meter/rct.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func NewRCT(uri, usage string, minSoc, maxSoc int, cache time.Duration, capacity
return err
}

return m.conn.Write(rct.PowerMngSocMin, m.floatVal(float32(minSoc)))
return m.conn.Write(rct.PowerMngSocMin, m.floatVal(float32(minSoc)/100))

case api.BatteryHold:
if err := m.conn.Write(rct.PowerMngSocStrategy, []byte{rct.SOCTargetInternal}); err != nil {
Expand All @@ -131,14 +131,14 @@ func NewRCT(uri, usage string, minSoc, maxSoc int, cache time.Duration, capacity
return err
}

return m.conn.Write(rct.PowerMngSocMin, m.floatVal(float32(soc)))
return m.conn.Write(rct.PowerMngSocMin, m.floatVal(float32(soc)/100))

case api.BatteryCharge:
if err := m.conn.Write(rct.PowerMngSocStrategy, []byte{rct.SOCTargetExternal}); err != nil {
return err
}

return m.conn.Write(rct.PowerMngSocTargetSet, m.floatVal(float32(maxSoc)))
return m.conn.Write(rct.PowerMngSocTargetSet, m.floatVal(float32(maxSoc)/100))

default:
return api.ErrNotAvailable
Expand Down

0 comments on commit 632db68

Please sign in to comment.