|
|
@@ -253,6 +253,11 @@ void MiLightClient::update(const JsonObject& request) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //Homeassistant - Handle effect
|
|
|
+ if (request.containsKey("effect")) {
|
|
|
+ this->handleEffect(request["effect"]);
|
|
|
+ }
|
|
|
+
|
|
|
if (request.containsKey("hue")) {
|
|
|
this->updateHue(request["hue"]);
|
|
|
}
|
|
|
@@ -340,6 +345,14 @@ void MiLightClient::handleCommand(const String& command) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void MiLightClient::handleEffect(const String& effect) {
|
|
|
+ if (effect == "night_mode") {
|
|
|
+ this->enableNightMode();
|
|
|
+ } else if (effect == "white") {
|
|
|
+ this->updateColorWhite();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
uint8_t MiLightClient::parseStatus(const JsonObject& object) {
|
|
|
String strStatus;
|
|
|
|