|
|
@ -631,11 +631,11 @@ void relaySetupAPI() { |
|
|
|
snprintf_P(key, sizeof(key), PSTR("%s/%d"), MQTT_TOPIC_PULSE, relayID); |
|
|
|
apiRegister(key, |
|
|
|
[relayID](char * buffer, size_t len) { |
|
|
|
snprintf_P(buffer, len, PSTR("%lu"), _relays[relayID].pulse_ms); |
|
|
|
dtostrf((double) _relays[relayID].pulse_ms / 1000, 1-len, 3, buffer); |
|
|
|
}, |
|
|
|
[relayID](const char * payload) { |
|
|
|
|
|
|
|
unsigned long pulse = String(payload).toInt(); |
|
|
|
unsigned long pulse = 1000 * String(payload).toFloat(); |
|
|
|
if (0 == pulse) return; |
|
|
|
|
|
|
|
if (RELAY_PULSE_NONE != _relays[relayID].pulse) { |
|
|
@ -751,7 +751,7 @@ void relayMQTTCallback(unsigned int type, const char * topic, const char * paylo |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
unsigned long pulse = String(payload).toInt(); |
|
|
|
unsigned long pulse = 1000 * String(payload).toFloat(); |
|
|
|
if (0 == pulse) return; |
|
|
|
|
|
|
|
if (RELAY_PULSE_NONE != _relays[id].pulse) { |
|
|
|