reloxx13 / Sonoff-Tasmota-Modified

Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Space before text for Temp & Humi by sonoff-sc

mike2nl opened this issue · comments

commented

A clear and concise description of what the bug is.

When you take a look at the table for the sensor values and text
for a SOnOff-SC envoirment module you can see a space before the
text for Temperature and Humidity. The rest of the text is ok without
a space character before the text.

Also, make sure these boxes are checked [x] before submitting your issue - Thank you!

  • [x ] Searched the problem in issues and in the wiki
    --> Yes and nothing found ;-)

  • [x ] Hardware used :
    --> SONOFF-SC with an external AM2302 T&H sensor
    Fugure 1:
    sensor external

  • [x ] Provide the output of command status 0 :
    --> NOT needed in this case

To Reproduce
Steps to reproduce the behavior:
->Open the web page for the sonoff-sc module
->Wait 3 or 4 seconds to get the first values
->Cut the network connection
->Goto Inspect the web page (CTRL+SHIFT+I)
->Open the table defines near


->Open the defines
->Take a look at Temperature and Humidity
->You can see a space char before these both text's

Expected behavior
A clear and concise description of what you expected to happen.
No speace char before these both text's

Screenshots
If applicable, add screenshots to help explain your problem.
Figure 2:
sonoff-sc table space in temp and humidity 2nd

It's not really a bug in the meaning but we can save 2 bytes ;-) for the
webserver. And in a place where every byte counts here are two more.

(Please, remember to close the issue when the problem has been addressed)

the sensor name is missing, thats why their is a space

i18n.h line 522 and following
const char HTTP_SNS_TEMP[] PROGMEM = "%s{s}%s " D_TEMPERATURE "{m}%s°%c{e}";

this is generic (used by all sensors), i think writing an if around would use more space than let it as it is, since the space still has to be there for the other sensors.

commented

Ah yes, i see. Did'nt see that line, jesus. You are 100% right and around code
costs more space which we have (not much) on the chip. Very good point. So i will close it.