Skip to content

Commit

Permalink
Clear inverter/charger input settings when object becomes invalid
Browse files Browse the repository at this point in the history
Otherwise, there are stale objects in the input settings model
when the object becomes valid again -- for example, if changing
the demo mode causes the inverter/charger to be repopulated with
different values.

Fixes #1134
  • Loading branch information
blammit committed May 30, 2024
1 parent 96dbf19 commit f78858e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/common/InverterCharger.qml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ Device {
}
inputSettings.get(inputIndex).inputSettings.setCurrentLimit(currentLimit)
}

onValidChanged: {
if (!valid) {
inverterCharger.inputSettings.clear()
}
}
}

0 comments on commit f78858e

Please sign in to comment.