Skip to content
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

Add solar & wind priority feature #1853

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

DanielMcInnes
Copy link
Contributor

Fixes #1325

@DanielMcInnes DanielMcInnes linked an issue Jan 16, 2025 that may be closed by this pull request
@DanielMcInnes DanielMcInnes marked this pull request as draft January 16, 2025 07:39
@DanielMcInnes DanielMcInnes force-pushed the 1325-add-solar-wind-priority-feature branch 3 times, most recently from 091a19d to 7057aea Compare January 17, 2025 08:19
@DanielMcInnes DanielMcInnes marked this pull request as ready for review January 17, 2025 08:20
@DanielMcInnes DanielMcInnes force-pushed the 1325-add-solar-wind-priority-feature branch from 7057aea to 06fed4b Compare January 17, 2025 08:29

OverviewWidget {
id: root

readonly property string vebusPrefix: BackendConnection.serviceUidFromName(Global.acInputs.highlightedInput.inputInfo.serviceName, Global.acInputs.highlightedInput.inputInfo.deviceInstance)
readonly property bool preferRenewable: preferRenewableEnergy.isValid
Copy link
Contributor Author

@DanielMcInnes DanielMcInnes Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bit different to how we usually do things. 'preferRenewable' is true if the path is valid, regardless of the value at that path, as per gui-v1


OverviewWidget {
id: root

readonly property string vebusPrefix: BackendConnection.serviceUidFromName(Global.acInputs.highlightedInput.inputInfo.serviceName, Global.acInputs.highlightedInput.inputInfo.deviceInstance)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't point to a vebus service if the highlightedInput is provided by e.g. a grid energy meter that's not plugged into VE.Bus.

In gui-v1 this vebusPrefix refers to the "system vebus service" provided by com.victronenergy.system/VebusService, which can be accessed in gui-v2 via Global.system.veBus.serviceUid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks Bea, updated


OverviewWidget {
id: root

readonly property string vebusPrefix: BackendConnection.serviceUidFromName(Global.acInputs.highlightedInput.inputInfo.serviceName, Global.acInputs.highlightedInput.inputInfo.deviceInstance)
readonly property bool preferRenewable: preferRenewableEnergy.isValid
readonly property bool preferRenewableOverride: preferRenewableEnergy.value === 0 || preferRenewableEnergy.value === 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the preferRenewableEnergy.value === 2 part come from? In gui-v1, for the preferRenewableOverride binding, there is only a check for sys.preferRenewableEnergy.value === 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jesus changed this recently, can you run git pull and check please?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see!

fillMode: Image.PreserveAspectFit
color: Theme.color_font_primary
visible: root.preferRenewableOverride
source: root.preferRenewableOverrideGenset ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's nothing after the ? and : operators, can you move them to the start of the next line?

source: root.preferRenewableOverrideGenset 
                    ? "qrc:/images/icon_charging_generator.svg" 
                    : Global.acInputs.activeInSource === VenusOS.AcInputs_InputSource_Shore 
                            ? "qrc:/images/icon_charging_shore.svg" 
                            : "qrc:/images/icon_charging_grid.svg"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@DanielMcInnes DanielMcInnes force-pushed the 1325-add-solar-wind-priority-feature branch from 06fed4b to 3551103 Compare January 24, 2025 04:45
@DanielMcInnes DanielMcInnes merged commit 074ac78 into main Jan 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add solar & wind priority feature
2 participants