Config UI: add heating support (#22177)
This commit is contained in:
parent
b6ff1cad92
commit
f3b60644e8
60 changed files with 1399 additions and 486 deletions
|
|
@ -86,7 +86,7 @@ export default defineComponent({
|
|||
},
|
||||
});
|
||||
|
||||
export function customTemplateOption(name: string) {
|
||||
return { template: "custom", name };
|
||||
export function customTemplateOption(name: string, template = "custom") {
|
||||
return { name, template };
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@ export const timeout = 15000;
|
|||
export enum ConfigType {
|
||||
Template = "template",
|
||||
Custom = "custom",
|
||||
Heatpump = "heatpump",
|
||||
SwitchSocket = "switchsocket",
|
||||
SgReady = "sgready",
|
||||
SgReadyBoost = "sgready-boost",
|
||||
}
|
||||
|
||||
export function applyDefaultsFromTemplate(template: Template | null, values: DeviceValues) {
|
||||
|
|
@ -68,6 +72,18 @@ export function applyDefaultsFromTemplate(template: Template | null, values: Dev
|
|||
});
|
||||
}
|
||||
|
||||
export function customChargerName(type: ConfigType, isHeating: boolean) {
|
||||
if (!type) {
|
||||
return "config.general.customOption";
|
||||
}
|
||||
const prefix = "config.charger.type.";
|
||||
const suffix = isHeating ? ".heating" : ".charging";
|
||||
if (type === ConfigType.Custom) {
|
||||
return `${prefix}custom${suffix}`;
|
||||
}
|
||||
return `${prefix}${type}`;
|
||||
}
|
||||
|
||||
export function createDeviceUtils(deviceType: DeviceType) {
|
||||
function test(id: number | undefined, data: any) {
|
||||
let url = `config/test/${deviceType}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue