Include shutter tilt config in discovery message

This commit is contained in:
Erik 2022-05-13 12:28:48 +02:00
parent 614a899dd3
commit be446e10e3
2 changed files with 24 additions and 0 deletions

View File

@ -209,6 +209,18 @@ void TasDiscoverMessage(void) {
}
ResponseAppend_P(PSTR("]," // Shutter Options (end)
"\"sht\":[")); // Shutter Tilt (start)
for (uint32_t i = 0; i < MAX_SHUTTERS; i++) {
#ifdef USE_SHUTTER
ResponseAppend_P(PSTR("%s[%d,%d,%d]"), (i > 0 ? "," : ""),
Settings->shutter_tilt_config[0][i],
Settings->shutter_tilt_config[1][i],
Settings->shutter_tilt_config[2][i]);
#else
ResponseAppend_P(PSTR("%s[0,0,0]"), (i > 0 ? "," : ""));
#endif // USE_SHUTTER
}
ResponseAppend_P(PSTR("]," // Shutter Tilt (end)
"\"ver\":1}")); // Discovery version
}

View File

@ -376,6 +376,18 @@ void HassDiscoverMessage(void) {
}
ResponseAppend_P(PSTR("]," // Shutter Options (end)
"\"sht\":[")); // Shutter Tilt (start)
for (uint32_t i = 0; i < MAX_SHUTTERS; i++) {
#ifdef USE_SHUTTER
ResponseAppend_P(PSTR("%s[%d,%d,%d]"), (i > 0 ? "," : ""),
Settings->shutter_tilt_config[0][i],
Settings->shutter_tilt_config[1][i],
Settings->shutter_tilt_config[2][i]);
#else
ResponseAppend_P(PSTR("%s[0,0,0]"), (i > 0 ? "," : ""));
#endif // USE_SHUTTER
}
ResponseAppend_P(PSTR("]," // Shutter Tilt (end)
"\"ver\":1}")); // Discovery version
}