Config UI: add heating support (#22177)
This commit is contained in:
parent
b6ff1cad92
commit
f3b60644e8
60 changed files with 1399 additions and 486 deletions
|
|
@ -22,8 +22,11 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
typeCustom = "custom" // typeCustom is the custom configuration type
|
||||
typeTemplate = "template" // typeTemplate is the updatable configuration type
|
||||
typeCustom = "custom" // typeCustom is the custom configuration type
|
||||
typeTemplate = "template" // typeTemplate is the updatable configuration type
|
||||
typeHeatpump = "heatpump" // typeHeatpump is the heatpump configuration type
|
||||
typeSwitchSocket = "switchsocket" // typeSwitchSocket is the switch socket configuration type
|
||||
typeSgReady = "sgready" // typeSgReady is the SG-Ready configuration type
|
||||
|
||||
// masked indicates a masked config parameter value
|
||||
masked = "***"
|
||||
|
|
@ -280,6 +283,18 @@ func testInstance(instance any) map[string]testResult {
|
|||
makeResult("phases1p3p", true, nil)
|
||||
}
|
||||
|
||||
if hasFeature(instance, api.Heating) {
|
||||
makeResult("heating", true, nil)
|
||||
}
|
||||
|
||||
if hasFeature(instance, api.IntegratedDevice) {
|
||||
makeResult("integratedDevice", true, nil)
|
||||
}
|
||||
|
||||
if dev, ok := instance.(api.IconDescriber); ok && dev.Icon() != "" {
|
||||
makeResult("icon", dev.Icon(), nil)
|
||||
}
|
||||
|
||||
if cc, ok := instance.(api.PhaseDescriber); ok && cc.Phases() == 1 {
|
||||
makeResult("singlePhase", true, nil)
|
||||
}
|
||||
|
|
@ -338,8 +353,11 @@ func decodeDeviceConfig(r io.Reader) (configReq, error) {
|
|||
return res, nil
|
||||
}
|
||||
|
||||
if !strings.EqualFold(res.Type, typeCustom) {
|
||||
return configReq{}, errors.New("invalid config: yaml only allowed for custom type")
|
||||
if !(strings.EqualFold(res.Type, typeCustom) ||
|
||||
strings.EqualFold(res.Type, typeHeatpump) ||
|
||||
strings.EqualFold(res.Type, typeSwitchSocket) ||
|
||||
strings.EqualFold(res.Type, typeSgReady)) {
|
||||
return configReq{}, errors.New("invalid config: yaml only allowed for custom, heatpump, switchsocket, and sgready types")
|
||||
}
|
||||
|
||||
if len(res.Other) != 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue