Curtailment: distribute limits to all devices by percent (#31390)
This commit is contained in:
parent
949daf4670
commit
eea55d282d
22 changed files with 147 additions and 131 deletions
|
|
@ -19,7 +19,7 @@ func handleCurtailFlag(cmd *cobra.Command, v any) bool {
|
|||
}
|
||||
|
||||
if vv, ok := api.Cap[api.Curtailer](v); ok {
|
||||
if err := vv.Curtail(val > 0); err != nil {
|
||||
if err := vv.SetCurtailPercent(val); err != nil {
|
||||
log.ERROR.Println("curtail:", err)
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ const (
|
|||
flagDiagnoseDescription = "Diagnose"
|
||||
|
||||
flagCurtail = "curtail"
|
||||
flagCurtailDescription = "Curtail (0/1 to switch, only available if supported by device)"
|
||||
flagCurtailDescription = "Curtail feed-in to percent (0-100, only available if supported by device)"
|
||||
|
||||
flagDim = "dim"
|
||||
flagDimDescription = "Dim (0/1 to switch, only available if supported by device)"
|
||||
|
|
|
|||
|
|
@ -369,12 +369,12 @@ func runRoot(cmd *cobra.Command, args []string) {
|
|||
YamlSource: yamlSource.hems,
|
||||
Status: struct {
|
||||
Dimmed *bool `json:"dimmed,omitempty"`
|
||||
Curtailed *bool `json:"curtailed,omitempty"`
|
||||
Curtailed *int `json:"curtailed,omitempty"`
|
||||
MaxConsumptionPower float64 `json:"maxConsumptionPower,omitempty"`
|
||||
MaxProductionPower *float64 `json:"maxProductionPower,omitempty"`
|
||||
}{
|
||||
Dimmed: hemsInstance.Dimmed(),
|
||||
Curtailed: hemsInstance.Curtailed(),
|
||||
Curtailed: hemsInstance.CurtailedPercent(),
|
||||
MaxConsumptionPower: hemsInstance.MaxConsumptionPower(),
|
||||
MaxProductionPower: hemsInstance.MaxProductionPower(),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue