Mqtt: add limitEnergy (#11974)
This commit is contained in:
parent
df1fcd47a7
commit
e39e3b168d
1 changed files with 9 additions and 0 deletions
|
|
@ -272,6 +272,15 @@ func (m *MQTT) listenLoadpointSetters(topic string, site site.API, lp loadpoint.
|
|||
return err
|
||||
})
|
||||
}
|
||||
if err == nil {
|
||||
err = m.Handler.ListenSetter(topic+"/limitEnergy", func(payload string) error {
|
||||
energy, err := strconv.ParseFloat(payload, 64)
|
||||
if err == nil {
|
||||
lp.SetLimitEnergy(energy)
|
||||
}
|
||||
return err
|
||||
})
|
||||
}
|
||||
if err == nil {
|
||||
err = m.Handler.ListenSetter(topic+"/planEnergy", func(payload string) error {
|
||||
var plan struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue