sidoh / esp8266_milight_hub

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

brightness on display #806

Closed KitKat-ok closed 8 months ago

KitKat-ok commented 8 months ago

Im trying to display the current brightness on an oled display but I cant find any way to read it or any variable in the arduino code where can I find it or is there another way to achieve it ?

sidoh commented 8 months ago

You're wanting to make some modifications to:

is that right?

you'd want to use stateStore defined in main.cpp. There are some example usages there that should be helpful, but it'd probably look something like this:

  BulbId myBulbId(0x1234, 1, MiLightRemoteType::REMOTE_TYPE_RGB_CCT);
  GroupState* state = stateStore->get(myBulbId);
  uint8_t brightness = state->getBrightness();
KitKat-ok commented 8 months ago

Ill try if it works in a couple of days and I have another question. How does it host the site and how does it connect to the esp through http://milight-hub.local ?

sidoh commented 8 months ago

Check out the README: https://github.com/sidoh/esp8266_milight_hub#configure-wifi

.local is mdns. You don't need to use it. Can connect to it via hostname or IP address just as easily if your client doesn't support mdns.

KitKat-ok commented 8 months ago

Can I completely disable mdns ?

sidoh commented 8 months ago

The code is here!

https://github.com/sidoh/esp8266_milight_hub/blob/master/src/main.cpp

Have fun :)