Mqtt: log mode errors
This commit is contained in:
parent
14df2855bd
commit
bf5342f8de
1 changed files with 5 additions and 1 deletions
|
|
@ -119,7 +119,11 @@ func (m *MQTT) publish(topic string, retained bool, payload interface{}) {
|
|||
|
||||
func (m *MQTT) listenSetters(topic string, site site.API, lp loadpoint.API) {
|
||||
m.Handler.ListenSetter(topic+"/mode/set", func(payload string) {
|
||||
lp.SetMode(api.ChargeMode(payload))
|
||||
if mode, err := api.ChargeModeString(payload); err == nil {
|
||||
lp.SetMode(mode)
|
||||
} else {
|
||||
m.log.ERROR.Printf("set %s: %v", topic+"/mode", err)
|
||||
}
|
||||
})
|
||||
m.Handler.ListenSetter(topic+"/minSoc/set", func(payload string) {
|
||||
if soc, err := strconv.Atoi(payload); err == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue