SinricPro Library
|
Device to control Window Air Conditioner. More...
Public Types | |
typedef std::function< bool(const String &, int &)> | SetRangeValueCallback |
Callback definition for onRangeValue function. More... | |
typedef std::function< bool(const String &, int &)> | AdjustRangeValueCallback |
Callback definition for onAdjustRangeValue function. More... | |
typedef std::function< bool(const String &, float &)> | SetTargetTemperatureCallback |
Callback definition for onTargetTemperature function. More... | |
typedef std::function< bool(const String &, float &)> | AdjustTargetTemperatureCallback |
Callback definition for onAdjustTargetTemperature function. More... | |
typedef std::function< bool(const String &, String &)> | ThermostatModeCallback |
Callback definition for onThermostatMode function. More... | |
typedef std::function< bool(const String &, bool &)> | PowerStateCallback |
Callback definition for onPowerState function. More... | |
Public Member Functions | |
void | onRangeValue (SetRangeValueCallback cb) |
Set callback function for setRangeValue request. More... | |
void | onAdjustRangeValue (AdjustRangeValueCallback cb) |
Set callback function for adjustRangeValue request. More... | |
void | onTargetTemperature (SetTargetTemperatureCallback cb) |
Set callback function for targetTemperature request. More... | |
void | onAdjustTargetTemperature (AdjustTargetTemperatureCallback cb) |
Set callback function for adjustTargetTemperature request. More... | |
void | onThermostatMode (ThermostatModeCallback cb) |
Set callback function for setThermostatMode request. More... | |
bool | sendRangeValueEvent (int rangeValue, String cause="PHYSICAL_INTERACTION") |
Send rangeValue event to report curent rangeValue to SinricPro server. More... | |
bool | sendTemperatureEvent (float temperature, float humidity=-1, String cause="PERIODIC_POLL") |
Send currentTemperature event to report actual temperature (measured by a sensor) More... | |
bool | sendTargetTemperatureEvent (float temperature, String cause="PHYSICAL_INTERACTION") |
Send targetTemperature event to report target temperature change. More... | |
bool | sendThermostatModeEvent (String thermostatMode, String cause="PHYSICAL_INTERACTION") |
Send thermostatMode event to report a the new mode the device has been set to. More... | |
virtual void | onPowerState (PowerStateCallback cb) |
Set callback function for powerState request. More... | |
bool | sendPowerStateEvent (bool state, String cause="PHYSICAL_INTERACTION") |
Send setPowerState event to SinricPro Server indicating actual power state. More... | |
Device to control Window Air Conditioner.
Support
AUTO
, COOL
, HEAT
typedef std::function<bool(const String&, int&)> AdjustRangeValueCallback |
Callback definition for onAdjustRangeValue function.
Gets called when device receive a adjustRangeValue
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | rangeValue | Integer -n..n delta value for range value have to change |
[out] | rangeValue | Integer 0..n returning the absolute range value |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, float&)> AdjustTargetTemperatureCallback |
Callback definition for onAdjustTargetTemperature function.
Gets called when device receive a adjustTargetTemperature
reuqest
[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 |
true | request handled properly |
false | request was not handled properly because of some error |
|
inherited |
Callback definition for onPowerState function.
Gets called when device receive a setPowerState
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | state | true = device is requested to turn on false = device is requested to turn off |
[out] | state | true = device has been turned on false = device has been turned off |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, int&)> SetRangeValueCallback |
Callback definition for onRangeValue function.
Gets called when device receive a setRangeValue
reuqest
[in] | deviceId | String which contains the ID of device |
[in] | rangeValue | Integer 0..n for range value device has to be set |
[out] | rangeValue | Integer 0..n returning the current range value |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, float&)> SetTargetTemperatureCallback |
Callback definition for onTargetTemperature function.
Gets called when device receive a targetTemperature
request
[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 |
true | request handled properly |
false | request was not handled properly because of some error |
typedef std::function<bool(const String&, String&)> ThermostatModeCallback |
Callback definition for onThermostatMode function.
Gets called when device receive a setThermostatMode
request
[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 |
true | request handled properly |
false | request was not handled properly because of some error |
void onAdjustRangeValue | ( | AdjustRangeValueCallback | cb | ) |
Set callback function for adjustRangeValue
request.
cb | Function pointer to a AdjustRangeValueCallback function |
void onAdjustTargetTemperature | ( | AdjustTargetTemperatureCallback | cb | ) |
Set callback function for adjustTargetTemperature
request.
cb | Function pointer to a AdjustTargetTemperatureCallback function |
|
virtualinherited |
Set callback function for powerState
request.
cb | Function pointer to a PowerStateCallback function |
void onRangeValue | ( | SetRangeValueCallback | cb | ) |
Set callback function for setRangeValue
request.
cb | Function pointer to a SetRangeValueCallback function |
void onTargetTemperature | ( | SetTargetTemperatureCallback | cb | ) |
Set callback function for targetTemperature
request.
cb | Function pointer to a SetTargetTemperatureCallback function |
void onThermostatMode | ( | ThermostatModeCallback | cb | ) |
Set callback function for setThermostatMode
request.
cb | Function pointer to a ThermostatModeCallback function |
|
inherited |
Send setPowerState
event to SinricPro Server indicating actual power state.
state | true = device turned on false = device turned off |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendRangeValueEvent | ( | int | rangeValue, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send rangeValue
event to report curent rangeValue to SinricPro server.
rangeValue | Value between 0..n |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendTargetTemperatureEvent | ( | float | temperature, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send targetTemperature
event to report target temperature change.
temperature | Float with actual target temperature the device is set to |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendTemperatureEvent | ( | float | temperature, |
float | humidity = -1 , |
||
String | cause = "PERIODIC_POLL" |
||
) |
Send currentTemperature
event to report actual temperature (measured by a sensor)
temperature | Float with actual temperature measured by a sensor |
humidity | (optional) Float with actual humidity measured by a sensor (default=-1.0f means not supported) |
cause | (optional) String reason why event is sent (default = "PERIODIC_POLL" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |
bool sendThermostatModeEvent | ( | String | thermostatMode, |
String | cause = "PHYSICAL_INTERACTION" |
||
) |
Send thermostatMode
event to report a the new mode the device has been set to.
thermostatMode | String with actual mode (AUTO , COOL , HEAT ) the device is set to |
cause | (optional) String reason why event is sent (default = "PHYSICAL_INTERACTION" ) |
true | event has been sent successfully |
false | event has not been sent, maybe you sent to much events in a short distance of time |