Loadpoint: cleanup phase configuration and drop deprecations (#18638)

This commit is contained in:
andig 2025-02-09 09:12:55 +01:00 • committed by GitHub
parent f93ceffa6d
commit 07fb01d28c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 183 additions and 188 deletions

View file

@ -166,7 +166,7 @@ func (s *HTTPd) RegisterSiteHandlers(site site.API, valueChan chan<- util.Param)
"limitenergy": {"POST", "/limitenergy/{value:[0-9.]+}", floatHandler(pass(lp.SetLimitEnergy), lp.GetLimitEnergy)},
"mincurrent": {"POST", "/mincurrent/{value:[0-9.]+}", floatHandler(lp.SetMinCurrent, lp.GetMinCurrent)},
"maxcurrent": {"POST", "/maxcurrent/{value:[0-9.]+}", floatHandler(lp.SetMaxCurrent, lp.GetMaxCurrent)},
"phases": {"POST", "/phases/{value:[0-9]+}", intHandler(lp.SetPhases, lp.GetPhases)},
"phases": {"POST", "/phases/{value:[0-9]+}", intHandler(lp.SetPhasesConfigured, lp.GetPhasesConfigured)},
"plan": {"GET", "/plan", planHandler(lp)},
"staticPlanPreview": {"GET", "/plan/static/preview/{type:(?:soc|energy)}/{value:[0-9.]+}/{time:[0-9TZ:.+-]+}", staticPlanPreviewHandler(lp)},
"repeatingPlanPreview": {"GET", "/plan/repeating/preview/{soc:[0-9]+}/{weekdays:[0-6,]+}/{time:[0-2][0-9]:[0-5][0-9]}/{tz:[a-zA-Z0-9_./:-]+}", repeatingPlanPreviewHandler(lp)},

View file

@ -28,19 +28,19 @@ func getLoadpointStaticConfig(lp loadpoint.API) loadpoint.StaticConfig {
func getLoadpointDynamicConfig(lp loadpoint.API) loadpoint.DynamicConfig {
planTime, planEnergy := lp.GetPlanEnergy()
return loadpoint.DynamicConfig{
Title: lp.GetTitle(),
DefaultMode: string(lp.GetDefaultMode()),
Priority: lp.GetPriority(),
Phases: lp.GetPhases(),
MinCurrent: lp.GetMinCurrent(),
MaxCurrent: lp.GetMaxCurrent(),
SmartCostLimit: lp.GetSmartCostLimit(),
Thresholds: lp.GetThresholds(),
Soc: lp.GetSocConfig(),
PlanEnergy: planEnergy,
PlanTime: planTime,
LimitEnergy: lp.GetLimitEnergy(),
LimitSoc: lp.GetLimitSoc(),
Title: lp.GetTitle(),
DefaultMode: string(lp.GetDefaultMode()),
Priority: lp.GetPriority(),
PhasesConfigured: lp.GetPhasesConfigured(),
MinCurrent: lp.GetMinCurrent(),
MaxCurrent: lp.GetMaxCurrent(),
SmartCostLimit: lp.GetSmartCostLimit(),
Thresholds: lp.GetThresholds(),
Soc: lp.GetSocConfig(),
PlanEnergy: planEnergy,
PlanTime: planTime,
LimitEnergy: lp.GetLimitEnergy(),
LimitSoc: lp.GetLimitSoc(),
}
}

View file

@ -201,7 +201,7 @@ func (m *MQTT) listenSiteSetters(topic string, site site.API) error {
func (m *MQTT) listenLoadpointSetters(topic string, site site.API, lp loadpoint.API) error {
for _, s := range []setter{
{"mode", setterFunc(api.ChargeModeString, pass(lp.SetMode))},
{"phases", intSetter(lp.SetPhases)},
{"phases", intSetter(lp.SetPhasesConfigured)},
{"limitSoc", intSetter(pass(lp.SetLimitSoc))},
{"priority", intSetter(pass(lp.SetPriority))},
{"minCurrent", floatSetter(lp.SetMinCurrent)},