Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,47 @@
]
}
]
},
{
"type": "group",
"label": {
"en": "Show/hide phases"
},
"children": [
{
"id": "show_phase_current_L1",
"type": "checkbox",
"label": {
"en": "Show current phase 1"
},
"value": true,
"hint": {
"en": "Show phase 1 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
},
{
"id": "show_phase_current_L2",
"type": "checkbox",
"label": {
"en": "Show current phase 2"
},
"value": true,
"hint": {
"en": "Show phase 2 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
},
{
"id": "show_phase_current_L3",
"type": "checkbox",
"label": {
"en": "Show current phase 3"
},
"value": true,
"hint": {
"en": "Show phase 3 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
}
]
}
],
"id": "pulse"
Expand Down Expand Up @@ -1673,6 +1714,47 @@
]
}
]
},
{
"type": "group",
"label": {
"en": "Show/hide phases"
},
"children": [
{
"id": "show_phase_current_L1",
"type": "checkbox",
"label": {
"en": "Show current phase 1"
},
"value": true,
"hint": {
"en": "Show phase 1 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
},
{
"id": "show_phase_current_L2",
"type": "checkbox",
"label": {
"en": "Show current phase 2"
},
"value": true,
"hint": {
"en": "Show phase 2 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
},
{
"id": "show_phase_current_L3",
"type": "checkbox",
"label": {
"en": "Show current phase 3"
},
"value": true,
"hint": {
"en": "Show phase 3 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
}
]
}
],
"id": "watty"
Expand Down
22 changes: 22 additions & 0 deletions drivers/pulse/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,28 @@ class PulseDevice extends Device {
this.#area = newSettings.pulse_area;
this.#cachedNordPoolPrice = null;
}
// Handle phase current visibility settings
const phases = ['L1', 'L2', 'L3'];
for (const phase of phases) {
const settingKey = `show_phase_current_${phase}`;
if (changedKeys.includes(settingKey)) {
this.log(`Updated show phase current ${phase} value: `, Boolean(newSettings[settingKey]));
const showPhase = Boolean(newSettings[settingKey]);

if (showPhase) {
this.log(`Adding measure_current.${phase} capability to dashboard`);
await this.setCapabilityOptions(`measure_current.${phase}`, {
uiComponent: 'sensor'
});
} else {
this.log(`Removing measure_current.${phase} capability from dashboard`);
await this.setCapabilityOptions(`measure_current.${phase}`, {
uiComponent: 'none'
});
}

}
}
}

async #subscribeToLive() {
Expand Down
41 changes: 41 additions & 0 deletions drivers/pulse/driver.compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,47 @@
]
}
]
},
{
"type": "group",
"label": {
"en": "Show/hide phases"
},
"children": [
{
"id": "show_phase_current_L1",
"type": "checkbox",
"label": {
"en": "Show current phase 1"
},
"value": true,
"hint": {
"en": "Show phase 1 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
},
{
"id": "show_phase_current_L2",
"type": "checkbox",
"label": {
"en": "Show current phase 2"
},
"value": true,
"hint": {
"en": "Show phase 2 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
},
{
"id": "show_phase_current_L3",
"type": "checkbox",
"label": {
"en": "Show current phase 3"
},
"value": true,
"hint": {
"en": "Show phase 3 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
}
]
}
]
}
22 changes: 22 additions & 0 deletions drivers/watty/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,28 @@ class WattyDevice extends Device {
this.#area = newSettings.pulse_area;
this.#cachedNordPoolPrice = null;
}
// Handle phase current visibility settings
const phases = ['L1', 'L2', 'L3'];
for (const phase of phases) {
const settingKey = `show_phase_current_${phase}`;
if (changedKeys.includes(settingKey)) {
this.log(`Updated show phase current ${phase} value: `, Boolean(newSettings[settingKey]));
const showPhase = Boolean(newSettings[settingKey]);

if (showPhase) {
this.log(`Adding measure_current.${phase} capability to dashboard`);
await this.setCapabilityOptions(`measure_current.${phase}`, {
uiComponent: 'sensor'
});
} else {
this.log(`Removing measure_current.${phase} capability from dashboard`);
await this.setCapabilityOptions(`measure_current.${phase}`, {
uiComponent: 'none'
});
}

}
}
}

async #subscribeToLive() {
Expand Down
43 changes: 42 additions & 1 deletion drivers/watty/driver.compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,48 @@
}
]
}
]
]
},
{
"type": "group",
"label": {
"en": "Show/hide phases"
},
"children": [
{
"id": "show_phase_current_L1",
"type": "checkbox",
"label": {
"en": "Show current phase 1"
},
"value": true,
"hint": {
"en": "Show phase 1 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
},
{
"id": "show_phase_current_L2",
"type": "checkbox",
"label": {
"en": "Show current phase 2"
},
"value": true,
"hint": {
"en": "Show phase 2 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
},
{
"id": "show_phase_current_L3",
"type": "checkbox",
"label": {
"en": "Show current phase 3"
},
"value": true,
"hint": {
"en": "Show phase 3 current\nDisable to hide value from dashboard\n\nRemoves relevant flow cards and tokens\nDefault: true"
}
}
]
}
]
}