al;low empty entries in led remap (#1789)

* test

* some verification

* ha disc?
This commit is contained in:
openshwprojects
2025-09-06 10:30:11 +02:00
committed by GitHub
parent 78ce33f01f
commit f68c6ac9f2
8 changed files with 101 additions and 28 deletions

View File

@ -230,15 +230,6 @@ int http_fn_index(http_request_t* request) {
if (DRV_IsRunning("SM16703P")) {
bForceShowRGB = true;
}
else
#endif
#if ENABLE_LED_BASIC
if (LED_IsLedDriverChipRunning()) {
bForceShowRGBCW = true;
}
#else
{
}
#endif
}
http_setup(request, httpMimeTypeHTML); //Add mimetype regardless of the request
@ -670,7 +661,8 @@ int http_fn_index(http_request_t* request) {
}
#endif
#if ENABLE_LED_BASIC
if (bRawPWMs == 0 || bForceShowRGBCW || bForceShowRGB || bForceShowSingleDimmer) {
if (bRawPWMs == 0 || bForceShowRGBCW || bForceShowRGB
|| bForceShowSingleDimmer || LED_IsLedDriverChipRunning()) {
int c_pwms;
int lm;
int c_realPwms = 0;
@ -683,6 +675,9 @@ int http_fn_index(http_request_t* request) {
// into high power 3-outputs single colors LED controller
PIN_get_Relay_PWM_Count(0, &c_pwms, 0);
c_realPwms = c_pwms;
if (LED_IsLedDriverChipRunning()) {
c_pwms = CFG_CountLEDRemapChannels();
}
if (bForceShowSingleDimmer) {
c_pwms = 1;
}
@ -1901,7 +1896,10 @@ void doHomeAssistantDiscovery(const char* topic, http_request_t* request) {
#if ENABLE_LED_BASIC
if (pwmCount == 5 || ledDriverChipRunning || (pwmCount == 4 && CFG_HasFlag(OBK_FLAG_LED_EMULATE_COOL_WITH_RGB))) {
if (ledDriverChipRunning) {
pwmCount = CFG_CountLEDRemapChannels();
}
if (pwmCount == 5 || (pwmCount == 4 && CFG_HasFlag(OBK_FLAG_LED_EMULATE_COOL_WITH_RGB))) {
if (dev_info == NULL) {
dev_info = hass_init_light_device_info(LIGHT_RGBCW);
}