ColorTemperatureController.
More...
template<typename T>
class ColorTemperatureController< T >
ColorTemperatureController.
◆ ColorTemperatureCallback
Callback definition for onColorTemperature function.
Gets called when device receive a setColorTemperature
request
- Parameters
-
[in] | deviceId | String which contains the ID of device |
[in] | colorTemperature | Integer value with color temperature the device should set to
2200 = warm white
2700 = soft white
4000 = white
5500 = daylight white
7000 = cool white |
[out] | colorTemperature | Integer value with color temperature the device is set to
2200 = warm white
2700 = soft white
4000 = white
5500 = daylight white
7000 = cool white |
- Returns
- the success of the request
- Return values
-
true | request handled properly |
false | request was not handled properly because of some error |
Example-Code
Serial.printf("Device %s colorTemperature is set to %i\r\n", deviceId.c_str(), colorTemperature);
return true;
}
void onColorTemperature(ColorTemperatureCallback cb)
Set callback function for setColorTemperature request.
Definition: ColorTemperatureController.h:82
◆ DecreaseColorTemperatureCallback
Callback definition for onDecreaseColorTemperature function.
Gets called when device receive a decreaseColorTemperature
request
- Parameters
-
[in] | deviceId | String which contains the ID of device |
[in] | colorTemperature | Integer value -1 = Device should decrease color temperature |
[out] | colorTemperature | Integer value return the new color temperarature
2200 = warm white
2700 = soft white
4000 = white
5500 = daylight white
7000 = cool white |
- Returns
- the success of the request
- Return values
-
true | request handled properly |
false | request was not handled properly because of some error |
Example-Code
int globalColorTemperature;
globalColorTemperature -= 1000;
Serial.printf("Device %s colorTemperature changed %i\r\n", deviceId.c_str(), colorTemperature);
colorTemperature = globalColorTemperature;
return true;
}
void onDecreaseColorTemperature(DecreaseColorTemperatureCallback cb)
Set callback function for decreaseColorTemperature request.
Definition: ColorTemperatureController.h:106
◆ IncreaseColorTemperatureCallback
Callback definition for onIncreaseColorTemperature function.
Gets called when device receive a increaseColorTemperature
request
- Parameters
-
[in] | deviceId | String which contains the ID of device |
[in] | colorTemperature | Integer value 1 = Device should increase color temperature |
[out] | colorTemperature | Integer value return the new color temperarature
2200 = warm white
2700 = soft white
4000 = white
5500 = daylight white
7000 = cool white |
- Returns
- the success of the request
- Return values
-
true | request handled properly |
false | request was not handled properly because of some error |
Example-Code
int globalColorTemperature;
globalColorTemperature += 1000;
Serial.printf("Device %s colorTemperature changed to %i\r\n", deviceId.c_str(), colorTemperature);
colorTemperature = globalColorTemperature;
return true;
}
void onIncreaseColorTemperature(IncreaseColorTemperatureCallback cb)
Set callback function for increaseColorTemperature request.
Definition: ColorTemperatureController.h:94
◆ onColorTemperature()
Set callback function for setColorTemperature
request.
- Parameters
-
cb | Function pointer to a ColorTemperatureCallback function |
- Returns
- void
- See also
- ColorTemperatureCallback
◆ onDecreaseColorTemperature()
Set callback function for decreaseColorTemperature
request.
- Parameters
-
cb | Function pointer to a DecreaseColorTemperatureCallback function |
- Returns
- void
- See also
- DecreaseColorTemperatureCallback
◆ onIncreaseColorTemperature()
Set callback function for increaseColorTemperature
request.
- Parameters
-
cb | Function pointer to a IncreaseColorTemperatureCallback function |
- Returns
- void
- See also
- IncreaseColorTemperatureCallback
◆ sendColorTemperatureEvent()
bool sendColorTemperatureEvent |
( |
int |
colorTemperature, |
|
|
String |
cause = "PHYSICAL_INTERACTION" |
|
) |
| |
Send setColorTemperature
event to SinricPro Server indicating actual color temperature.
- Parameters
-
colorTemperature | Integer with new color temperature the device is set to
2200 = warm white
2700 = soft white
4000 = white
5500 = daylight white
7000 = cool white |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
- Returns
- the success of sending the even
- Return values
-
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |