Skip to content

Conversation

@DanielMcInnes
Copy link
Contributor

Fixes #2556

@DanielMcInnes DanielMcInnes linked an issue Jan 23, 2026 that may be closed by this pull request
@DanielMcInnes DanielMcInnes marked this pull request as draft January 23, 2026 01:06
@DanielMcInnes DanielMcInnes force-pushed the 2556-settings-add-a-sortable-priority-list branch from 401b395 to 366d4a3 Compare January 23, 2026 03:28
@DanielMcInnes DanielMcInnes marked this pull request as ready for review January 23, 2026 03:29

Item {
id: root

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a new JSON file for an opportunityloads service to data/mock/conf/services/ and add the file to data/mock/conf/maximal.json? Then we can easily choose whether to load the service for different configurations.

pageSource: "/pages/settings/PageControllableLoads.qml"

VeQuickItem {
id: _mode
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a more specific id like opportunityLoadsMode in this context?

//% "Limiting the maximum charging power can improve simultaneity with other controllable devices."
text: qsTrId("pagecontrollableloads_limiting_the_maximum")
font.pixelSize: Theme.font_size_tiny
width: 528
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe can be a caption within the ListQuantityField, instead of creating a separate SettingsListHeader?

font.pixelSize: Theme.font_size_body2
wrapMode: Text.Wrap
text: serviceType === "battery"
? "Battery"
Copy link
Contributor

Choose a reason for hiding this comment

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

"Battery" needs translation. Also, it looks like this expression can be simplified to:

text: serviceType === "battery" ? CommonWords.battery : longName || device?.name || uniqueIdentifier || ""


FilteredDeviceModel {
id: acLoadDevices
objectName: "PageControllableLoads.acLoadDevices"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the objectNames from leftover debug?

component Arrow: ListItemButton {
icon.source: "qrc:/images/icon_arrow.svg"
flat: false
height: parent.height - 2 * Theme.geometry_opportunityLoad_margin
Copy link
Contributor

Choose a reason for hiding this comment

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

The button in the design is like this:

Image

but the one here is much wider:

Image

//% "Arrange the controllable devices according to their priority; the control algorithm will control them based on the currently available PV excess."
text: qsTrId("pagecontrollableloads_arrange")
font.pixelSize: Theme.font_size_tiny
width: 528
Copy link
Contributor

Choose a reason for hiding this comment

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

Hardcoded width? Also should the font size is too small, maybe font_size_caption instead?

for (var i = 0; i < opportunityLoadsModel.count; ++i) {
newValue.push(opportunityLoadsModel.get(i))
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Unnecessary newline; also, use let instead of var.

SettingsListHeader {
//% "This helps the BatteryLife algorithm recharge the battery to 100%."
text: qsTrId("pagecontrollableloads_battery_this_supports_the_batterylife_algorithm")
font.pixelSize: Theme.font_size_tiny
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe can be a caption within the ListSwitch, instead of creating a separate SettingsListHeader?

for (var i = 0; jsv && i < jsv.length; ++i) {
const newValue = jsv[i]
if ((opportunityLoadsModel.count < (i + 1)) || (newValue !== opportunityLoadsModel.get(i)))
opportunityLoadsModel.set(i, jsv[i])
Copy link
Contributor

Choose a reason for hiding this comment

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

Style: indent and add braces around this block

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.

Settings: Add a sortable priority list

3 participants