From 142f067e7baeeba41e6285c3af644b915533411d Mon Sep 17 00:00:00 2001 From: Theo Arends Date: Sun, 11 Mar 2018 15:46:58 +0100 Subject: [PATCH] v5.12.0e - Add display remaining time to PulseTime 5.12.0e * Add display of remaining pulse time to command PulseTime (#2085) --- sonoff/_releasenotes.ino | 5 +++-- sonoff/i18n.h | 1 + sonoff/sonoff.ino | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sonoff/_releasenotes.ino b/sonoff/_releasenotes.ino index 67f7d8da6159..af9289dbab0c 100644 --- a/sonoff/_releasenotes.ino +++ b/sonoff/_releasenotes.ino @@ -1,8 +1,9 @@ /* 5.12.0e - * Add additional time offset to Wifi Retry based on device mac address (#2089) * Add a second TLS fingerprint to allow switching keys in TLS mode (#2033, #2102) + * Add display of remaining pulse time to command PulseTime (#2085) + * Add additional time offset to Wifi Retry based on device mac address (#2089) + * Add command Color6 RRGGBB for Clock hour marker color and command Rotation pixels for Clock rotation (#2092) * Add HTML language header in local language (#2123) - * Add commands Color6 RRGGBB for Clock marker color and Rotation pixels for Clock rotation (#2092) * * 5.12.0d * Add support for optional MQTT drivers to be selected in user_config.h (#1992) diff --git a/sonoff/i18n.h b/sonoff/i18n.h index 6b724fce9aa0..7508e3bf8a4f 100644 --- a/sonoff/i18n.h +++ b/sonoff/i18n.h @@ -401,6 +401,7 @@ const char S_JSON_COMMAND_INDEX_NVALUE[] PROGMEM = "{\"%s%d\":%d}"; const char S_JSON_COMMAND_INDEX_LVALUE[] PROGMEM = "{\"%s%d\":%lu}"; const char S_JSON_COMMAND_INDEX_SVALUE[] PROGMEM = "{\"%s%d\":\"%s\"}"; const char S_JSON_COMMAND_INDEX_SVALUE_SVALUE[] PROGMEM = "{\"%s%d\":\"%s%s\"}"; +const char S_JSON_COMMAND_INDEX_NVALUE_ACTIVE_NVALUE[] PROGMEM = "{\"%s%d\":\"%d (" D_JSON_ACTIVE " %d)\"}"; const char S_JSON_SENSOR_INDEX_NVALUE[] PROGMEM = "{\"" D_CMND_SENSOR "%d\":%d}"; const char S_JSON_SENSOR_INDEX_SVALUE[] PROGMEM = "{\"" D_CMND_SENSOR "%d\":\"%s\"}"; diff --git a/sonoff/sonoff.ino b/sonoff/sonoff.ino index 5f3ce3ea4358..9ceb02e83765 100644 --- a/sonoff/sonoff.ino +++ b/sonoff/sonoff.ino @@ -513,7 +513,7 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len) Settings.pulse_timer[index -1] = payload16; // 0 - 65535 pulse_timer[index -1] = 0; } - snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_NVALUE, command, index, Settings.pulse_timer[index -1]); + snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_INDEX_NVALUE_ACTIVE_NVALUE, command, index, Settings.pulse_timer[index -1], pulse_timer[index -1]); } else if (CMND_BLINKTIME == command_code) { if ((payload > 2) && (payload <= 3600)) {