diff --git a/README.md b/README.md
index 0fa4cd5e..f2526e8b 100644
--- a/README.md
+++ b/README.md
@@ -4,9 +4,9 @@ ESPurna ("spark" in Catalan) is a custom firmware for ESP8285/ESP8266 based smar
It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries.
[](CHANGELOG.md)
-[](https://github.org/xoseperez/espurna/tree/mcspr-mqtt-dynamic-pulse/)
-[](https://travis-ci.org/xoseperez/espurna)
-[](https://www.codacy.com/app/xoseperez/espurna/dashboard)
+[](https://github.org/xoseperez/espurna/tree/dev/)
+[](https://travis-ci.org/xoseperez/espurna)
+[](https://www.codacy.com/app/xoseperez/espurna/dashboard)
[](LICENSE)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=xose%2eperez%40gmail%2ecom&lc=US&no_note=0¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest)
diff --git a/code/espurna/relay.ino b/code/espurna/relay.ino
index 5fade454..e5e5788e 100644
--- a/code/espurna/relay.ino
+++ b/code/espurna/relay.ino
@@ -601,9 +601,9 @@ void relaySetupAPI() {
// API entry points (protected with apikey)
for (unsigned int relayID=0; relayID= relayCount()) {
DEBUG_MSG_P(PSTR("[RELAY] Wrong relayID (%d)\n"), id);
return;
}
- unsigned long pulse = 1000 * String(payload).toFloat();
- if (pulse == 0) return;
+ unsigned long pulse = String(payload).toInt();
+ if (0 == pulse) return;
- if (_relays[id].pulse != RELAY_PULSE_NONE) {
+ if (RELAY_PULSE_NONE != _relays[id].pulse) {
DEBUG_MSG_P(PSTR("[RELAY] Overriding relay #%d pulse settings\n"), id);
}
@@ -737,6 +763,7 @@ void relayMQTTCallback(unsigned int type, const char * topic, const char * paylo
relayToggle(id, true, false);
return;
+
}
// magnitude is relay/#