sidoh / esp8266_milight_hub

Replacement for a Milight/LimitlessLED hub hosted on an ESP8266
MIT License
931 stars 219 forks source link

Added "min_mireds" & "max_mireds" to the HA discovery payload #736

Closed jvanderzande closed 2 years ago

jvanderzande commented 2 years ago

Added "min_mireds" & "max_mireds" to the HA discovery payload so the system know the scale is not the standard 150-500 range and adjust the scale.

jvanderzande commented 2 years ago

@sidoh , Would it make more sense to move the 2 lines I added within this section as that is only for the CCT bulb, which the min/max_mireds is defined for? Like this:

  // These bulbs support adjustable white values
  switch (bulbId.deviceType) {
    case REMOTE_TYPE_CCT:
    case REMOTE_TYPE_FUT089:
    case REMOTE_TYPE_FUT091:
    case REMOTE_TYPE_RGB_CCT:
      config[GroupStateFieldNames::COLOR_TEMP] = true;
      config[F("max_mireds")] = COLOR_TEMP_MAX_MIREDS;
      config[F("min_mireds")] = COLOR_TEMP_MIN_MIREDS;
      break;
    default:
      break; //nothing
  }

I can make the PR for this change when you want. :)

sidoh commented 2 years ago

Sounds right, yea. Thanks!