Skip to content

Commit

Permalink
Fix interleaving delay for current Fritzbox firmware
Browse files Browse the repository at this point in the history
The unit is now separate from the value, so a plain number without the
suffix "ms" should also be considered for parsing.
  • Loading branch information
janh committed Oct 10, 2023
1 parent 2d1a71f commit 3a20e97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fritzbox/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,10 @@ func interpretStatsFloatValues(values map[string][2]string, key string) (downstr
func interpetStatsInterleavingDelay(val string) (out models.ValueMilliseconds) {
if val == "fast" || val == "< 1" {
out.FloatValue.Valid = true
} else if strings.HasSuffix(val, "ms") {
val = strings.TrimSpace(val[0 : len(val)-2])
} else {
if strings.HasSuffix(val, "ms") {
val = strings.TrimSpace(val[0 : len(val)-2])
}
if valFloat, err := strconv.ParseFloat(val, 64); err == nil {
out.FloatValue.Float = valFloat
out.FloatValue.Valid = true
Expand Down

0 comments on commit 3a20e97

Please sign in to comment.