reloxx13 / Sonoff-Tasmota-Modified

Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE
GNU General Public License v3.0
26 stars 6 forks source link

Space before text for Temp & Humi by sonoff-sc #4

Closed mike2nl closed 5 years ago

mike2nl commented 5 years ago

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!

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)

reloxx13 commented 5 years ago

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.

mike2nl commented 5 years ago

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.