ThermostatController.
More...
template<typename T>
class ThermostatController< T >
ThermostatController.
◆ AdjustTargetTemperatureCallback
Callback definition for onAdjustTargetTemperature function.
Gets called when device receive a adjustTargetTemperature
reuqest
- Parameters
-
[in] | deviceId | String which contains the ID of device |
[in] | temperature | Float relative temperature device should change about |
[out] | temperature | Float absolute temperature device is set to |
- Returns
- the success of the request
- Return values
-
true | request handled properly |
false | request was not handled properly because of some error |
Example-Code
float globalTargetTemp;
globalTargetTemp += tempDelta;
Serial.printf("Device %s target temperature changed about %f to %f\r\n", deviceId.c_str(), tempDelta, globalTargetTemp);
tempDelta = globalTargetTemp;
return true;
}
void onAdjustTargetTemperature(AdjustTargetTemperatureCallback cb)
Set callback function for adjustTargetTemperature request.
Definition: ThermostatController.h:110
◆ SetTargetTemperatureCallback
Callback definition for onTargetTemperature function.
Gets called when device receive a targetTemperature
request
- Parameters
-
[in] | deviceId | String which contains the ID of device |
[in] | temperature | Float device is requested to set the target temperature to |
[out] | temperature | Float target temperature temperature device is set to |
- 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 target temperature set to %f\r\n", deviceId.c_str(), targetTemp);
return true;
}
void onTargetTemperature(SetTargetTemperatureCallback cb)
Set callback function for targetTemperature request.
Definition: ThermostatController.h:98
◆ ThermostatModeCallback
Callback definition for onThermostatMode function.
Gets called when device receive a setThermostatMode
request
- Parameters
-
[in] | deviceId | String which contains the ID of device |
[in] | mode | String with mode device should set to |
[out] | mode | String device mode is set to |
- 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("Deivce %s thermostat mode set to %s\r\n", deviceId.c_str(), mode);
return true;
}
void onThermostatMode(ThermostatModeCallback cb)
Set callback function for setThermostatMode request.
Definition: ThermostatController.h:86
◆ onAdjustTargetTemperature()
Set callback function for adjustTargetTemperature
request.
- Parameters
-
cb | Function pointer to a AdjustTargetTemperatureCallback function |
- Returns
- void
- See also
- AdjustTargetTemperatureCallback
◆ onTargetTemperature()
Set callback function for targetTemperature
request.
- Parameters
-
cb | Function pointer to a SetTargetTemperatureCallback function |
- Returns
- void
- See also
- SetTargetTemperatureCallback
◆ onThermostatMode()
Set callback function for setThermostatMode
request.
- Parameters
-
cb | Function pointer to a ThermostatModeCallback function |
- Returns
- void
- See also
- ThermostatModeCallback
◆ sendTargetTemperatureEvent()
bool sendTargetTemperatureEvent |
( |
float |
temperature, |
|
|
String |
cause = "PHYSICAL_INTERACTION" |
|
) |
| |
Send targetTemperature
event to report target temperature change.
- Parameters
-
temperature | Float with actual target temperature the device is set to |
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 |
◆ sendThermostatModeEvent()
bool sendThermostatModeEvent |
( |
String |
thermostatMode, |
|
|
String |
cause = "PHYSICAL_INTERACTION" |
|
) |
| |
Send thermostatMode
event to report a the new mode the device has been set to.
- Parameters
-
thermostatMode | String with actual mode (AUTO , COOL , HEAT ) the device is set to |
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 |