-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix display of current + voltage for single-phase pvinverters #1892
Conversation
55edcf4
to
6fde078
Compare
data/common/PvInverter.qml
Outdated
readonly property real power: _power.isValid ? _power.value : NaN | ||
readonly property real voltage: _voltage.isValid ? _voltage.value : NaN | ||
readonly property real current: _validSinglePhase ? _validSinglePhase.current : NaN | ||
readonly property real voltage: _validSinglePhase ? _validSinglePhase.voltage : NaN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see this data being useful in other multi-phase cases. What if these values could be provided by PhaseModel
instead? E.g. if we had PhaseModel properties like current
and voltage
or overallCurrent
and overallVoltage
and these were only set in the single-phase case (i.e. when there is only one phase with valid voltage/current/power)?
6fde078
to
2fe5693
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment, LGTM
data/common/PvInverter.qml
Outdated
phases.updateCount(index + 1) | ||
} else if (phases.count > index) { | ||
phases.setValue(index, PhaseModel.EnergyRole, NaN) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth adding a function to do this to avoid the duplicated code for the four roles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
0472666
to
a98866a
Compare
The /Ac/Current and /Ac/Voltage paths for pvinverters are deprecated / no longer valid. Instead, determine whether there is a single valid phase available for a given pvinverter, and if so, export that phase's current and voltage as properties. (If multiple valid phases exist, we cannot export valid aggregate values for current or voltage, so return NaN.) Contributes to issue #1883 Contributes to issue #1713 in the case where only a single valid phase exists in the pvinverter device.
a98866a
to
e570f82
Compare
done. merging. |
The /Ac/Current and /Ac/Voltage paths for pvinverters are deprecated / no longer valid.
Instead, determine whether there is a single valid phase available for a given pvinverter, and if so, export that phase's current and voltage as properties.
(If multiple valid phases exist, we cannot export valid aggregate values for current or voltage, so return NaN.)
Contributes to issue #1883
Contributes to issue #1713 in the case where only a single valid phase exists in the pvinverter device.