fredlcore / BSB-LAN

LAN/WiFi interface for Boiler-System-Bus (BSB) and Local Process Bus (LPB) and Punkt-zu-Punkt Schnittstelle (PPS) with a Siemens® controller used by Elco®, Brötje® and similar heating systems
220 stars 83 forks source link

Make uptime in /C more legible #594

Closed DE-cr closed 9 months ago

DE-cr commented 9 months ago

I always need a calculator to convert long ms values to d+h:m:s With this PR in place, I don't: grafik

DE-cr commented 9 months ago

P.s. I forgot to mention: I do consider this ready to be merged into BSB-LAN's master branch. :)

fredlcore commented 9 months ago

Good idea, but please add it in a way that this information is printed in a new line (but without
so that visually, it remains in the same line). Background: People who parse the current Uptime line using regex might catch everything after the colon and therefore wouldn't get a number back. If it's in a new line, this problem would not occur.

DE-cr commented 9 months ago

That would be an overly simple parser. ;)

What do you mean by "(but without so that visually, it remains in the same line)"?

fredlcore commented 9 months ago

Well, that's how I parse the HTML output of BSB-LAN. If it is clear how the rest of the line looks like, why should I create an overly complex regex? That would be a waste of time and resources. What I meant is: Add a crlf at the beginning of the line, but don't add a <BR>.

DE-cr commented 9 months ago

Done, thanks for suggesting this:

</form>
<BR>Hardware: ESP32<BR>
Version: 3.2.2-20230606224119<BR>
Freier Speicher: 215548 Bytes<BR>
Uptime: 78504
ms = 0d+00:01:18.504<BR>
1-Wire Bus Pins: 
0, Sensoren: 0
<BR>
<BR><BR>
Installierte Module: <BR>

This didn't occur to me, as I usually try to layout my html similar to its expected rendering.

As for the regex: I personally wouldn't consider \d+ "overly complex", but safer than .+ (or even .*). ...and it could also be used to parse Freier Speicher: 215548 Bytes<BR>, e.g. ;)

fredlcore commented 9 months ago

Good for you.