Skip to content
This repository was archived by the owner on Dec 8, 2019. It is now read-only.

Send back the color_temp value to mqtt #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ESP_MQTT_Digital_LEDs/ESP_MQTT_Digital_LEDs.ino
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ byte red = 255;
byte green = 255;
byte blue = 255;
byte brightness = 255;
int color_temp = 144;



Expand Down Expand Up @@ -384,7 +385,7 @@ bool processJson(char* message) {

if (root.containsKey("color_temp")) {
//temp comes in as mireds, need to convert to kelvin then to RGB
int color_temp = root["color_temp"];
color_temp = root["color_temp"];
unsigned int kelvin = MILLION / color_temp;

temp2rgb(kelvin);
Expand Down Expand Up @@ -429,7 +430,7 @@ void sendState() {

root["brightness"] = brightness;
root["effect"] = effectString.c_str();

root["color_temp"] = color_temp;

char buffer[root.measureLength() + 1];
root.printTo(buffer, sizeof(buffer));
Expand Down