Skip to content

Commit

Permalink
Add AC chargers to devices accessible via Inverter/Charger drilldown
Browse files Browse the repository at this point in the history
Fixes #1291
  • Loading branch information
blammit committed Aug 5, 2024
1 parent 8b400be commit 1b64b54
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions components/widgets/InverterChargerWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ OverviewWidget {
onClicked: {
if ((Global.inverterChargers.veBusDevices.count
+ Global.inverterChargers.inverterDevices.count
+ Global.chargers.model.count
+ Global.acSystemDevices.model.count) > 1) {
Global.pageManager.pushPage("/pages/invertercharger/InverterChargerListPage.qml")
} else {
// Show page for chargers
if (Global.chargers.model.count) {
const charger = Global.chargers.model.firstObject
Global.pageManager.pushPage("/pages/settings/devicelist/PageAcCharger.qml",
{ "bindPrefix": charger.serviceUid, "title": charger.name })
return
}

// Show page for acsystem
if (Global.acSystemDevices.model.count) {
const acSystem = Global.acSystemDevices.model.firstObject
Expand Down
8 changes: 8 additions & 0 deletions pages/invertercharger/InverterChargerListPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Page {
sourceModels: [
Global.inverterChargers.veBusDevices,
Global.inverterChargers.inverterDevices,
Global.chargers.model,
Global.acSystemDevices.model
]
}
Expand All @@ -26,6 +27,13 @@ Page {
secondaryText: Global.system.systemStateToText(model.device.state)

onClicked: {
// Show page for chargers
if (model.device.serviceUid.indexOf('charger') >= 0) {
Global.pageManager.pushPage("/pages/settings/devicelist/PageAcCharger.qml",
{ "bindPrefix": model.device.serviceUid, "title": model.device.name })
return
}

// Show page for acsystem
if (model.device.serviceUid.indexOf('acsystem') >= 0) {
Global.pageManager.pushPage("/pages/settings/devicelist/rs/PageRsSystem.qml",
Expand Down

0 comments on commit 1b64b54

Please sign in to comment.