Skip to content

Commit

Permalink
Had to revert setting time and timeprogs to using _ again for URL-c…
Browse files Browse the repository at this point in the history
…ommands. MQTT should still be able to use spaces.
  • Loading branch information
fredlcore committed Dec 9, 2024
1 parent 08c3e35 commit 6780ca2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
16 changes: 14 additions & 2 deletions BSB_LAN/BSB_LAN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3222,14 +3222,22 @@ int set(float line // the ProgNr of the heater parameter
}
break;
case VT_DATETIME:
if (sscanf(val, "%d.%d.%d %d:%d:%d", &d, &m, &y, &hour, &min, &sec) != 6) {
{
int ret = 0;
if (strchr(val, '_')) {
ret = sscanf(val, "%d.%d.%d_%d:%d:%d", &d, &m, &y, &hour, &min, &sec);
} else {
ret = sscanf(val, "%d.%d.%d %d:%d:%d", &d, &m, &y, &hour, &min, &sec);
}
if (ret != 6) {
decodedTelegram.error = 262;
error_msg = "date/time!";
} else {
// Send to the PC hardware serial interface (DEBUG)
printFmtToDebug("date time: %d.%d.%d %d:%d:%d\r\n", d, m, y, hour, min, sec);
date_flag = 0x00;
}
}
break;
}
if(decodedTelegram.error == 262){
Expand Down Expand Up @@ -3269,7 +3277,11 @@ int set(float line // the ProgNr of the heater parameter
int h1s=0x80,m1s=0x00,h2s=0x80,m2s=0x00,h3s=0x80,m3s=0x00;
int h1e=0x80,m1e=0x00,h2e=0x80,m2e=0x00,h3e=0x80,m3e=0x00;
int ret;
ret=sscanf(val,"%d:%d-%d:%d_%d:%d-%d:%d_%d:%d-%d:%d",&h1s,&m1s,&h1e,&m1e,&h2s,&m2s,&h2e,&m2e,&h3s,&m3s,&h3e,&m3e);
if (strchr(val, '_')) {
ret=sscanf(val,"%d:%d-%d:%d_%d:%d-%d:%d_%d:%d-%d:%d",&h1s,&m1s,&h1e,&m1e,&h2s,&m2s,&h2e,&m2e,&h3s,&m3s,&h3e,&m3e);
} else {
ret=sscanf(val,"%d:%d-%d:%d %d:%d-%d:%d %d:%d-%d:%d",&h1s,&m1s,&h1e,&m1e,&h2s,&m2s,&h2e,&m2e,&h3s,&m3s,&h3e,&m3e);
}
// we need at least the first period
if (ret<4) { // BEGIN hour/minute and END hour/minute
return 0;
Expand Down
4 changes: 2 additions & 2 deletions BSB_LAN/html_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ const char header_html[] =
"</head><body>";
const char header_html2[] =
"<script>function set(p,d){" NEWLINE
"var v=document.getElementById('value'+p+'-'+d).value.replace(/\\.$/,'');" NEWLINE
// ".replaceAll(' ','_')" NEWLINE
"var v=document.getElementById('value'+p+'-'+d).value.replace(/\\.$/,'')" NEWLINE
".replaceAll(' ','_');" NEWLINE
// ".replace('---','');" NEWLINE
"window.open(document.getElementById('main_link').href+'S'+p+'!'+d+'='+v,'_self')" NEWLINE
"}" NEWLINE
Expand Down
1 change: 0 additions & 1 deletion docs/EN/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
- Added state_class for non cumulative sensors in MQTT auto-discovery
- Updated the room unit emulation in `custom_functions` to work with version 4.x.
- Bugfix for VT_ENERGY, added new data type VT_ENERGY10 and VT_ENERGY10_N
- Setting the time as well as time programs no longer requires underscores, instead, spaces are used. Underscores will still work for now, but are deprecated and will be removed at some later time.
- Disabling parameters can now be done both with an empty value as well as by sending `---`. Sending an empty value is still possible, but is depracated and will be removed at some later time.
- BSB-LAN now scans the BSB/LPB bus during startup (and later periodically, if not connected to heating system) for other devices on the bus. This significantly reduces access times later on for systems with more than one device on the bus.
- French and German translations of the manual added, special thanks to GitHub user @plauwers for this!
Expand Down

0 comments on commit 6780ca2

Please sign in to comment.