From e77fc54358ab6e397cf7291a2047c74c9d1250a1 Mon Sep 17 00:00:00 2001 From: stfnmllr Date: Wed, 4 Jan 2023 22:53:19 +0100 Subject: [PATCH] mqtt-gateway v0.7.1 --- internal/devices/cs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/devices/cs.go b/internal/devices/cs.go index cdbdc1f..8014f68 100644 --- a/internal/devices/cs.go +++ b/internal/devices/cs.go @@ -413,7 +413,11 @@ func (cs *CS) setLocoSpeed(client *client.Client, addr uint, publish bool) gatew func (cs *CS) stopLoco(client *client.Client, addr uint) gateway.HndFn { return func(payload any) (any, error) { - return client.SetLocoSpeed128(addr, 1) + speed, err := client.SetLocoSpeed128(addr, 1) // emergency stop + if err != nil { + return nil, err + } + return speed128(speed).speed127(), nil // speed should be 0 } }