diff --git a/tasmota/xdsp_15_tm1637.ino b/tasmota/xdsp_15_tm1637.ino index 08a804ee6..cfdaae3ae 100644 --- a/tasmota/xdsp_15_tm1637.ino +++ b/tasmota/xdsp_15_tm1637.ino @@ -980,14 +980,8 @@ void TM1637ShowTime() uint8_t hr = RtcTime.hour; uint8_t mn = RtcTime.minute; uint8_t sc = RtcTime.second; - // uint8_t hr = 1; - // uint8_t mn = 0; - char z = ' '; - if (TM1637Data.clock_24) - { - z = '0'; - } - else + + if (!TM1637Data.clock_24) { if (hr > 12) hr -= 12; @@ -995,8 +989,13 @@ void TM1637ShowTime() hr = 12; } - char tm[9]; - snprintf_P(tm, sizeof(tm), PSTR("%c%d%02d%02d"), z, hr, mn, sc); + char tm[7]; + snprintf_P(tm, sizeof(tm), PSTR("%02d%02d%02d"), hr, mn, sc); + + if (!TM1637Data.clock_24 && tm[0] == '0') + { + tm[0] = ' '; + } if (TM1637 == TM1637Data.display_type) {