diff --git a/Doxyfile b/Doxyfile
index 6be05bb..8dc7ff1 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -829,7 +829,8 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = C:\Users\Boris\.platformio\lib\esp8266-esp32-sdk\src
+INPUT = C:\Users\Boris\.platformio\lib\esp8266-esp32-sdk\src \
+ README.md
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/README.md b/README.md
index 6d05730..b938e48 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
# SinricPro (ESP8266 / ESP32 SDK)
-## Version 2.2.6
+## Version 2.2.7
## Installation
### VS Code & PlatformIO:
1. Install [VS Code](https://code.visualstudio.com/)
2. Install [PlatformIO](https://platformio.org/platformio-ide)
3. Install **SinricPro** library by using [Library Manager](https://docs.platformio.org/en/latest/librarymanager/)
-4. Use included [platformio.ini](https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/pio-examples/switch/platformio.ini) files from [examples](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples) to ensure that all dependent libraries will installed automaticly.
+4. Use included [platformio.ini](examples/platformio/platformio.ini) file from examples to ensure that all dependent libraries will installed automaticly.

@@ -28,13 +28,7 @@
---
## Examples
-|PlatformIO|Arduino|
-|:--:|:--:|
-| [Switch](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/switch) |[Switch](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/Switch)|
-| [Doorbell](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/doorbell)|[Doorbell](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/doorbell)|
-| - | [Lock](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/GarageDoor)|
-| [TemperatureSensor](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/temperaturesensor) |[TemperatureSensor](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/temperaturesensor)|
-| [TV](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/pio-examples/tv) | [TV](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples/tv)
+See [examples](https://github.com/sinricpro/esp8266-esp32-sdk/tree/master/examples) on GitHub
---
@@ -127,5 +121,5 @@ Example 1
---
# Full user documentation
-Please see full user documentation here https://sinricpro.github.io/esp8266-esp32-sdk
+Please see here for [full user documentation](https://sinricpro.github.io/esp8266-esp32-sdk)
diff --git a/changelog.md b/changelog.md
index bc50e78..9bad4d5 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,21 @@
# Changelog
+## Version 2.2.7
+
+New:
+- Examples
+ - Dimmable Switch
+ - Light
+ - Speaker
+
+Updated:
+- User documentation
+ - added SinricPro.onConnected() / SinricPro.onDisconnected()
+
+Fixed:
+- Examples
+ - Some examples didn't use BAUD_RATE
+
## Version 2.2.6
New:
diff --git a/doc-examples/callbacks.cpp b/doc-examples/callbacks.cpp
index 6ae4ee9..9870ec6 100644
--- a/doc-examples/callbacks.cpp
+++ b/doc-examples/callbacks.cpp
@@ -367,4 +367,12 @@ bool onSelectInput(const String &deviceId, String &input) {
Serial.printf("Device %s input changed to %s\r\n", deviceId.c_str(), input.c_str());
return true;
}
-//! [onSelectInput]
\ No newline at end of file
+//! [onSelectInput]
+
+//! [onConnected]
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+//! [onConnected]
+
+//! [onDisconnected]
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
+//! [onDisconnected]
diff --git a/docs/_sinric_pro_8h_source.html b/docs/_sinric_pro_8h_source.html
index 87d3dbe..e3e5125 100644
--- a/docs/_sinric_pro_8h_source.html
+++ b/docs/_sinric_pro_8h_source.html
@@ -136,442 +136,446 @@
- 35 typedef std::function<void(
void)> ConnectCallbackHandler;
- 36 void onConnected(ConnectCallbackHandler cb);
- 37 void onDisconnected(ConnectCallbackHandler cb);
-
-
-
- 41 DynamicJsonDocument prepareResponse(JsonDocument& requestMessage);
- 42 DynamicJsonDocument prepareEvent(
const char* deviceId,
const char* action,
const char* cause)
override;
- 43 void sendMessage(JsonDocument& jsonMessage)
override;
-
-
- 46 proxy(
SinricProClass* ptr, String deviceId) : ptr(ptr), deviceId(deviceId) {}
-
-
- 49 template <
typename DeviceType>
- 50 operator DeviceType&() {
return as<DeviceType>(); }
- 51 template <
typename DeviceType>
- 52 DeviceType& as() {
return ptr->getDeviceInstance<DeviceType>(deviceId); }
-
- 70 proxy
operator[](
const String deviceId) {
return proxy(
this, deviceId); }
-
-
- 73 void setResponseMessage(String &&message) { responseMessageStr = message; }
-
-
- 76 void handleReceiveQueue();
- 77 void handleSendQueue();
-
- 79 void handleRequest(DynamicJsonDocument& requestMessage, interface_t Interface);
- 80 void handleResponse(DynamicJsonDocument& responseMessage);
-
- 82 DynamicJsonDocument prepareRequest(
const char* deviceId,
const char* action);
-
-
-
-
-
- 88 void onConnect() { DEBUG_SINRIC(
"[SinricPro]: Connected to \"%s\"!]\r\n", serverURL.c_str()); }
- 89 void onDisconnect() { DEBUG_SINRIC(
"[SinricPro]: Disconnect\r\n"); }
-
- 91 bool verifyDeviceId(
const char*
id);
- 92 bool verifyAppKey(
const char* key);
- 93 bool verifyAppSecret(
const char* secret);
- 94 void extractTimestamp(JsonDocument &message);
-
- 96 SinricProDeviceInterface* getDevice(String deviceId);
-
- 98 template <
typename DeviceType>
- 99 DeviceType& getDeviceInstance(String deviceId);
-
- 101 std::vector<SinricProDeviceInterface*> devices;
- 102 String socketAuthToken;
-
-
+
+
+
+
+
+
+
+ 56 DynamicJsonDocument prepareResponse(JsonDocument& requestMessage);
+ 57 DynamicJsonDocument prepareEvent(
const char* deviceId,
const char* action,
const char* cause)
override;
+ 58 void sendMessage(JsonDocument& jsonMessage)
override;
+
+
+ 61 proxy(
SinricProClass* ptr, String deviceId) : ptr(ptr), deviceId(deviceId) {}
+
+
+ 64 template <
typename DeviceType>
+ 65 operator DeviceType&() {
return as<DeviceType>(); }
+ 66 template <
typename DeviceType>
+ 67 DeviceType& as() {
return ptr->getDeviceInstance<DeviceType>(deviceId); }
+
+ 85 proxy
operator[](
const String deviceId) {
return proxy(
this, deviceId); }
+
+
+ 88 void setResponseMessage(String &&message) { responseMessageStr = message; }
+
+
+ 91 void handleReceiveQueue();
+ 92 void handleSendQueue();
+
+ 94 void handleRequest(DynamicJsonDocument& requestMessage, interface_t Interface);
+ 95 void handleResponse(DynamicJsonDocument& responseMessage);
+
+ 97 DynamicJsonDocument prepareRequest(
const char* deviceId,
const char* action);
+
+
+
+
+
+ 103 void onConnect() { DEBUG_SINRIC(
"[SinricPro]: Connected to \"%s\"!]\r\n", serverURL.c_str()); }
+ 104 void onDisconnect() { DEBUG_SINRIC(
"[SinricPro]: Disconnect\r\n"); }
- 106 websocketListener _websocketListener;
- 107 udpListener _udpListener;
- 108 SinricProQueue_t receiveQueue;
- 109 SinricProQueue_t sendQueue;
+ 106 bool verifyDeviceId(
const char*
id);
+ 107 bool verifyAppKey(
const char* key);
+ 108 bool verifyAppSecret(
const char* secret);
+ 109 void extractTimestamp(JsonDocument &message);
- 111 unsigned long getTimestamp() {
return baseTimestamp + (millis()/1000); }
- 112 unsigned long baseTimestamp = 0;
-
-
- 115 String responseMessageStr =
"";
-
-
- 118 SinricProDeviceInterface* SinricProClass::getDevice(String deviceId) {
- 119 for (
auto& device : devices) {
- 120 if (deviceId == String(device->getDeviceId()))
return device;
-
-
-
-
- 125 template <
typename DeviceType>
- 126 DeviceType& SinricProClass::getDeviceInstance(String deviceId) {
- 127 DeviceType* tmp_device = (DeviceType*) getDevice(deviceId);
- 128 if (tmp_device)
return *tmp_device;
-
- 130 DEBUG_SINRIC(
"[SinricPro]: Device \"%s\" does not exist. Creating new device\r\n", deviceId.c_str());
- 131 DeviceType& tmp_deviceInstance = add<DeviceType>(deviceId.c_str());
+ 111 SinricProDeviceInterface* getDevice(String deviceId);
+
+ 113 template <
typename DeviceType>
+ 114 DeviceType& getDeviceInstance(String deviceId);
+
+ 116 std::vector<SinricProDeviceInterface*> devices;
+ 117 String socketAuthToken;
+
+
+
+ 121 websocketListener _websocketListener;
+ 122 udpListener _udpListener;
+ 123 SinricProQueue_t receiveQueue;
+ 124 SinricProQueue_t sendQueue;
+
+ 126 unsigned long getTimestamp() {
return baseTimestamp + (millis()/1000); }
+ 127 unsigned long baseTimestamp = 0;
+
+
+ 130 String responseMessageStr =
"";
+
-
- 134 DEBUG_SINRIC(
"[SinricPro]: Reconnecting to server.\r\n");
-
+ 133 SinricProDeviceInterface* SinricProClass::getDevice(String deviceId) {
+ 134 for (
auto& device : devices) {
+ 135 if (deviceId == String(device->getDeviceId()))
return device;
-
- 138 return tmp_deviceInstance;
-
-
-
-
- 159 if (!verifyAppKey(socketAuthToken.c_str())) {
- 160 DEBUG_SINRIC(
"[SinricPro:begin()]: App-Key \"%s\" is invalid!! Please check your app-key!! SinricPro will not work!\r\n", socketAuthToken.c_str());
-
-
- 163 if (!verifyAppSecret(signingKey.c_str())) {
- 164 DEBUG_SINRIC(
"[SinricPro:begin()]: App-Secret \"%s\" is invalid!! Please check your app-secret!! SinricPro will not work!\r\n", signingKey.c_str());
-
-
-
-
-
-
-
-
-
- 174 this->socketAuthToken = socketAuthToken;
- 175 this->signingKey = signingKey;
- 176 this->serverURL = serverURL;
-
- 178 _udpListener.begin(&receiveQueue);
-
-
- 181 template <
typename DeviceType>
- 182 DeviceType& SinricProClass::add(
const char* deviceId,
unsigned long eventWaitTime) {
- 183 DeviceType* newDevice =
new DeviceType(deviceId, eventWaitTime);
- 184 if (verifyDeviceId(deviceId)){
- 185 DEBUG_SINRIC(
"[SinricPro:add()]: Adding device with id \"%s\".\r\n", deviceId);
- 186 newDevice->begin(
this);
- 187 if (verifyAppKey(socketAuthToken.c_str()) && verifyAppSecret(signingKey.c_str())) _begin =
true;
-
- 189 DEBUG_SINRIC(
"[SinricPro:add()]: DeviceId \"%s\" is invalid!! Device will be ignored and will NOT WORK!\r\n", deviceId);
-
- 191 devices.push_back(newDevice);
-
-
-
- 195 __attribute__ ((deprecated(
"Please use DeviceType& myDevice = SinricPro.add<DeviceType>(DeviceId);")))
-
- 197 if (!verifyDeviceId(newDevice->getDeviceId()))
return;
- 198 newDevice->
begin(
this);
- 199 devices.push_back(newDevice);
-
-
- 202 __attribute__ ((deprecated(
"Please use DeviceType& myDevice = SinricPro.add<DeviceType>(DeviceId);")))
-
- 204 if (!verifyDeviceId(newDevice.getDeviceId()))
return;
- 205 newDevice.
begin(
this);
- 206 devices.push_back(&newDevice);
-
-
-
- 225 static bool begin_error =
false;
-
-
- 228 DEBUG_SINRIC(
"[SinricPro:handle()]: ERROR! SinricPro.begin() failed or was not called prior to event handler\r\n");
- 229 DEBUG_SINRIC(
"[SinricPro:handle()]: -Reasons include an invalid app-key, invalid app-secret or no valid deviceIds)\r\n");
- 230 DEBUG_SINRIC(
"[SinricPro:handle()]: -SinricPro is disabled! Check earlier log messages for details.\r\n");
-
-
-
-
-
-
- 237 if (!isConnected()) connect();
- 238 _websocketListener.handle();
- 239 _udpListener.handle();
-
- 241 handleReceiveQueue();
-
-
-
- 245 DynamicJsonDocument SinricProClass::prepareRequest(
const char* deviceId,
const char* action) {
- 246 DynamicJsonDocument requestMessage(1024);
- 247 JsonObject header = requestMessage.createNestedObject(
"header");
- 248 header[
"payloadVersion"] = 2;
- 249 header[
"signatureVersion"] = 1;
+
+
+
+ 140 template <
typename DeviceType>
+ 141 DeviceType& SinricProClass::getDeviceInstance(String deviceId) {
+ 142 DeviceType* tmp_device = (DeviceType*) getDevice(deviceId);
+ 143 if (tmp_device)
return *tmp_device;
+
+ 145 DEBUG_SINRIC(
"[SinricPro]: Device \"%s\" does not exist. Creating new device\r\n", deviceId.c_str());
+ 146 DeviceType& tmp_deviceInstance = add<DeviceType>(deviceId.c_str());
+
+
+ 149 DEBUG_SINRIC(
"[SinricPro]: Reconnecting to server.\r\n");
+
+
+
+ 153 return tmp_deviceInstance;
+
+
+
+
+ 174 if (!verifyAppKey(socketAuthToken.c_str())) {
+ 175 DEBUG_SINRIC(
"[SinricPro:begin()]: App-Key \"%s\" is invalid!! Please check your app-key!! SinricPro will not work!\r\n", socketAuthToken.c_str());
+
+
+ 178 if (!verifyAppSecret(signingKey.c_str())) {
+ 179 DEBUG_SINRIC(
"[SinricPro:begin()]: App-Secret \"%s\" is invalid!! Please check your app-secret!! SinricPro will not work!\r\n", signingKey.c_str());
+
+
+
+
+
+
+
+
+
+ 189 this->socketAuthToken = socketAuthToken;
+ 190 this->signingKey = signingKey;
+ 191 this->serverURL = serverURL;
+
+ 193 _udpListener.begin(&receiveQueue);
+
+
+ 196 template <
typename DeviceType>
+ 197 DeviceType& SinricProClass::add(
const char* deviceId,
unsigned long eventWaitTime) {
+ 198 DeviceType* newDevice =
new DeviceType(deviceId, eventWaitTime);
+ 199 if (verifyDeviceId(deviceId)){
+ 200 DEBUG_SINRIC(
"[SinricPro:add()]: Adding device with id \"%s\".\r\n", deviceId);
+ 201 newDevice->begin(
this);
+ 202 if (verifyAppKey(socketAuthToken.c_str()) && verifyAppSecret(signingKey.c_str())) _begin =
true;
+
+ 204 DEBUG_SINRIC(
"[SinricPro:add()]: DeviceId \"%s\" is invalid!! Device will be ignored and will NOT WORK!\r\n", deviceId);
+
+ 206 devices.push_back(newDevice);
+
+
+
+ 210 __attribute__ ((deprecated(
"Please use DeviceType& myDevice = SinricPro.add<DeviceType>(DeviceId);")))
+
+ 212 if (!verifyDeviceId(newDevice->getDeviceId()))
return;
+ 213 newDevice->
begin(
this);
+ 214 devices.push_back(newDevice);
+
+
+ 217 __attribute__ ((deprecated(
"Please use DeviceType& myDevice = SinricPro.add<DeviceType>(DeviceId);")))
+
+ 219 if (!verifyDeviceId(newDevice.getDeviceId()))
return;
+ 220 newDevice.
begin(
this);
+ 221 devices.push_back(&newDevice);
+
+
+
+ 240 static bool begin_error =
false;
+
+
+ 243 DEBUG_SINRIC(
"[SinricPro:handle()]: ERROR! SinricPro.begin() failed or was not called prior to event handler\r\n");
+ 244 DEBUG_SINRIC(
"[SinricPro:handle()]: -Reasons include an invalid app-key, invalid app-secret or no valid deviceIds)\r\n");
+ 245 DEBUG_SINRIC(
"[SinricPro:handle()]: -SinricPro is disabled! Check earlier log messages for details.\r\n");
+
+
+
+
- 251 JsonObject payload = requestMessage.createNestedObject(
"payload");
- 252 payload[
"action"] = action;
- 253 payload[
"createdAt"] = 0;
- 254 payload[
"deviceId"] = deviceId;
- 255 payload[
"replyToken"] = MessageID().getID();
- 256 payload[
"type"] =
"request";
- 257 payload.createNestedObject(
"value");
- 258 return requestMessage;
-
-
- 261 void SinricProClass::handleResponse(DynamicJsonDocument& responseMessage) {
- 262 DEBUG_SINRIC(
"[SinricPro.handleResponse()]:\r\n");
-
- 264 #ifndef NODEBUG_SINRIC
- 265 serializeJsonPretty(responseMessage, DEBUG_ESP_PORT);
-
-
-
-
- 270 void SinricProClass::handleRequest(DynamicJsonDocument& requestMessage, interface_t Interface) {
- 271 DEBUG_SINRIC(
"[SinricPro.handleRequest()]: handling request\r\n");
- 272 #ifndef NODEBUG_SINRIC
- 273 serializeJsonPretty(requestMessage, DEBUG_ESP_PORT);
-
+
+ 252 if (!isConnected()) connect();
+ 253 _websocketListener.handle();
+ 254 _udpListener.handle();
+
+ 256 handleReceiveQueue();
+
+
+
+ 260 DynamicJsonDocument SinricProClass::prepareRequest(
const char* deviceId,
const char* action) {
+ 261 DynamicJsonDocument requestMessage(1024);
+ 262 JsonObject header = requestMessage.createNestedObject(
"header");
+ 263 header[
"payloadVersion"] = 2;
+ 264 header[
"signatureVersion"] = 1;
+
+ 266 JsonObject payload = requestMessage.createNestedObject(
"payload");
+ 267 payload[
"action"] = action;
+ 268 payload[
"createdAt"] = 0;
+ 269 payload[
"deviceId"] = deviceId;
+ 270 payload[
"replyToken"] = MessageID().getID();
+ 271 payload[
"type"] =
"request";
+ 272 payload.createNestedObject(
"value");
+ 273 return requestMessage;
+
- 276 DynamicJsonDocument responseMessage = prepareResponse(requestMessage);
-
-
- 279 bool success =
false;
- 280 const char* deviceId = requestMessage[
"payload"][
"deviceId"];
- 281 const char* action = requestMessage[
"payload"][
"action"];
- 282 JsonObject request_value = requestMessage[
"payload"][
"value"];
- 283 JsonObject response_value = responseMessage[
"payload"][
"value"];
+ 276 void SinricProClass::handleResponse(DynamicJsonDocument& responseMessage) {
+ 277 DEBUG_SINRIC(
"[SinricPro.handleResponse()]:\r\n");
+
+ 279 #ifndef NODEBUG_SINRIC
+ 280 serializeJsonPretty(responseMessage, DEBUG_ESP_PORT);
+
+
+
- 285 for (
auto& device : devices) {
- 286 if (strcmp(deviceId, device->getDeviceId()) == 0 && success ==
false) {
- 287 success = device->handleRequest(deviceId, action, request_value, response_value);
- 288 responseMessage[
"payload"][
"success"] = success;
-
- 290 if (responseMessageStr.length() > 0){
- 291 responseMessage[
"payload"][
"message"] = responseMessageStr;
- 292 responseMessageStr =
"";
-
- 294 responseMessage[
"payload"][
"message"] =
"Device returned an error while processing the request!";
-
-
-
-
+ 285 void SinricProClass::handleRequest(DynamicJsonDocument& requestMessage, interface_t Interface) {
+ 286 DEBUG_SINRIC(
"[SinricPro.handleRequest()]: handling request\r\n");
+ 287 #ifndef NODEBUG_SINRIC
+ 288 serializeJsonPretty(requestMessage, DEBUG_ESP_PORT);
+
+
+ 291 DynamicJsonDocument responseMessage = prepareResponse(requestMessage);
+
+
+ 294 bool success =
false;
+ 295 const char* deviceId = requestMessage[
"payload"][
"deviceId"];
+ 296 const char* action = requestMessage[
"payload"][
"action"];
+ 297 JsonObject request_value = requestMessage[
"payload"][
"value"];
+ 298 JsonObject response_value = responseMessage[
"payload"][
"value"];
- 300 String responseString;
- 301 serializeJson(responseMessage, responseString);
- 302 sendQueue.push(
new SinricProMessage(Interface, responseString.c_str()));
-
-
- 305 void SinricProClass::handleReceiveQueue() {
- 306 if (receiveQueue.count() == 0)
return;
-
- 308 DEBUG_SINRIC(
"[SinricPro.handleReceiveQueue()]: %i message(s) in receiveQueue\r\n", receiveQueue.count());
- 309 while (receiveQueue.count() > 0) {
- 310 SinricProMessage* rawMessage = receiveQueue.pop();
- 311 DynamicJsonDocument jsonMessage(1024);
- 312 deserializeJson(jsonMessage, rawMessage->getMessage());
-
- 314 bool sigMatch =
false;
-
- 316 if (strncmp(rawMessage->getMessage(),
"{\"timestamp\":", 13) == 0 && strlen(rawMessage->getMessage()) <= 26) {
-
-
- 319 sigMatch = verifyMessage(signingKey, jsonMessage);
-
-
- 322 String messageType = jsonMessage[
"payload"][
"type"];
-
-
- 325 DEBUG_SINRIC(
"[SinricPro.handleReceiveQueue()]: Signature is valid. Processing message...\r\n");
- 326 extractTimestamp(jsonMessage);
- 327 if (messageType ==
"response") handleResponse(jsonMessage);
- 328 if (messageType ==
"request") handleRequest(jsonMessage, rawMessage->getInterface());
-
- 330 DEBUG_SINRIC(
"[SinricPro.handleReceiveQueue()]: Signature is invalid! Sending messsage to [dev/null] ;)\r\n");
-
-
-
-
-
- 336 void SinricProClass::handleSendQueue() {
- 337 if (!isConnected())
return;
- 338 if (!baseTimestamp)
return;
- 339 while (sendQueue.count() > 0) {
- 340 DEBUG_SINRIC(
"[SinricPro:handleSendQueue()]: %i message(s) in sendQueue\r\n", sendQueue.count());
- 341 DEBUG_SINRIC(
"[SinricPro:handleSendQueue()]: Sending message...\r\n");
-
- 343 SinricProMessage* rawMessage = sendQueue.pop();
-
- 345 DynamicJsonDocument jsonMessage(1024);
- 346 deserializeJson(jsonMessage, rawMessage->getMessage());
- 347 jsonMessage[
"payload"][
"createdAt"] = getTimestamp();
- 348 signMessage(signingKey, jsonMessage);
-
-
-
- 352 serializeJson(jsonMessage, messageStr);
- 353 #ifndef NODEBUG_SINRIC
- 354 serializeJsonPretty(jsonMessage, DEBUG_ESP_PORT);
-
-
+ 300 for (
auto& device : devices) {
+ 301 if (strcmp(deviceId, device->getDeviceId()) == 0 && success ==
false) {
+ 302 success = device->handleRequest(deviceId, action, request_value, response_value);
+ 303 responseMessage[
"payload"][
"success"] = success;
+
+ 305 if (responseMessageStr.length() > 0){
+ 306 responseMessage[
"payload"][
"message"] = responseMessageStr;
+ 307 responseMessageStr =
"";
+
+ 309 responseMessage[
"payload"][
"message"] =
"Device returned an error while processing the request!";
+
+
+
+
+
+ 315 String responseString;
+ 316 serializeJson(responseMessage, responseString);
+ 317 sendQueue.push(
new SinricProMessage(Interface, responseString.c_str()));
+
+
+ 320 void SinricProClass::handleReceiveQueue() {
+ 321 if (receiveQueue.count() == 0)
return;
+
+ 323 DEBUG_SINRIC(
"[SinricPro.handleReceiveQueue()]: %i message(s) in receiveQueue\r\n", receiveQueue.count());
+ 324 while (receiveQueue.count() > 0) {
+ 325 SinricProMessage* rawMessage = receiveQueue.pop();
+ 326 DynamicJsonDocument jsonMessage(1024);
+ 327 deserializeJson(jsonMessage, rawMessage->getMessage());
+
+ 329 bool sigMatch =
false;
+
+ 331 if (strncmp(rawMessage->getMessage(),
"{\"timestamp\":", 13) == 0 && strlen(rawMessage->getMessage()) <= 26) {
+
+
+ 334 sigMatch = verifyMessage(signingKey, jsonMessage);
+
+
+ 337 String messageType = jsonMessage[
"payload"][
"type"];
+
+
+ 340 DEBUG_SINRIC(
"[SinricPro.handleReceiveQueue()]: Signature is valid. Processing message...\r\n");
+ 341 extractTimestamp(jsonMessage);
+ 342 if (messageType ==
"response") handleResponse(jsonMessage);
+ 343 if (messageType ==
"request") handleRequest(jsonMessage, rawMessage->getInterface());
+
+ 345 DEBUG_SINRIC(
"[SinricPro.handleReceiveQueue()]: Signature is invalid! Sending messsage to [dev/null] ;)\r\n");
+
+
+
+
+
+ 351 void SinricProClass::handleSendQueue() {
+ 352 if (!isConnected())
return;
+ 353 if (!baseTimestamp)
return;
+ 354 while (sendQueue.count() > 0) {
+ 355 DEBUG_SINRIC(
"[SinricPro:handleSendQueue()]: %i message(s) in sendQueue\r\n", sendQueue.count());
+ 356 DEBUG_SINRIC(
"[SinricPro:handleSendQueue()]: Sending message...\r\n");
- 358 switch (rawMessage->getInterface()) {
- 359 case IF_WEBSOCKET: DEBUG_SINRIC(
"[SinricPro:handleSendQueue]: Sending to websocket\r\n"); _websocketListener.sendMessage(messageStr);
break;
- 360 case IF_UDP: DEBUG_SINRIC(
"[SinricPro:handleSendQueue]: Sending to UDP\r\n");_udpListener.sendMessage(messageStr);
break;
-
-
-
- 364 DEBUG_SINRIC(
"[SinricPro:handleSendQueue()]: message sent.\r\n");
-
-
-
- 368 void SinricProClass::connect() {
-
-
- 371 for (
auto& device : devices) {
- 372 const char* deviceId = device->getDeviceId();
- 373 if (verifyDeviceId(deviceId)) {
- 374 if (i>0) deviceList +=
';';
- 375 deviceList += String(deviceId);
-
+ 358 SinricProMessage* rawMessage = sendQueue.pop();
+
+ 360 DynamicJsonDocument jsonMessage(1024);
+ 361 deserializeJson(jsonMessage, rawMessage->getMessage());
+ 362 jsonMessage[
"payload"][
"createdAt"] = getTimestamp();
+ 363 signMessage(signingKey, jsonMessage);
+
+
+
+ 367 serializeJson(jsonMessage, messageStr);
+ 368 #ifndef NODEBUG_SINRIC
+ 369 serializeJsonPretty(jsonMessage, DEBUG_ESP_PORT);
+
+
+
+ 373 switch (rawMessage->getInterface()) {
+ 374 case IF_WEBSOCKET: DEBUG_SINRIC(
"[SinricPro:handleSendQueue]: Sending to websocket\r\n"); _websocketListener.sendMessage(messageStr);
break;
+ 375 case IF_UDP: DEBUG_SINRIC(
"[SinricPro:handleSendQueue]: Sending to UDP\r\n");_udpListener.sendMessage(messageStr);
break;
+
-
-
-
- 381 DEBUG_SINRIC(
"[SinricPro]: ERROR! No valid devices available. Please add a valid device first!\r\n");
-
-
-
- 385 _websocketListener.begin(serverURL, socketAuthToken, deviceList, &receiveQueue);
-
-
-
- 389 void SinricProClass::stop() {
- 390 DEBUG_SINRIC(
"[SinricPro:stop()\r\n");
- 391 _websocketListener.stop();
-
-
- 394 bool SinricProClass::isConnected() {
- 395 return _websocketListener.isConnected();
-
-
-
- 399 void SinricProClass::onConnected(ConnectCallbackHandler cb) {
- 400 _websocketListener.onConnected(cb);
+
+ 379 DEBUG_SINRIC(
"[SinricPro:handleSendQueue()]: message sent.\r\n");
+
+
+
+ 383 void SinricProClass::connect() {
+
+
+ 386 for (
auto& device : devices) {
+ 387 const char* deviceId = device->getDeviceId();
+ 388 if (verifyDeviceId(deviceId)) {
+ 389 if (i>0) deviceList +=
';';
+ 390 deviceList += String(deviceId);
+
+
+
+
+
+ 396 DEBUG_SINRIC(
"[SinricPro]: ERROR! No valid devices available. Please add a valid device first!\r\n");
+
+
+
+ 400 _websocketListener.begin(serverURL, socketAuthToken, deviceList, &receiveQueue);
- 403 void SinricProClass::onDisconnected(ConnectCallbackHandler cb) {
- 404 _websocketListener.onDisconnected(cb);
-
-
-
- 408 void SinricProClass::reconnect() {
- 409 DEBUG_SINRIC(
"SinricPro:reconnect(): disconnecting\r\n");
-
- 411 DEBUG_SINRIC(
"SinricPro:reconnect(): connecting\r\n");
-
-
-
- 415 bool SinricProClass::verifyDeviceId(
const char*
id) {
- 416 if (strlen(
id) != 24)
return false;
-
- 418 return sscanf(
id,
"%4x%4x%4x%4x%4x%4x%c",
- 419 &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp_c) == 6;
-
-
- 422 bool SinricProClass::verifyAppKey(
const char* key) {
- 423 if (strlen(key) != 36)
return false;
-
- 425 return sscanf(key,
"%4x%4x-%4x-%4x-%4x-%4x%4x%4x%c",
- 426 &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp_c) == 8;
-
-
- 429 bool SinricProClass::verifyAppSecret(
const char* secret) {
- 430 if (strlen(secret) != 73)
return false;
-
- 432 return sscanf(secret,
"%4x%4x-%4x-%4x-%4x-%4x%4x%4x-%4x%4x-%4x-%4x-%4x-%4x%4x%4x%c",
- 433 &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp_c) == 16;
-
-
-
- 437 void SinricProClass::extractTimestamp(JsonDocument &message) {
- 438 unsigned long tempTimestamp = 0;
-
- 440 tempTimestamp = message[
"timestamp"] | 0;
-
- 442 baseTimestamp = tempTimestamp - (millis() / 1000);
- 443 DEBUG_SINRIC(
"[SinricPro:extractTimestamp(): Got Timestamp %lu\r\n", tempTimestamp);
-
-
+
+ 404 void SinricProClass::stop() {
+ 405 DEBUG_SINRIC(
"[SinricPro:stop()\r\n");
+ 406 _websocketListener.stop();
+
+
+ 409 bool SinricProClass::isConnected() {
+ 410 return _websocketListener.isConnected();
+
+
+
+ 423 _websocketListener.onConnected(cb);
+
+
+
+ 436 _websocketListener.onDisconnected(cb);
+
+
+
+ 440 void SinricProClass::reconnect() {
+ 441 DEBUG_SINRIC(
"SinricPro:reconnect(): disconnecting\r\n");
+
+ 443 DEBUG_SINRIC(
"SinricPro:reconnect(): connecting\r\n");
+
+
-
- 448 tempTimestamp = message[
"payload"][
"createdAt"] | 0;
-
- 450 DEBUG_SINRIC(
"[SinricPro:extractTimestamp(): Got Timestamp %lu\r\n", tempTimestamp);
- 451 baseTimestamp = tempTimestamp - (millis() / 1000);
-
-
-
-
-
- 457 void SinricProClass::sendMessage(JsonDocument& jsonMessage) {
- 458 DEBUG_SINRIC(
"[SinricPro:sendMessage()]: pushing message into sendQueue\r\n");
- 459 String messageString;
- 460 serializeJson(jsonMessage, messageString);
- 461 sendQueue.push(
new SinricProMessage(IF_WEBSOCKET, messageString.c_str()));
-
-
-
- 474 _websocketListener.setRestoreDeviceStates(flag);
-
-
- 477 DynamicJsonDocument SinricProClass::prepareResponse(JsonDocument& requestMessage) {
- 478 DynamicJsonDocument responseMessage(1024);
- 479 JsonObject header = responseMessage.createNestedObject(
"header");
- 480 header[
"payloadVersion"] = 2;
- 481 header[
"signatureVersion"] = 1;
-
- 483 JsonObject payload = responseMessage.createNestedObject(
"payload");
- 484 payload[
"action"] = requestMessage[
"payload"][
"action"];
- 485 payload[
"clientId"] = requestMessage[
"payload"][
"clientId"];
- 486 payload[
"createdAt"] = 0;
- 487 payload[
"deviceId"] = requestMessage[
"payload"][
"deviceId"];
- 488 payload[
"message"] =
"OK";
- 489 payload[
"replyToken"] = requestMessage[
"payload"][
"replyToken"];
- 490 payload[
"success"] =
false;
- 491 payload[
"type"] =
"response";
- 492 payload.createNestedObject(
"value");
- 493 return responseMessage;
+ 447 bool SinricProClass::verifyDeviceId(
const char*
id) {
+ 448 if (strlen(
id) != 24)
return false;
+
+ 450 return sscanf(
id,
"%4x%4x%4x%4x%4x%4x%c",
+ 451 &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp_c) == 6;
+
+
+ 454 bool SinricProClass::verifyAppKey(
const char* key) {
+ 455 if (strlen(key) != 36)
return false;
+
+ 457 return sscanf(key,
"%4x%4x-%4x-%4x-%4x-%4x%4x%4x%c",
+ 458 &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp_c) == 8;
+
+
+ 461 bool SinricProClass::verifyAppSecret(
const char* secret) {
+ 462 if (strlen(secret) != 73)
return false;
+
+ 464 return sscanf(secret,
"%4x%4x-%4x-%4x-%4x-%4x%4x%4x-%4x%4x-%4x-%4x-%4x-%4x%4x%4x%c",
+ 465 &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp, &tmp_c) == 16;
+
+
+
+ 469 void SinricProClass::extractTimestamp(JsonDocument &message) {
+ 470 unsigned long tempTimestamp = 0;
+
+ 472 tempTimestamp = message[
"timestamp"] | 0;
+
+ 474 baseTimestamp = tempTimestamp - (millis() / 1000);
+ 475 DEBUG_SINRIC(
"[SinricPro:extractTimestamp(): Got Timestamp %lu\r\n", tempTimestamp);
+
+
+
+
+ 480 tempTimestamp = message[
"payload"][
"createdAt"] | 0;
+
+ 482 DEBUG_SINRIC(
"[SinricPro:extractTimestamp(): Got Timestamp %lu\r\n", tempTimestamp);
+ 483 baseTimestamp = tempTimestamp - (millis() / 1000);
+
+
+
+
+
+ 489 void SinricProClass::sendMessage(JsonDocument& jsonMessage) {
+ 490 DEBUG_SINRIC(
"[SinricPro:sendMessage()]: pushing message into sendQueue\r\n");
+ 491 String messageString;
+ 492 serializeJson(jsonMessage, messageString);
+ 493 sendQueue.push(
new SinricProMessage(IF_WEBSOCKET, messageString.c_str()));
-
- 497 DynamicJsonDocument SinricProClass::prepareEvent(
const char* deviceId,
const char* action,
const char* cause) {
- 498 DynamicJsonDocument eventMessage(1024);
- 499 JsonObject header = eventMessage.createNestedObject(
"header");
- 500 header[
"payloadVersion"] = 2;
- 501 header[
"signatureVersion"] = 1;
-
- 503 JsonObject payload = eventMessage.createNestedObject(
"payload");
- 504 payload[
"action"] = action;
- 505 payload[
"cause"].createNestedObject(
"type");
- 506 payload[
"cause"][
"type"] = cause;
- 507 payload[
"createdAt"] = 0;
- 508 payload[
"deviceId"] = deviceId;
- 509 payload[
"replyToken"] = MessageID().getID();
- 510 payload[
"type"] =
"event";
- 511 payload.createNestedObject(
"value");
-
-
+
+ 506 _websocketListener.setRestoreDeviceStates(flag);
+
+
+ 509 DynamicJsonDocument SinricProClass::prepareResponse(JsonDocument& requestMessage) {
+ 510 DynamicJsonDocument responseMessage(1024);
+ 511 JsonObject header = responseMessage.createNestedObject(
"header");
+ 512 header[
"payloadVersion"] = 2;
+ 513 header[
"signatureVersion"] = 1;
- 515 #ifndef NOSINRIC_INSTANCE
-
-
-
-
-
+ 515 JsonObject payload = responseMessage.createNestedObject(
"payload");
+ 516 payload[
"action"] = requestMessage[
"payload"][
"action"];
+ 517 payload[
"clientId"] = requestMessage[
"payload"][
"clientId"];
+ 518 payload[
"createdAt"] = 0;
+ 519 payload[
"deviceId"] = requestMessage[
"payload"][
"deviceId"];
+ 520 payload[
"message"] =
"OK";
+ 521 payload[
"replyToken"] = requestMessage[
"payload"][
"replyToken"];
+ 522 payload[
"success"] =
false;
+ 523 payload[
"type"] =
"response";
+ 524 payload.createNestedObject(
"value");
+ 525 return responseMessage;
+
+
+
+ 529 DynamicJsonDocument SinricProClass::prepareEvent(
const char* deviceId,
const char* action,
const char* cause) {
+ 530 DynamicJsonDocument eventMessage(1024);
+ 531 JsonObject header = eventMessage.createNestedObject(
"header");
+ 532 header[
"payloadVersion"] = 2;
+ 533 header[
"signatureVersion"] = 1;
+
+ 535 JsonObject payload = eventMessage.createNestedObject(
"payload");
+ 536 payload[
"action"] = action;
+ 537 payload[
"cause"].createNestedObject(
"type");
+ 538 payload[
"cause"][
"type"] = cause;
+ 539 payload[
"createdAt"] = 0;
+ 540 payload[
"deviceId"] = deviceId;
+ 541 payload[
"replyToken"] = MessageID().getID();
+ 542 payload[
"type"] =
"event";
+ 543 payload.createNestedObject(
"value");
+
+
+
+ 547 #ifndef NOSINRIC_INSTANCE
+
+
+
+
+
-void handle()
Handles communication between device and SinricPro Server.
Definition: SinricPro.h:224
-void restoreDeviceStates(bool flag)
Enable / disable restore device states function.
Definition: SinricPro.h:473
-proxy operator[](const String deviceId)
operator[] is used tor create a new device instance or get an existing device instance
Definition: SinricPro.h:70
-void begin(String socketAuthToken, String signingKey, String serverURL=SINRICPRO_SERVER_URL)
Initializing SinricProClass to be able to connect to SinricPro Server.
Definition: SinricPro.h:157
+void onConnected(ConnectedCallbackHandler cb)
Set callback function for websocket connected event.
Definition: SinricPro.h:422
+void handle()
Handles communication between device and SinricPro Server.
Definition: SinricPro.h:239
+void onDisconnected(DisconnectedCallbackHandler cb)
Set callback function for websocket disconnected event.
Definition: SinricPro.h:435
+void restoreDeviceStates(bool flag)
Enable / disable restore device states function.
Definition: SinricPro.h:505
+std::function< void(void)> DisconnectedCallbackHandler
Callback definition for onDisconnected function.
Definition: SinricPro.h:50
+proxy operator[](const String deviceId)
operator[] is used tor create a new device instance or get an existing device instance
Definition: SinricPro.h:85
+void begin(String socketAuthToken, String signingKey, String serverURL=SINRICPRO_SERVER_URL)
Initializing SinricProClass to be able to connect to SinricPro Server.
Definition: SinricPro.h:172
+std::function< void(void)> ConnectedCallbackHandler
Callback definition for onConnected function.
Definition: SinricPro.h:42
The main class of this library, handling communication between SinricPro Server and your devices.
Definition: SinricPro.h:23
The main instance of SinricProClass.
diff --git a/docs/_sinric_pro_config_8h_source.html b/docs/_sinric_pro_config_8h_source.html
index d2ccd46..00a29d6 100644
--- a/docs/_sinric_pro_config_8h_source.html
+++ b/docs/_sinric_pro_config_8h_source.html
@@ -133,7 +133,7 @@
26 #define SINRICPRO_VERSION_MAJOR 2
27 #define SINRICPRO_VERSION_MINOR 2
- 28 #define SINRICPRO_VERSION_REVISION 6
+ 28 #define SINRICPRO_VERSION_REVISION 7
29 #define SINRICPRO_VERSION STR(SINRICPRO_VERSION_MAJOR) "." STR(SINRICPRO_VERSION_MINOR) "." STR(SINRICPRO_VERSION_REVISION)
diff --git a/docs/class_sinric_pro_class-members.html b/docs/class_sinric_pro_class-members.html
index ef0dbab..ffc6766 100644
--- a/docs/class_sinric_pro_class-members.html
+++ b/docs/class_sinric_pro_class-members.html
@@ -118,7 +118,11 @@
This is the complete list of members for SinricProClass, including all inherited members.
diff --git a/docs/class_sinric_pro_class.html b/docs/class_sinric_pro_class.html
index 54f8464..4325b66 100644
--- a/docs/class_sinric_pro_class.html
+++ b/docs/class_sinric_pro_class.html
@@ -111,6 +111,7 @@
+
+◆ onConnected()
+
+
+
+
+
Set callback function for websocket connected event.
+
- Parameters
-
+
+ | cb | Function pointer to a ConnectedCallbackHandler function |
+
+
+
+
- Returns
- void
+
- See also
- ConnectedCallbackHandler
+
+Example-Code
+
SinricPro.onConnected([](){ Serial.printf(
"Connected to SinricPro\r\n"); });
+
+
+
+
+◆ onDisconnected()
+
+
+
+
+
Set callback function for websocket disconnected event.
+
- Parameters
-
+
+ | cb | Function pointer to a DisconnectedCallbackHandler function |
+
+
+
+
- Returns
- void
+
- See also
- DisconnectedCallbackHandler
+
+Example-Code
+
SinricPro.onDisconnected([](){ Serial.printf(
"Disconnected from SinricPro\r\n"); });
+
+
+
◆ operator[]()
diff --git a/docs/class_sinric_pro_class.js b/docs/class_sinric_pro_class.js
index fdaf5a4..407106f 100644
--- a/docs/class_sinric_pro_class.js
+++ b/docs/class_sinric_pro_class.js
@@ -5,8 +5,12 @@ var class_sinric_pro_class =
[ "Define callback routine(s)", "index.html#autotoc_md13", null ],
[ "In setup()", "index.html#autotoc_md14", null ],
[ "In loop()", "index.html#autotoc_md15", null ],
+ [ "ConnectedCallbackHandler", "class_sinric_pro_class.html#a4d7d8547a83d53c20cbd9aa7768e99f5", null ],
+ [ "DisconnectedCallbackHandler", "class_sinric_pro_class.html#ad84930f3c26ac3692cc885be197d39c7", null ],
[ "begin", "class_sinric_pro_class.html#a57722dec8f1f987f57c8fff9eed66765", null ],
[ "handle", "class_sinric_pro_class.html#a37c2d0658e498b1bf878f8a3d9a7c5b4", null ],
+ [ "onConnected", "class_sinric_pro_class.html#ac33a355adfc413d4ff36974d735115bd", null ],
+ [ "onDisconnected", "class_sinric_pro_class.html#a654bb017ca55b448d55bb36e0346f38a", null ],
[ "operator[]", "class_sinric_pro_class.html#a5df2137b8d06e894c917fd28c35c31a4", null ],
[ "restoreDeviceStates", "class_sinric_pro_class.html#a27a9bb7f1e8bde0f39398649493b6f93", null ]
];
\ No newline at end of file
diff --git a/docs/functions.html b/docs/functions.html
index be78195..05c160c 100644
--- a/docs/functions.html
+++ b/docs/functions.html
@@ -184,6 +184,9 @@ - c -
@@ -191,6 +194,9 @@ - d -
@@ -267,9 +273,15 @@ - o -
- onColorTemperature()
: SinricProLight
+- onConnected()
+: SinricProClass
+
- onDecreaseColorTemperature()
: SinricProLight
+- onDisconnected()
+: SinricProClass
+
- onIncreaseColorTemperature()
: SinricProLight
diff --git a/docs/functions_func.html b/docs/functions_func.html
index db0949f..b17d6fb 100644
--- a/docs/functions_func.html
+++ b/docs/functions_func.html
@@ -179,9 +179,15 @@ - o -
- onColorTemperature()
: SinricProLight
+- onConnected()
+: SinricProClass
+
- onDecreaseColorTemperature()
: SinricProLight
+- onDisconnected()
+: SinricProClass
+
- onIncreaseColorTemperature()
: SinricProLight
diff --git a/docs/functions_type.html b/docs/functions_type.html
index f548a7c..5c54e51 100644
--- a/docs/functions_type.html
+++ b/docs/functions_type.html
@@ -179,6 +179,9 @@ - c -
@@ -186,6 +189,9 @@ - d -
diff --git a/docs/index.html b/docs/index.html
index ac22721..ee6c5bb 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -107,7 +107,7 @@
-Version 2.2.6
+Version 2.2.7
Installation
@@ -119,7 +119,7 @@
- Install SinricPro library by using Library Manager
-
- Use included platformio.ini files from examples to ensure that all dependent libraries will installed automaticly.
+
- Use included platformio.ini file from examples to ensure that all dependent libraries will installed automaticly.

@@ -143,20 +143,7 @@
Examples
-
+
See examples on GitHub
Usage
@@ -234,7 +221,7 @@
Full user documentation
-
Please see full user documentation here https://sinricpro.github.io/esp8266-esp32-sdk
+
Please see here for full user documentation
diff --git a/docs/navtreedata.js b/docs/navtreedata.js
index 96ea0eb..fec7438 100644
--- a/docs/navtreedata.js
+++ b/docs/navtreedata.js
@@ -24,7 +24,7 @@ var NAVTREE =
[
[ "SinricPro Library", "index.html", [
[ "SinricPro (ESP8266 / ESP32 SDK)", "index.html", [
- [ "Version 2.2.6", "index.html#autotoc_md1", null ],
+ [ "Version 2.2.7", "index.html#autotoc_md1", null ],
[ "Installation", "index.html#autotoc_md2", [
[ "VS Code & PlatformIO:", "index.html#autotoc_md3", null ],
[ "ArduinoIDE", "index.html#autotoc_md4", null ]
diff --git a/docs/navtreeindex0.js b/docs/navtreeindex0.js
index 9976fb7..2ff0d98 100644
--- a/docs/navtreeindex0.js
+++ b/docs/navtreeindex0.js
@@ -3,10 +3,14 @@ var NAVTREEINDEX0 =
"annotated.html":[1,0],
"class_sinric_pro.html":[1,0,0],
"class_sinric_pro_class.html":[1,0,1],
-"class_sinric_pro_class.html#a27a9bb7f1e8bde0f39398649493b6f93":[1,0,1,8],
-"class_sinric_pro_class.html#a37c2d0658e498b1bf878f8a3d9a7c5b4":[1,0,1,6],
-"class_sinric_pro_class.html#a57722dec8f1f987f57c8fff9eed66765":[1,0,1,5],
-"class_sinric_pro_class.html#a5df2137b8d06e894c917fd28c35c31a4":[1,0,1,7],
+"class_sinric_pro_class.html#a27a9bb7f1e8bde0f39398649493b6f93":[1,0,1,12],
+"class_sinric_pro_class.html#a37c2d0658e498b1bf878f8a3d9a7c5b4":[1,0,1,8],
+"class_sinric_pro_class.html#a4d7d8547a83d53c20cbd9aa7768e99f5":[1,0,1,5],
+"class_sinric_pro_class.html#a57722dec8f1f987f57c8fff9eed66765":[1,0,1,7],
+"class_sinric_pro_class.html#a5df2137b8d06e894c917fd28c35c31a4":[1,0,1,11],
+"class_sinric_pro_class.html#a654bb017ca55b448d55bb36e0346f38a":[1,0,1,10],
+"class_sinric_pro_class.html#ac33a355adfc413d4ff36974d735115bd":[1,0,1,9],
+"class_sinric_pro_class.html#ad84930f3c26ac3692cc885be197d39c7":[1,0,1,6],
"class_sinric_pro_contactsensor.html":[1,0,2],
"class_sinric_pro_contactsensor.html#a0b4b9006c0be003c615848bcc2b690fd":[1,0,2,2],
"class_sinric_pro_contactsensor.html#a32f3257da431a1035f23a265ff0cc4cf":[1,0,2,1],
@@ -174,8 +178,8 @@ var NAVTREEINDEX0 =
"functions_func.html":[1,3,1],
"functions_type.html":[1,3,2],
"hierarchy.html":[1,2],
-"index.html":[],
"index.html":[0],
+"index.html":[],
"index.html#autotoc_md1":[0,0],
"index.html#autotoc_md10":[0,4],
"index.html#autotoc_md11":[0],
diff --git a/docs/search/all_2.js b/docs/search/all_2.js
index 46961e2..85fdd08 100644
--- a/docs/search/all_2.js
+++ b/docs/search/all_2.js
@@ -3,5 +3,6 @@ var searchData=
['changechannelcallback_8',['ChangeChannelCallback',['../class_sinric_pro_t_v.html#a276a4a418aa341936a2e8870cac15e79',1,'SinricProTV']]],
['changechannelnumbercallback_9',['ChangeChannelNumberCallback',['../class_sinric_pro_t_v.html#aed91a90de7d42e34af4a0d995e8b525b',1,'SinricProTV']]],
['colorcallback_10',['ColorCallback',['../class_sinric_pro_light.html#a916ceb3c8ef5094cc578f739b2d9edca',1,'SinricProLight']]],
- ['colortemperaturecallback_11',['ColorTemperatureCallback',['../class_sinric_pro_light.html#ac46e0327976c2cb38b6e97110763de5f',1,'SinricProLight']]]
+ ['colortemperaturecallback_11',['ColorTemperatureCallback',['../class_sinric_pro_light.html#ac46e0327976c2cb38b6e97110763de5f',1,'SinricProLight']]],
+ ['connectedcallbackhandler_12',['ConnectedCallbackHandler',['../class_sinric_pro_class.html#a4d7d8547a83d53c20cbd9aa7768e99f5',1,'SinricProClass']]]
];
diff --git a/docs/search/all_3.js b/docs/search/all_3.js
index 7b816b0..eeac7e2 100644
--- a/docs/search/all_3.js
+++ b/docs/search/all_3.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['decreasecolortemperaturecallback_12',['DecreaseColorTemperatureCallback',['../class_sinric_pro_light.html#a8fce91e931713aa452fb7bd0805e3c81',1,'SinricProLight']]]
+ ['decreasecolortemperaturecallback_13',['DecreaseColorTemperatureCallback',['../class_sinric_pro_light.html#a8fce91e931713aa452fb7bd0805e3c81',1,'SinricProLight']]],
+ ['disconnectedcallbackhandler_14',['DisconnectedCallbackHandler',['../class_sinric_pro_class.html#ad84930f3c26ac3692cc885be197d39c7',1,'SinricProClass']]]
];
diff --git a/docs/search/all_4.js b/docs/search/all_4.js
index 7aef0f3..73c74b1 100644
--- a/docs/search/all_4.js
+++ b/docs/search/all_4.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['handle_13',['handle',['../class_sinric_pro_class.html#a37c2d0658e498b1bf878f8a3d9a7c5b4',1,'SinricProClass']]]
+ ['handle_15',['handle',['../class_sinric_pro_class.html#a37c2d0658e498b1bf878f8a3d9a7c5b4',1,'SinricProClass']]]
];
diff --git a/docs/search/all_5.js b/docs/search/all_5.js
index b351473..4014d42 100644
--- a/docs/search/all_5.js
+++ b/docs/search/all_5.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['increasecolortemperaturecallback_14',['IncreaseColorTemperatureCallback',['../class_sinric_pro_light.html#ac29cb175180abefcc181191de6be6c9f',1,'SinricProLight']]]
+ ['increasecolortemperaturecallback_16',['IncreaseColorTemperatureCallback',['../class_sinric_pro_light.html#ac29cb175180abefcc181191de6be6c9f',1,'SinricProLight']]]
];
diff --git a/docs/search/all_6.js b/docs/search/all_6.js
index ad91458..bde4dd5 100644
--- a/docs/search/all_6.js
+++ b/docs/search/all_6.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['lockstatecallback_15',['LockStateCallback',['../class_sinric_pro_lock.html#a2e4171a3cfcd3a87584fc114782ed4d8',1,'SinricProLock']]]
+ ['lockstatecallback_17',['LockStateCallback',['../class_sinric_pro_lock.html#a2e4171a3cfcd3a87584fc114782ed4d8',1,'SinricProLock']]]
];
diff --git a/docs/search/all_7.js b/docs/search/all_7.js
index 291fd30..925e886 100644
--- a/docs/search/all_7.js
+++ b/docs/search/all_7.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['mediacontrolcallback_16',['MediaControlCallback',['../class_sinric_pro_speaker.html#a19062c8b2786a85d53129d572ec55bbd',1,'SinricProSpeaker::MediaControlCallback()'],['../class_sinric_pro_t_v.html#a19062c8b2786a85d53129d572ec55bbd',1,'SinricProTV::MediaControlCallback()']]],
- ['modecallback_17',['ModeCallback',['../class_sinric_pro_speaker.html#affad86b6a5068090c860b36d26280d49',1,'SinricProSpeaker']]],
- ['mutecallback_18',['MuteCallback',['../class_sinric_pro_speaker.html#a24d0844497c30b03f3c7ec9e30fcb33b',1,'SinricProSpeaker::MuteCallback()'],['../class_sinric_pro_t_v.html#a24d0844497c30b03f3c7ec9e30fcb33b',1,'SinricProTV::MuteCallback()']]]
+ ['mediacontrolcallback_18',['MediaControlCallback',['../class_sinric_pro_speaker.html#a19062c8b2786a85d53129d572ec55bbd',1,'SinricProSpeaker::MediaControlCallback()'],['../class_sinric_pro_t_v.html#a19062c8b2786a85d53129d572ec55bbd',1,'SinricProTV::MediaControlCallback()']]],
+ ['modecallback_19',['ModeCallback',['../class_sinric_pro_speaker.html#affad86b6a5068090c860b36d26280d49',1,'SinricProSpeaker']]],
+ ['mutecallback_20',['MuteCallback',['../class_sinric_pro_speaker.html#a24d0844497c30b03f3c7ec9e30fcb33b',1,'SinricProSpeaker::MuteCallback()'],['../class_sinric_pro_t_v.html#a24d0844497c30b03f3c7ec9e30fcb33b',1,'SinricProTV::MuteCallback()']]]
];
diff --git a/docs/search/all_8.js b/docs/search/all_8.js
index 12fe6b5..9b3dea3 100644
--- a/docs/search/all_8.js
+++ b/docs/search/all_8.js
@@ -1,31 +1,33 @@
var searchData=
[
- ['onadjustbands_19',['onAdjustBands',['../class_sinric_pro_speaker.html#a41a5c1506545c44c2408054a8675c7a8',1,'SinricProSpeaker']]],
- ['onadjustbrightness_20',['onAdjustBrightness',['../class_sinric_pro_light.html#a0633e5fa2981189f4a093bab00a8c7f1',1,'SinricProLight']]],
- ['onadjustpowerlevel_21',['onAdjustPowerLevel',['../class_sinric_pro_dim_switch.html#a13b10bdb1844babe4de320fff9172d96',1,'SinricProDimSwitch']]],
- ['onadjustrangevalue_22',['onAdjustRangeValue',['../class_sinric_pro_fan_u_s.html#ae85696d55112ae7343f9807faee6e064',1,'SinricProFanUS::onAdjustRangeValue()'],['../class_sinric_pro_window_a_c.html#ae85696d55112ae7343f9807faee6e064',1,'SinricProWindowAC::onAdjustRangeValue()']]],
- ['onadjusttargettemperature_23',['onAdjustTargetTemperature',['../class_sinric_pro_thermostat.html#ac51f6fecfdf4c7bc8e0712e2da47bbf4',1,'SinricProThermostat::onAdjustTargetTemperature()'],['../class_sinric_pro_window_a_c.html#ac51f6fecfdf4c7bc8e0712e2da47bbf4',1,'SinricProWindowAC::onAdjustTargetTemperature()']]],
- ['onadjustvolume_24',['onAdjustVolume',['../class_sinric_pro_speaker.html#a2c868c87f96e3924c8b309e1bcfb507e',1,'SinricProSpeaker::onAdjustVolume()'],['../class_sinric_pro_t_v.html#a2c868c87f96e3924c8b309e1bcfb507e',1,'SinricProTV::onAdjustVolume()']]],
- ['onbrightness_25',['onBrightness',['../class_sinric_pro_light.html#abbaab3067b1fcdcc5928451b818a4420',1,'SinricProLight']]],
- ['onchangechannel_26',['onChangeChannel',['../class_sinric_pro_t_v.html#a92f3b83744b5bb82d32628eef39c1eb9',1,'SinricProTV']]],
- ['onchangechannelnumber_27',['onChangeChannelNumber',['../class_sinric_pro_t_v.html#afd8aee20590bfadec181c6ee515125ec',1,'SinricProTV']]],
- ['oncolor_28',['onColor',['../class_sinric_pro_light.html#a059ff103149869b7c49cdb8911875b7b',1,'SinricProLight']]],
- ['oncolortemperature_29',['onColorTemperature',['../class_sinric_pro_light.html#a8535c44fd2517ed09ebe6a203cc25b67',1,'SinricProLight']]],
- ['ondecreasecolortemperature_30',['onDecreaseColorTemperature',['../class_sinric_pro_light.html#a7468976e7fffeee14cc869b7236cbb50',1,'SinricProLight']]],
- ['onincreasecolortemperature_31',['onIncreaseColorTemperature',['../class_sinric_pro_light.html#a7ea9fd9861a5668a41d06267bfbec82a',1,'SinricProLight']]],
- ['onlockstate_32',['onLockState',['../class_sinric_pro_lock.html#aee42cc397234a454fd353ca6bc12a859',1,'SinricProLock']]],
- ['onmediacontrol_33',['onMediaControl',['../class_sinric_pro_speaker.html#afc2620621377fff928737b5a8a537020',1,'SinricProSpeaker::onMediaControl()'],['../class_sinric_pro_t_v.html#afc2620621377fff928737b5a8a537020',1,'SinricProTV::onMediaControl()']]],
- ['onmute_34',['onMute',['../class_sinric_pro_speaker.html#ab5fc79cc8903c3ccc1c106abf61d7cfd',1,'SinricProSpeaker::onMute()'],['../class_sinric_pro_t_v.html#ab5fc79cc8903c3ccc1c106abf61d7cfd',1,'SinricProTV::onMute()']]],
- ['onpowerlevel_35',['onPowerLevel',['../class_sinric_pro_dim_switch.html#a0685d34694badb4442fed6b69b69b366',1,'SinricProDimSwitch']]],
- ['onpowerstate_36',['onPowerState',['../class_sinric_pro_device.html#a32f3257da431a1035f23a265ff0cc4cf',1,'SinricProDevice']]],
- ['onrangevalue_37',['onRangeValue',['../class_sinric_pro_fan_u_s.html#a94adbcdf6ce61cb6552a5f9915e705ae',1,'SinricProFanUS::onRangeValue()'],['../class_sinric_pro_window_a_c.html#a94adbcdf6ce61cb6552a5f9915e705ae',1,'SinricProWindowAC::onRangeValue()']]],
- ['onresetbands_38',['onResetBands',['../class_sinric_pro_speaker.html#aa6c3aabc2b442d82ac5456ccaac3f60d',1,'SinricProSpeaker']]],
- ['onselectinput_39',['onSelectInput',['../class_sinric_pro_t_v.html#a18f8f71ecf0d7292a63d9486f94e5180',1,'SinricProTV']]],
- ['onsetbands_40',['onSetBands',['../class_sinric_pro_speaker.html#a4aaa7a29394560be7537a86b0304d199',1,'SinricProSpeaker']]],
- ['onsetmode_41',['onSetMode',['../class_sinric_pro_speaker.html#ada087c948c3ab923bdb7818daa6b2b79',1,'SinricProSpeaker']]],
- ['onsetvolume_42',['onSetVolume',['../class_sinric_pro_speaker.html#a5db8c85f222debbece54c794015f9402',1,'SinricProSpeaker::onSetVolume()'],['../class_sinric_pro_t_v.html#a5db8c85f222debbece54c794015f9402',1,'SinricProTV::onSetVolume()']]],
- ['onskipchannels_43',['onSkipChannels',['../class_sinric_pro_t_v.html#ab1123d03d471fad4896eb2960ed41855',1,'SinricProTV']]],
- ['ontargettemperature_44',['onTargetTemperature',['../class_sinric_pro_thermostat.html#a1c73725f1f3fbb1c5b72208aae5c2bf2',1,'SinricProThermostat::onTargetTemperature()'],['../class_sinric_pro_window_a_c.html#a1c73725f1f3fbb1c5b72208aae5c2bf2',1,'SinricProWindowAC::onTargetTemperature()']]],
- ['onthermostatmode_45',['onThermostatMode',['../class_sinric_pro_thermostat.html#a2ef31536973b20815dd6c80a28e19c9f',1,'SinricProThermostat::onThermostatMode()'],['../class_sinric_pro_window_a_c.html#a2ef31536973b20815dd6c80a28e19c9f',1,'SinricProWindowAC::onThermostatMode()']]],
- ['operator_5b_5d_46',['operator[]',['../class_sinric_pro_class.html#a5df2137b8d06e894c917fd28c35c31a4',1,'SinricProClass']]]
+ ['onadjustbands_21',['onAdjustBands',['../class_sinric_pro_speaker.html#a41a5c1506545c44c2408054a8675c7a8',1,'SinricProSpeaker']]],
+ ['onadjustbrightness_22',['onAdjustBrightness',['../class_sinric_pro_light.html#a0633e5fa2981189f4a093bab00a8c7f1',1,'SinricProLight']]],
+ ['onadjustpowerlevel_23',['onAdjustPowerLevel',['../class_sinric_pro_dim_switch.html#a13b10bdb1844babe4de320fff9172d96',1,'SinricProDimSwitch']]],
+ ['onadjustrangevalue_24',['onAdjustRangeValue',['../class_sinric_pro_fan_u_s.html#ae85696d55112ae7343f9807faee6e064',1,'SinricProFanUS::onAdjustRangeValue()'],['../class_sinric_pro_window_a_c.html#ae85696d55112ae7343f9807faee6e064',1,'SinricProWindowAC::onAdjustRangeValue()']]],
+ ['onadjusttargettemperature_25',['onAdjustTargetTemperature',['../class_sinric_pro_thermostat.html#ac51f6fecfdf4c7bc8e0712e2da47bbf4',1,'SinricProThermostat::onAdjustTargetTemperature()'],['../class_sinric_pro_window_a_c.html#ac51f6fecfdf4c7bc8e0712e2da47bbf4',1,'SinricProWindowAC::onAdjustTargetTemperature()']]],
+ ['onadjustvolume_26',['onAdjustVolume',['../class_sinric_pro_speaker.html#a2c868c87f96e3924c8b309e1bcfb507e',1,'SinricProSpeaker::onAdjustVolume()'],['../class_sinric_pro_t_v.html#a2c868c87f96e3924c8b309e1bcfb507e',1,'SinricProTV::onAdjustVolume()']]],
+ ['onbrightness_27',['onBrightness',['../class_sinric_pro_light.html#abbaab3067b1fcdcc5928451b818a4420',1,'SinricProLight']]],
+ ['onchangechannel_28',['onChangeChannel',['../class_sinric_pro_t_v.html#a92f3b83744b5bb82d32628eef39c1eb9',1,'SinricProTV']]],
+ ['onchangechannelnumber_29',['onChangeChannelNumber',['../class_sinric_pro_t_v.html#afd8aee20590bfadec181c6ee515125ec',1,'SinricProTV']]],
+ ['oncolor_30',['onColor',['../class_sinric_pro_light.html#a059ff103149869b7c49cdb8911875b7b',1,'SinricProLight']]],
+ ['oncolortemperature_31',['onColorTemperature',['../class_sinric_pro_light.html#a8535c44fd2517ed09ebe6a203cc25b67',1,'SinricProLight']]],
+ ['onconnected_32',['onConnected',['../class_sinric_pro_class.html#ac33a355adfc413d4ff36974d735115bd',1,'SinricProClass']]],
+ ['ondecreasecolortemperature_33',['onDecreaseColorTemperature',['../class_sinric_pro_light.html#a7468976e7fffeee14cc869b7236cbb50',1,'SinricProLight']]],
+ ['ondisconnected_34',['onDisconnected',['../class_sinric_pro_class.html#a654bb017ca55b448d55bb36e0346f38a',1,'SinricProClass']]],
+ ['onincreasecolortemperature_35',['onIncreaseColorTemperature',['../class_sinric_pro_light.html#a7ea9fd9861a5668a41d06267bfbec82a',1,'SinricProLight']]],
+ ['onlockstate_36',['onLockState',['../class_sinric_pro_lock.html#aee42cc397234a454fd353ca6bc12a859',1,'SinricProLock']]],
+ ['onmediacontrol_37',['onMediaControl',['../class_sinric_pro_speaker.html#afc2620621377fff928737b5a8a537020',1,'SinricProSpeaker::onMediaControl()'],['../class_sinric_pro_t_v.html#afc2620621377fff928737b5a8a537020',1,'SinricProTV::onMediaControl()']]],
+ ['onmute_38',['onMute',['../class_sinric_pro_speaker.html#ab5fc79cc8903c3ccc1c106abf61d7cfd',1,'SinricProSpeaker::onMute()'],['../class_sinric_pro_t_v.html#ab5fc79cc8903c3ccc1c106abf61d7cfd',1,'SinricProTV::onMute()']]],
+ ['onpowerlevel_39',['onPowerLevel',['../class_sinric_pro_dim_switch.html#a0685d34694badb4442fed6b69b69b366',1,'SinricProDimSwitch']]],
+ ['onpowerstate_40',['onPowerState',['../class_sinric_pro_device.html#a32f3257da431a1035f23a265ff0cc4cf',1,'SinricProDevice']]],
+ ['onrangevalue_41',['onRangeValue',['../class_sinric_pro_fan_u_s.html#a94adbcdf6ce61cb6552a5f9915e705ae',1,'SinricProFanUS::onRangeValue()'],['../class_sinric_pro_window_a_c.html#a94adbcdf6ce61cb6552a5f9915e705ae',1,'SinricProWindowAC::onRangeValue()']]],
+ ['onresetbands_42',['onResetBands',['../class_sinric_pro_speaker.html#aa6c3aabc2b442d82ac5456ccaac3f60d',1,'SinricProSpeaker']]],
+ ['onselectinput_43',['onSelectInput',['../class_sinric_pro_t_v.html#a18f8f71ecf0d7292a63d9486f94e5180',1,'SinricProTV']]],
+ ['onsetbands_44',['onSetBands',['../class_sinric_pro_speaker.html#a4aaa7a29394560be7537a86b0304d199',1,'SinricProSpeaker']]],
+ ['onsetmode_45',['onSetMode',['../class_sinric_pro_speaker.html#ada087c948c3ab923bdb7818daa6b2b79',1,'SinricProSpeaker']]],
+ ['onsetvolume_46',['onSetVolume',['../class_sinric_pro_speaker.html#a5db8c85f222debbece54c794015f9402',1,'SinricProSpeaker::onSetVolume()'],['../class_sinric_pro_t_v.html#a5db8c85f222debbece54c794015f9402',1,'SinricProTV::onSetVolume()']]],
+ ['onskipchannels_47',['onSkipChannels',['../class_sinric_pro_t_v.html#ab1123d03d471fad4896eb2960ed41855',1,'SinricProTV']]],
+ ['ontargettemperature_48',['onTargetTemperature',['../class_sinric_pro_thermostat.html#a1c73725f1f3fbb1c5b72208aae5c2bf2',1,'SinricProThermostat::onTargetTemperature()'],['../class_sinric_pro_window_a_c.html#a1c73725f1f3fbb1c5b72208aae5c2bf2',1,'SinricProWindowAC::onTargetTemperature()']]],
+ ['onthermostatmode_49',['onThermostatMode',['../class_sinric_pro_thermostat.html#a2ef31536973b20815dd6c80a28e19c9f',1,'SinricProThermostat::onThermostatMode()'],['../class_sinric_pro_window_a_c.html#a2ef31536973b20815dd6c80a28e19c9f',1,'SinricProWindowAC::onThermostatMode()']]],
+ ['operator_5b_5d_50',['operator[]',['../class_sinric_pro_class.html#a5df2137b8d06e894c917fd28c35c31a4',1,'SinricProClass']]]
];
diff --git a/docs/search/all_9.js b/docs/search/all_9.js
index 9ff7eee..85eb459 100644
--- a/docs/search/all_9.js
+++ b/docs/search/all_9.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['powerstatecallback_47',['PowerStateCallback',['../class_sinric_pro_device.html#aa9db92ebe40a0df6deb43eba70d3dea3',1,'SinricProDevice']]]
+ ['powerstatecallback_51',['PowerStateCallback',['../class_sinric_pro_device.html#aa9db92ebe40a0df6deb43eba70d3dea3',1,'SinricProDevice']]]
];
diff --git a/docs/search/all_a.js b/docs/search/all_a.js
index c8ff0ae..facdc1d 100644
--- a/docs/search/all_a.js
+++ b/docs/search/all_a.js
@@ -1,5 +1,5 @@
var searchData=
[
- ['resetbandscallback_48',['ResetBandsCallback',['../class_sinric_pro_speaker.html#ae1ec62ffbf9d7f00df9760819305782e',1,'SinricProSpeaker']]],
- ['restoredevicestates_49',['restoreDeviceStates',['../class_sinric_pro_class.html#a27a9bb7f1e8bde0f39398649493b6f93',1,'SinricProClass']]]
+ ['resetbandscallback_52',['ResetBandsCallback',['../class_sinric_pro_speaker.html#ae1ec62ffbf9d7f00df9760819305782e',1,'SinricProSpeaker']]],
+ ['restoredevicestates_53',['restoreDeviceStates',['../class_sinric_pro_class.html#a27a9bb7f1e8bde0f39398649493b6f93',1,'SinricProClass']]]
];
diff --git a/docs/search/all_b.js b/docs/search/all_b.js
index 63645c7..667ab90 100644
--- a/docs/search/all_b.js
+++ b/docs/search/all_b.js
@@ -1,48 +1,48 @@
var searchData=
[
- ['sinricpro_20_28esp8266_20_2f_20esp32_20sdk_29_50',['SinricPro (ESP8266 / ESP32 SDK)',['../index.html',1,'']]],
- ['selectinputcallback_51',['SelectInputCallback',['../class_sinric_pro_t_v.html#a047ecacb194f2ad747fa2ab7e1117a88',1,'SinricProTV']]],
- ['sendbandsevent_52',['sendBandsEvent',['../class_sinric_pro_speaker.html#a4ad5674e36d96a73147388251b794c82',1,'SinricProSpeaker']]],
- ['sendbrightnessevent_53',['sendBrightnessEvent',['../class_sinric_pro_light.html#aa42df8ac91de826653626df67a8500b6',1,'SinricProLight']]],
- ['sendchangechannelevent_54',['sendChangeChannelEvent',['../class_sinric_pro_t_v.html#aa85e049284116b157e34159624680ae1',1,'SinricProTV']]],
- ['sendcolorevent_55',['sendColorEvent',['../class_sinric_pro_light.html#aa3019d161b320267666cdb11d1c3d827',1,'SinricProLight']]],
- ['sendcolortemperatureevent_56',['sendColorTemperatureEvent',['../class_sinric_pro_light.html#a9065e6d08309d313b16adc774cc642ff',1,'SinricProLight']]],
- ['sendcontactevent_57',['sendContactEvent',['../class_sinric_pro_contactsensor.html#a0b4b9006c0be003c615848bcc2b690fd',1,'SinricProContactsensor']]],
- ['senddoorbellevent_58',['sendDoorbellEvent',['../class_sinric_pro_doorbell.html#a084a5475db7127784c452deb3a080f62',1,'SinricProDoorbell']]],
- ['sendlockstateevent_59',['sendLockStateEvent',['../class_sinric_pro_lock.html#a3795d2fa1b8474239f46493915e70f1c',1,'SinricProLock']]],
- ['sendmediacontrolevent_60',['sendMediaControlEvent',['../class_sinric_pro_speaker.html#af69dc08522c75d484deab14beafcd176',1,'SinricProSpeaker::sendMediaControlEvent()'],['../class_sinric_pro_t_v.html#af69dc08522c75d484deab14beafcd176',1,'SinricProTV::sendMediaControlEvent()']]],
- ['sendmodeevent_61',['sendModeEvent',['../class_sinric_pro_speaker.html#a6ddd0a2abe7ab6d46e786057694ebb49',1,'SinricProSpeaker']]],
- ['sendmotionevent_62',['sendMotionEvent',['../class_sinric_pro_motionsensor.html#ab28a28a17768a38eea033ba700095672',1,'SinricProMotionsensor']]],
- ['sendmuteevent_63',['sendMuteEvent',['../class_sinric_pro_speaker.html#abc47e827f33ac8bcc43ed204c7c4b8fd',1,'SinricProSpeaker::sendMuteEvent()'],['../class_sinric_pro_t_v.html#abc47e827f33ac8bcc43ed204c7c4b8fd',1,'SinricProTV::sendMuteEvent()']]],
- ['sendpowerlevelevent_64',['sendPowerLevelEvent',['../class_sinric_pro_dim_switch.html#aaf81884c1f690ff2dd8862e192b8bbfa',1,'SinricProDimSwitch']]],
- ['sendpowerstateevent_65',['sendPowerStateEvent',['../class_sinric_pro_device.html#a8006e256414deac0f9a4e28774b47773',1,'SinricProDevice']]],
- ['sendrangevalueevent_66',['sendRangeValueEvent',['../class_sinric_pro_fan_u_s.html#af676bb2b419c4321d0a678cf9446da0c',1,'SinricProFanUS::sendRangeValueEvent()'],['../class_sinric_pro_window_a_c.html#af676bb2b419c4321d0a678cf9446da0c',1,'SinricProWindowAC::sendRangeValueEvent()']]],
- ['sendselectinputevent_67',['sendSelectInputEvent',['../class_sinric_pro_t_v.html#a8d79220a3a06331442d36524ceac1db3',1,'SinricProTV']]],
- ['sendtargettemperatureevent_68',['sendTargetTemperatureEvent',['../class_sinric_pro_thermostat.html#a07632bca425003b4ad559cb46fabca8c',1,'SinricProThermostat::sendTargetTemperatureEvent()'],['../class_sinric_pro_window_a_c.html#a07632bca425003b4ad559cb46fabca8c',1,'SinricProWindowAC::sendTargetTemperatureEvent()']]],
- ['sendtemperatureevent_69',['sendTemperatureEvent',['../class_sinric_pro_temperaturesensor.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProTemperaturesensor::sendTemperatureEvent()'],['../class_sinric_pro_thermostat.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProThermostat::sendTemperatureEvent()'],['../class_sinric_pro_window_a_c.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProWindowAC::sendTemperatureEvent()']]],
- ['sendthermostatmodeevent_70',['sendThermostatModeEvent',['../class_sinric_pro_thermostat.html#acd81e847a7f1029163729574c3d3971d',1,'SinricProThermostat::sendThermostatModeEvent()'],['../class_sinric_pro_window_a_c.html#acd81e847a7f1029163729574c3d3971d',1,'SinricProWindowAC::sendThermostatModeEvent()']]],
- ['sendvolumeevent_71',['sendVolumeEvent',['../class_sinric_pro_speaker.html#a0f301accc58742f867de88c66a5eb3c5',1,'SinricProSpeaker::sendVolumeEvent()'],['../class_sinric_pro_t_v.html#a0f301accc58742f867de88c66a5eb3c5',1,'SinricProTV::sendVolumeEvent()']]],
- ['setbandscallback_72',['SetBandsCallback',['../class_sinric_pro_speaker.html#a765ec6504ace15f556dbf2510ce93d0f',1,'SinricProSpeaker']]],
- ['setpowerlevelcallback_73',['SetPowerLevelCallback',['../class_sinric_pro_dim_switch.html#afbdda289acfd7d72c03bab3b69b42afd',1,'SinricProDimSwitch']]],
- ['setrangevaluecallback_74',['SetRangeValueCallback',['../class_sinric_pro_fan_u_s.html#ad2be7dbd98eae8443f8c76721cbffead',1,'SinricProFanUS::SetRangeValueCallback()'],['../class_sinric_pro_window_a_c.html#ad2be7dbd98eae8443f8c76721cbffead',1,'SinricProWindowAC::SetRangeValueCallback()']]],
- ['settargettemperaturecallback_75',['SetTargetTemperatureCallback',['../class_sinric_pro_thermostat.html#a345ea0fb9b4069b8c540b17009272f65',1,'SinricProThermostat::SetTargetTemperatureCallback()'],['../class_sinric_pro_window_a_c.html#a345ea0fb9b4069b8c540b17009272f65',1,'SinricProWindowAC::SetTargetTemperatureCallback()']]],
- ['setvolumecallback_76',['SetVolumeCallback',['../class_sinric_pro_speaker.html#aa495b90d483782760303ab45494deb7e',1,'SinricProSpeaker::SetVolumeCallback()'],['../class_sinric_pro_t_v.html#aa495b90d483782760303ab45494deb7e',1,'SinricProTV::SetVolumeCallback()']]],
- ['sinricpro_77',['SinricPro',['../class_sinric_pro.html',1,'']]],
- ['sinricproclass_78',['SinricProClass',['../class_sinric_pro_class.html',1,'']]],
- ['sinricprocontactsensor_79',['SinricProContactsensor',['../class_sinric_pro_contactsensor.html',1,'']]],
- ['sinricprodevice_80',['SinricProDevice',['../class_sinric_pro_device.html',1,'']]],
- ['sinricprodimswitch_81',['SinricProDimSwitch',['../class_sinric_pro_dim_switch.html',1,'']]],
- ['sinricprodoorbell_82',['SinricProDoorbell',['../class_sinric_pro_doorbell.html',1,'']]],
- ['sinricprofan_83',['SinricProFan',['../class_sinric_pro_fan.html',1,'']]],
- ['sinricprofanus_84',['SinricProFanUS',['../class_sinric_pro_fan_u_s.html',1,'']]],
- ['sinricprolight_85',['SinricProLight',['../class_sinric_pro_light.html',1,'']]],
- ['sinricprolock_86',['SinricProLock',['../class_sinric_pro_lock.html',1,'']]],
- ['sinricpromotionsensor_87',['SinricProMotionsensor',['../class_sinric_pro_motionsensor.html',1,'']]],
- ['sinricprospeaker_88',['SinricProSpeaker',['../class_sinric_pro_speaker.html',1,'']]],
- ['sinricproswitch_89',['SinricProSwitch',['../class_sinric_pro_switch.html',1,'']]],
- ['sinricprotemperaturesensor_90',['SinricProTemperaturesensor',['../class_sinric_pro_temperaturesensor.html',1,'']]],
- ['sinricprothermostat_91',['SinricProThermostat',['../class_sinric_pro_thermostat.html',1,'']]],
- ['sinricprotv_92',['SinricProTV',['../class_sinric_pro_t_v.html',1,'']]],
- ['sinricprowindowac_93',['SinricProWindowAC',['../class_sinric_pro_window_a_c.html',1,'']]],
- ['skipchannelscallback_94',['SkipChannelsCallback',['../class_sinric_pro_t_v.html#a955957998e893135fb04aa077304d3d6',1,'SinricProTV']]]
+ ['sinricpro_20_28esp8266_20_2f_20esp32_20sdk_29_54',['SinricPro (ESP8266 / ESP32 SDK)',['../index.html',1,'']]],
+ ['selectinputcallback_55',['SelectInputCallback',['../class_sinric_pro_t_v.html#a047ecacb194f2ad747fa2ab7e1117a88',1,'SinricProTV']]],
+ ['sendbandsevent_56',['sendBandsEvent',['../class_sinric_pro_speaker.html#a4ad5674e36d96a73147388251b794c82',1,'SinricProSpeaker']]],
+ ['sendbrightnessevent_57',['sendBrightnessEvent',['../class_sinric_pro_light.html#aa42df8ac91de826653626df67a8500b6',1,'SinricProLight']]],
+ ['sendchangechannelevent_58',['sendChangeChannelEvent',['../class_sinric_pro_t_v.html#aa85e049284116b157e34159624680ae1',1,'SinricProTV']]],
+ ['sendcolorevent_59',['sendColorEvent',['../class_sinric_pro_light.html#aa3019d161b320267666cdb11d1c3d827',1,'SinricProLight']]],
+ ['sendcolortemperatureevent_60',['sendColorTemperatureEvent',['../class_sinric_pro_light.html#a9065e6d08309d313b16adc774cc642ff',1,'SinricProLight']]],
+ ['sendcontactevent_61',['sendContactEvent',['../class_sinric_pro_contactsensor.html#a0b4b9006c0be003c615848bcc2b690fd',1,'SinricProContactsensor']]],
+ ['senddoorbellevent_62',['sendDoorbellEvent',['../class_sinric_pro_doorbell.html#a084a5475db7127784c452deb3a080f62',1,'SinricProDoorbell']]],
+ ['sendlockstateevent_63',['sendLockStateEvent',['../class_sinric_pro_lock.html#a3795d2fa1b8474239f46493915e70f1c',1,'SinricProLock']]],
+ ['sendmediacontrolevent_64',['sendMediaControlEvent',['../class_sinric_pro_speaker.html#af69dc08522c75d484deab14beafcd176',1,'SinricProSpeaker::sendMediaControlEvent()'],['../class_sinric_pro_t_v.html#af69dc08522c75d484deab14beafcd176',1,'SinricProTV::sendMediaControlEvent()']]],
+ ['sendmodeevent_65',['sendModeEvent',['../class_sinric_pro_speaker.html#a6ddd0a2abe7ab6d46e786057694ebb49',1,'SinricProSpeaker']]],
+ ['sendmotionevent_66',['sendMotionEvent',['../class_sinric_pro_motionsensor.html#ab28a28a17768a38eea033ba700095672',1,'SinricProMotionsensor']]],
+ ['sendmuteevent_67',['sendMuteEvent',['../class_sinric_pro_speaker.html#abc47e827f33ac8bcc43ed204c7c4b8fd',1,'SinricProSpeaker::sendMuteEvent()'],['../class_sinric_pro_t_v.html#abc47e827f33ac8bcc43ed204c7c4b8fd',1,'SinricProTV::sendMuteEvent()']]],
+ ['sendpowerlevelevent_68',['sendPowerLevelEvent',['../class_sinric_pro_dim_switch.html#aaf81884c1f690ff2dd8862e192b8bbfa',1,'SinricProDimSwitch']]],
+ ['sendpowerstateevent_69',['sendPowerStateEvent',['../class_sinric_pro_device.html#a8006e256414deac0f9a4e28774b47773',1,'SinricProDevice']]],
+ ['sendrangevalueevent_70',['sendRangeValueEvent',['../class_sinric_pro_fan_u_s.html#af676bb2b419c4321d0a678cf9446da0c',1,'SinricProFanUS::sendRangeValueEvent()'],['../class_sinric_pro_window_a_c.html#af676bb2b419c4321d0a678cf9446da0c',1,'SinricProWindowAC::sendRangeValueEvent()']]],
+ ['sendselectinputevent_71',['sendSelectInputEvent',['../class_sinric_pro_t_v.html#a8d79220a3a06331442d36524ceac1db3',1,'SinricProTV']]],
+ ['sendtargettemperatureevent_72',['sendTargetTemperatureEvent',['../class_sinric_pro_thermostat.html#a07632bca425003b4ad559cb46fabca8c',1,'SinricProThermostat::sendTargetTemperatureEvent()'],['../class_sinric_pro_window_a_c.html#a07632bca425003b4ad559cb46fabca8c',1,'SinricProWindowAC::sendTargetTemperatureEvent()']]],
+ ['sendtemperatureevent_73',['sendTemperatureEvent',['../class_sinric_pro_temperaturesensor.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProTemperaturesensor::sendTemperatureEvent()'],['../class_sinric_pro_thermostat.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProThermostat::sendTemperatureEvent()'],['../class_sinric_pro_window_a_c.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProWindowAC::sendTemperatureEvent()']]],
+ ['sendthermostatmodeevent_74',['sendThermostatModeEvent',['../class_sinric_pro_thermostat.html#acd81e847a7f1029163729574c3d3971d',1,'SinricProThermostat::sendThermostatModeEvent()'],['../class_sinric_pro_window_a_c.html#acd81e847a7f1029163729574c3d3971d',1,'SinricProWindowAC::sendThermostatModeEvent()']]],
+ ['sendvolumeevent_75',['sendVolumeEvent',['../class_sinric_pro_speaker.html#a0f301accc58742f867de88c66a5eb3c5',1,'SinricProSpeaker::sendVolumeEvent()'],['../class_sinric_pro_t_v.html#a0f301accc58742f867de88c66a5eb3c5',1,'SinricProTV::sendVolumeEvent()']]],
+ ['setbandscallback_76',['SetBandsCallback',['../class_sinric_pro_speaker.html#a765ec6504ace15f556dbf2510ce93d0f',1,'SinricProSpeaker']]],
+ ['setpowerlevelcallback_77',['SetPowerLevelCallback',['../class_sinric_pro_dim_switch.html#afbdda289acfd7d72c03bab3b69b42afd',1,'SinricProDimSwitch']]],
+ ['setrangevaluecallback_78',['SetRangeValueCallback',['../class_sinric_pro_fan_u_s.html#ad2be7dbd98eae8443f8c76721cbffead',1,'SinricProFanUS::SetRangeValueCallback()'],['../class_sinric_pro_window_a_c.html#ad2be7dbd98eae8443f8c76721cbffead',1,'SinricProWindowAC::SetRangeValueCallback()']]],
+ ['settargettemperaturecallback_79',['SetTargetTemperatureCallback',['../class_sinric_pro_thermostat.html#a345ea0fb9b4069b8c540b17009272f65',1,'SinricProThermostat::SetTargetTemperatureCallback()'],['../class_sinric_pro_window_a_c.html#a345ea0fb9b4069b8c540b17009272f65',1,'SinricProWindowAC::SetTargetTemperatureCallback()']]],
+ ['setvolumecallback_80',['SetVolumeCallback',['../class_sinric_pro_speaker.html#aa495b90d483782760303ab45494deb7e',1,'SinricProSpeaker::SetVolumeCallback()'],['../class_sinric_pro_t_v.html#aa495b90d483782760303ab45494deb7e',1,'SinricProTV::SetVolumeCallback()']]],
+ ['sinricpro_81',['SinricPro',['../class_sinric_pro.html',1,'']]],
+ ['sinricproclass_82',['SinricProClass',['../class_sinric_pro_class.html',1,'']]],
+ ['sinricprocontactsensor_83',['SinricProContactsensor',['../class_sinric_pro_contactsensor.html',1,'']]],
+ ['sinricprodevice_84',['SinricProDevice',['../class_sinric_pro_device.html',1,'']]],
+ ['sinricprodimswitch_85',['SinricProDimSwitch',['../class_sinric_pro_dim_switch.html',1,'']]],
+ ['sinricprodoorbell_86',['SinricProDoorbell',['../class_sinric_pro_doorbell.html',1,'']]],
+ ['sinricprofan_87',['SinricProFan',['../class_sinric_pro_fan.html',1,'']]],
+ ['sinricprofanus_88',['SinricProFanUS',['../class_sinric_pro_fan_u_s.html',1,'']]],
+ ['sinricprolight_89',['SinricProLight',['../class_sinric_pro_light.html',1,'']]],
+ ['sinricprolock_90',['SinricProLock',['../class_sinric_pro_lock.html',1,'']]],
+ ['sinricpromotionsensor_91',['SinricProMotionsensor',['../class_sinric_pro_motionsensor.html',1,'']]],
+ ['sinricprospeaker_92',['SinricProSpeaker',['../class_sinric_pro_speaker.html',1,'']]],
+ ['sinricproswitch_93',['SinricProSwitch',['../class_sinric_pro_switch.html',1,'']]],
+ ['sinricprotemperaturesensor_94',['SinricProTemperaturesensor',['../class_sinric_pro_temperaturesensor.html',1,'']]],
+ ['sinricprothermostat_95',['SinricProThermostat',['../class_sinric_pro_thermostat.html',1,'']]],
+ ['sinricprotv_96',['SinricProTV',['../class_sinric_pro_t_v.html',1,'']]],
+ ['sinricprowindowac_97',['SinricProWindowAC',['../class_sinric_pro_window_a_c.html',1,'']]],
+ ['skipchannelscallback_98',['SkipChannelsCallback',['../class_sinric_pro_t_v.html#a955957998e893135fb04aa077304d3d6',1,'SinricProTV']]]
];
diff --git a/docs/search/all_c.js b/docs/search/all_c.js
index 15630a8..d41540f 100644
--- a/docs/search/all_c.js
+++ b/docs/search/all_c.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['thermostatmodecallback_95',['ThermostatModeCallback',['../class_sinric_pro_thermostat.html#abe5ced42c285b52c2414e788dc8b63b3',1,'SinricProThermostat::ThermostatModeCallback()'],['../class_sinric_pro_window_a_c.html#abe5ced42c285b52c2414e788dc8b63b3',1,'SinricProWindowAC::ThermostatModeCallback()']]]
+ ['thermostatmodecallback_99',['ThermostatModeCallback',['../class_sinric_pro_thermostat.html#abe5ced42c285b52c2414e788dc8b63b3',1,'SinricProThermostat::ThermostatModeCallback()'],['../class_sinric_pro_window_a_c.html#abe5ced42c285b52c2414e788dc8b63b3',1,'SinricProWindowAC::ThermostatModeCallback()']]]
];
diff --git a/docs/search/classes_0.js b/docs/search/classes_0.js
index 95eb21d..4bfef17 100644
--- a/docs/search/classes_0.js
+++ b/docs/search/classes_0.js
@@ -1,20 +1,20 @@
var searchData=
[
- ['sinricpro_96',['SinricPro',['../class_sinric_pro.html',1,'']]],
- ['sinricproclass_97',['SinricProClass',['../class_sinric_pro_class.html',1,'']]],
- ['sinricprocontactsensor_98',['SinricProContactsensor',['../class_sinric_pro_contactsensor.html',1,'']]],
- ['sinricprodevice_99',['SinricProDevice',['../class_sinric_pro_device.html',1,'']]],
- ['sinricprodimswitch_100',['SinricProDimSwitch',['../class_sinric_pro_dim_switch.html',1,'']]],
- ['sinricprodoorbell_101',['SinricProDoorbell',['../class_sinric_pro_doorbell.html',1,'']]],
- ['sinricprofan_102',['SinricProFan',['../class_sinric_pro_fan.html',1,'']]],
- ['sinricprofanus_103',['SinricProFanUS',['../class_sinric_pro_fan_u_s.html',1,'']]],
- ['sinricprolight_104',['SinricProLight',['../class_sinric_pro_light.html',1,'']]],
- ['sinricprolock_105',['SinricProLock',['../class_sinric_pro_lock.html',1,'']]],
- ['sinricpromotionsensor_106',['SinricProMotionsensor',['../class_sinric_pro_motionsensor.html',1,'']]],
- ['sinricprospeaker_107',['SinricProSpeaker',['../class_sinric_pro_speaker.html',1,'']]],
- ['sinricproswitch_108',['SinricProSwitch',['../class_sinric_pro_switch.html',1,'']]],
- ['sinricprotemperaturesensor_109',['SinricProTemperaturesensor',['../class_sinric_pro_temperaturesensor.html',1,'']]],
- ['sinricprothermostat_110',['SinricProThermostat',['../class_sinric_pro_thermostat.html',1,'']]],
- ['sinricprotv_111',['SinricProTV',['../class_sinric_pro_t_v.html',1,'']]],
- ['sinricprowindowac_112',['SinricProWindowAC',['../class_sinric_pro_window_a_c.html',1,'']]]
+ ['sinricpro_100',['SinricPro',['../class_sinric_pro.html',1,'']]],
+ ['sinricproclass_101',['SinricProClass',['../class_sinric_pro_class.html',1,'']]],
+ ['sinricprocontactsensor_102',['SinricProContactsensor',['../class_sinric_pro_contactsensor.html',1,'']]],
+ ['sinricprodevice_103',['SinricProDevice',['../class_sinric_pro_device.html',1,'']]],
+ ['sinricprodimswitch_104',['SinricProDimSwitch',['../class_sinric_pro_dim_switch.html',1,'']]],
+ ['sinricprodoorbell_105',['SinricProDoorbell',['../class_sinric_pro_doorbell.html',1,'']]],
+ ['sinricprofan_106',['SinricProFan',['../class_sinric_pro_fan.html',1,'']]],
+ ['sinricprofanus_107',['SinricProFanUS',['../class_sinric_pro_fan_u_s.html',1,'']]],
+ ['sinricprolight_108',['SinricProLight',['../class_sinric_pro_light.html',1,'']]],
+ ['sinricprolock_109',['SinricProLock',['../class_sinric_pro_lock.html',1,'']]],
+ ['sinricpromotionsensor_110',['SinricProMotionsensor',['../class_sinric_pro_motionsensor.html',1,'']]],
+ ['sinricprospeaker_111',['SinricProSpeaker',['../class_sinric_pro_speaker.html',1,'']]],
+ ['sinricproswitch_112',['SinricProSwitch',['../class_sinric_pro_switch.html',1,'']]],
+ ['sinricprotemperaturesensor_113',['SinricProTemperaturesensor',['../class_sinric_pro_temperaturesensor.html',1,'']]],
+ ['sinricprothermostat_114',['SinricProThermostat',['../class_sinric_pro_thermostat.html',1,'']]],
+ ['sinricprotv_115',['SinricProTV',['../class_sinric_pro_t_v.html',1,'']]],
+ ['sinricprowindowac_116',['SinricProWindowAC',['../class_sinric_pro_window_a_c.html',1,'']]]
];
diff --git a/docs/search/functions_0.js b/docs/search/functions_0.js
index a6e5c1f..dea198e 100644
--- a/docs/search/functions_0.js
+++ b/docs/search/functions_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['begin_113',['begin',['../class_sinric_pro_class.html#a57722dec8f1f987f57c8fff9eed66765',1,'SinricProClass']]]
+ ['begin_117',['begin',['../class_sinric_pro_class.html#a57722dec8f1f987f57c8fff9eed66765',1,'SinricProClass']]]
];
diff --git a/docs/search/functions_1.js b/docs/search/functions_1.js
index 4d44ec9..7e4f773 100644
--- a/docs/search/functions_1.js
+++ b/docs/search/functions_1.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['handle_114',['handle',['../class_sinric_pro_class.html#a37c2d0658e498b1bf878f8a3d9a7c5b4',1,'SinricProClass']]]
+ ['handle_118',['handle',['../class_sinric_pro_class.html#a37c2d0658e498b1bf878f8a3d9a7c5b4',1,'SinricProClass']]]
];
diff --git a/docs/search/functions_2.js b/docs/search/functions_2.js
index 6c63d7a..f8e62af 100644
--- a/docs/search/functions_2.js
+++ b/docs/search/functions_2.js
@@ -1,31 +1,33 @@
var searchData=
[
- ['onadjustbands_115',['onAdjustBands',['../class_sinric_pro_speaker.html#a41a5c1506545c44c2408054a8675c7a8',1,'SinricProSpeaker']]],
- ['onadjustbrightness_116',['onAdjustBrightness',['../class_sinric_pro_light.html#a0633e5fa2981189f4a093bab00a8c7f1',1,'SinricProLight']]],
- ['onadjustpowerlevel_117',['onAdjustPowerLevel',['../class_sinric_pro_dim_switch.html#a13b10bdb1844babe4de320fff9172d96',1,'SinricProDimSwitch']]],
- ['onadjustrangevalue_118',['onAdjustRangeValue',['../class_sinric_pro_fan_u_s.html#ae85696d55112ae7343f9807faee6e064',1,'SinricProFanUS::onAdjustRangeValue()'],['../class_sinric_pro_window_a_c.html#ae85696d55112ae7343f9807faee6e064',1,'SinricProWindowAC::onAdjustRangeValue()']]],
- ['onadjusttargettemperature_119',['onAdjustTargetTemperature',['../class_sinric_pro_thermostat.html#ac51f6fecfdf4c7bc8e0712e2da47bbf4',1,'SinricProThermostat::onAdjustTargetTemperature()'],['../class_sinric_pro_window_a_c.html#ac51f6fecfdf4c7bc8e0712e2da47bbf4',1,'SinricProWindowAC::onAdjustTargetTemperature()']]],
- ['onadjustvolume_120',['onAdjustVolume',['../class_sinric_pro_speaker.html#a2c868c87f96e3924c8b309e1bcfb507e',1,'SinricProSpeaker::onAdjustVolume()'],['../class_sinric_pro_t_v.html#a2c868c87f96e3924c8b309e1bcfb507e',1,'SinricProTV::onAdjustVolume()']]],
- ['onbrightness_121',['onBrightness',['../class_sinric_pro_light.html#abbaab3067b1fcdcc5928451b818a4420',1,'SinricProLight']]],
- ['onchangechannel_122',['onChangeChannel',['../class_sinric_pro_t_v.html#a92f3b83744b5bb82d32628eef39c1eb9',1,'SinricProTV']]],
- ['onchangechannelnumber_123',['onChangeChannelNumber',['../class_sinric_pro_t_v.html#afd8aee20590bfadec181c6ee515125ec',1,'SinricProTV']]],
- ['oncolor_124',['onColor',['../class_sinric_pro_light.html#a059ff103149869b7c49cdb8911875b7b',1,'SinricProLight']]],
- ['oncolortemperature_125',['onColorTemperature',['../class_sinric_pro_light.html#a8535c44fd2517ed09ebe6a203cc25b67',1,'SinricProLight']]],
- ['ondecreasecolortemperature_126',['onDecreaseColorTemperature',['../class_sinric_pro_light.html#a7468976e7fffeee14cc869b7236cbb50',1,'SinricProLight']]],
- ['onincreasecolortemperature_127',['onIncreaseColorTemperature',['../class_sinric_pro_light.html#a7ea9fd9861a5668a41d06267bfbec82a',1,'SinricProLight']]],
- ['onlockstate_128',['onLockState',['../class_sinric_pro_lock.html#aee42cc397234a454fd353ca6bc12a859',1,'SinricProLock']]],
- ['onmediacontrol_129',['onMediaControl',['../class_sinric_pro_speaker.html#afc2620621377fff928737b5a8a537020',1,'SinricProSpeaker::onMediaControl()'],['../class_sinric_pro_t_v.html#afc2620621377fff928737b5a8a537020',1,'SinricProTV::onMediaControl()']]],
- ['onmute_130',['onMute',['../class_sinric_pro_speaker.html#ab5fc79cc8903c3ccc1c106abf61d7cfd',1,'SinricProSpeaker::onMute()'],['../class_sinric_pro_t_v.html#ab5fc79cc8903c3ccc1c106abf61d7cfd',1,'SinricProTV::onMute()']]],
- ['onpowerlevel_131',['onPowerLevel',['../class_sinric_pro_dim_switch.html#a0685d34694badb4442fed6b69b69b366',1,'SinricProDimSwitch']]],
- ['onpowerstate_132',['onPowerState',['../class_sinric_pro_device.html#a32f3257da431a1035f23a265ff0cc4cf',1,'SinricProDevice']]],
- ['onrangevalue_133',['onRangeValue',['../class_sinric_pro_fan_u_s.html#a94adbcdf6ce61cb6552a5f9915e705ae',1,'SinricProFanUS::onRangeValue()'],['../class_sinric_pro_window_a_c.html#a94adbcdf6ce61cb6552a5f9915e705ae',1,'SinricProWindowAC::onRangeValue()']]],
- ['onresetbands_134',['onResetBands',['../class_sinric_pro_speaker.html#aa6c3aabc2b442d82ac5456ccaac3f60d',1,'SinricProSpeaker']]],
- ['onselectinput_135',['onSelectInput',['../class_sinric_pro_t_v.html#a18f8f71ecf0d7292a63d9486f94e5180',1,'SinricProTV']]],
- ['onsetbands_136',['onSetBands',['../class_sinric_pro_speaker.html#a4aaa7a29394560be7537a86b0304d199',1,'SinricProSpeaker']]],
- ['onsetmode_137',['onSetMode',['../class_sinric_pro_speaker.html#ada087c948c3ab923bdb7818daa6b2b79',1,'SinricProSpeaker']]],
- ['onsetvolume_138',['onSetVolume',['../class_sinric_pro_speaker.html#a5db8c85f222debbece54c794015f9402',1,'SinricProSpeaker::onSetVolume()'],['../class_sinric_pro_t_v.html#a5db8c85f222debbece54c794015f9402',1,'SinricProTV::onSetVolume()']]],
- ['onskipchannels_139',['onSkipChannels',['../class_sinric_pro_t_v.html#ab1123d03d471fad4896eb2960ed41855',1,'SinricProTV']]],
- ['ontargettemperature_140',['onTargetTemperature',['../class_sinric_pro_thermostat.html#a1c73725f1f3fbb1c5b72208aae5c2bf2',1,'SinricProThermostat::onTargetTemperature()'],['../class_sinric_pro_window_a_c.html#a1c73725f1f3fbb1c5b72208aae5c2bf2',1,'SinricProWindowAC::onTargetTemperature()']]],
- ['onthermostatmode_141',['onThermostatMode',['../class_sinric_pro_thermostat.html#a2ef31536973b20815dd6c80a28e19c9f',1,'SinricProThermostat::onThermostatMode()'],['../class_sinric_pro_window_a_c.html#a2ef31536973b20815dd6c80a28e19c9f',1,'SinricProWindowAC::onThermostatMode()']]],
- ['operator_5b_5d_142',['operator[]',['../class_sinric_pro_class.html#a5df2137b8d06e894c917fd28c35c31a4',1,'SinricProClass']]]
+ ['onadjustbands_119',['onAdjustBands',['../class_sinric_pro_speaker.html#a41a5c1506545c44c2408054a8675c7a8',1,'SinricProSpeaker']]],
+ ['onadjustbrightness_120',['onAdjustBrightness',['../class_sinric_pro_light.html#a0633e5fa2981189f4a093bab00a8c7f1',1,'SinricProLight']]],
+ ['onadjustpowerlevel_121',['onAdjustPowerLevel',['../class_sinric_pro_dim_switch.html#a13b10bdb1844babe4de320fff9172d96',1,'SinricProDimSwitch']]],
+ ['onadjustrangevalue_122',['onAdjustRangeValue',['../class_sinric_pro_fan_u_s.html#ae85696d55112ae7343f9807faee6e064',1,'SinricProFanUS::onAdjustRangeValue()'],['../class_sinric_pro_window_a_c.html#ae85696d55112ae7343f9807faee6e064',1,'SinricProWindowAC::onAdjustRangeValue()']]],
+ ['onadjusttargettemperature_123',['onAdjustTargetTemperature',['../class_sinric_pro_thermostat.html#ac51f6fecfdf4c7bc8e0712e2da47bbf4',1,'SinricProThermostat::onAdjustTargetTemperature()'],['../class_sinric_pro_window_a_c.html#ac51f6fecfdf4c7bc8e0712e2da47bbf4',1,'SinricProWindowAC::onAdjustTargetTemperature()']]],
+ ['onadjustvolume_124',['onAdjustVolume',['../class_sinric_pro_speaker.html#a2c868c87f96e3924c8b309e1bcfb507e',1,'SinricProSpeaker::onAdjustVolume()'],['../class_sinric_pro_t_v.html#a2c868c87f96e3924c8b309e1bcfb507e',1,'SinricProTV::onAdjustVolume()']]],
+ ['onbrightness_125',['onBrightness',['../class_sinric_pro_light.html#abbaab3067b1fcdcc5928451b818a4420',1,'SinricProLight']]],
+ ['onchangechannel_126',['onChangeChannel',['../class_sinric_pro_t_v.html#a92f3b83744b5bb82d32628eef39c1eb9',1,'SinricProTV']]],
+ ['onchangechannelnumber_127',['onChangeChannelNumber',['../class_sinric_pro_t_v.html#afd8aee20590bfadec181c6ee515125ec',1,'SinricProTV']]],
+ ['oncolor_128',['onColor',['../class_sinric_pro_light.html#a059ff103149869b7c49cdb8911875b7b',1,'SinricProLight']]],
+ ['oncolortemperature_129',['onColorTemperature',['../class_sinric_pro_light.html#a8535c44fd2517ed09ebe6a203cc25b67',1,'SinricProLight']]],
+ ['onconnected_130',['onConnected',['../class_sinric_pro_class.html#ac33a355adfc413d4ff36974d735115bd',1,'SinricProClass']]],
+ ['ondecreasecolortemperature_131',['onDecreaseColorTemperature',['../class_sinric_pro_light.html#a7468976e7fffeee14cc869b7236cbb50',1,'SinricProLight']]],
+ ['ondisconnected_132',['onDisconnected',['../class_sinric_pro_class.html#a654bb017ca55b448d55bb36e0346f38a',1,'SinricProClass']]],
+ ['onincreasecolortemperature_133',['onIncreaseColorTemperature',['../class_sinric_pro_light.html#a7ea9fd9861a5668a41d06267bfbec82a',1,'SinricProLight']]],
+ ['onlockstate_134',['onLockState',['../class_sinric_pro_lock.html#aee42cc397234a454fd353ca6bc12a859',1,'SinricProLock']]],
+ ['onmediacontrol_135',['onMediaControl',['../class_sinric_pro_speaker.html#afc2620621377fff928737b5a8a537020',1,'SinricProSpeaker::onMediaControl()'],['../class_sinric_pro_t_v.html#afc2620621377fff928737b5a8a537020',1,'SinricProTV::onMediaControl()']]],
+ ['onmute_136',['onMute',['../class_sinric_pro_speaker.html#ab5fc79cc8903c3ccc1c106abf61d7cfd',1,'SinricProSpeaker::onMute()'],['../class_sinric_pro_t_v.html#ab5fc79cc8903c3ccc1c106abf61d7cfd',1,'SinricProTV::onMute()']]],
+ ['onpowerlevel_137',['onPowerLevel',['../class_sinric_pro_dim_switch.html#a0685d34694badb4442fed6b69b69b366',1,'SinricProDimSwitch']]],
+ ['onpowerstate_138',['onPowerState',['../class_sinric_pro_device.html#a32f3257da431a1035f23a265ff0cc4cf',1,'SinricProDevice']]],
+ ['onrangevalue_139',['onRangeValue',['../class_sinric_pro_fan_u_s.html#a94adbcdf6ce61cb6552a5f9915e705ae',1,'SinricProFanUS::onRangeValue()'],['../class_sinric_pro_window_a_c.html#a94adbcdf6ce61cb6552a5f9915e705ae',1,'SinricProWindowAC::onRangeValue()']]],
+ ['onresetbands_140',['onResetBands',['../class_sinric_pro_speaker.html#aa6c3aabc2b442d82ac5456ccaac3f60d',1,'SinricProSpeaker']]],
+ ['onselectinput_141',['onSelectInput',['../class_sinric_pro_t_v.html#a18f8f71ecf0d7292a63d9486f94e5180',1,'SinricProTV']]],
+ ['onsetbands_142',['onSetBands',['../class_sinric_pro_speaker.html#a4aaa7a29394560be7537a86b0304d199',1,'SinricProSpeaker']]],
+ ['onsetmode_143',['onSetMode',['../class_sinric_pro_speaker.html#ada087c948c3ab923bdb7818daa6b2b79',1,'SinricProSpeaker']]],
+ ['onsetvolume_144',['onSetVolume',['../class_sinric_pro_speaker.html#a5db8c85f222debbece54c794015f9402',1,'SinricProSpeaker::onSetVolume()'],['../class_sinric_pro_t_v.html#a5db8c85f222debbece54c794015f9402',1,'SinricProTV::onSetVolume()']]],
+ ['onskipchannels_145',['onSkipChannels',['../class_sinric_pro_t_v.html#ab1123d03d471fad4896eb2960ed41855',1,'SinricProTV']]],
+ ['ontargettemperature_146',['onTargetTemperature',['../class_sinric_pro_thermostat.html#a1c73725f1f3fbb1c5b72208aae5c2bf2',1,'SinricProThermostat::onTargetTemperature()'],['../class_sinric_pro_window_a_c.html#a1c73725f1f3fbb1c5b72208aae5c2bf2',1,'SinricProWindowAC::onTargetTemperature()']]],
+ ['onthermostatmode_147',['onThermostatMode',['../class_sinric_pro_thermostat.html#a2ef31536973b20815dd6c80a28e19c9f',1,'SinricProThermostat::onThermostatMode()'],['../class_sinric_pro_window_a_c.html#a2ef31536973b20815dd6c80a28e19c9f',1,'SinricProWindowAC::onThermostatMode()']]],
+ ['operator_5b_5d_148',['operator[]',['../class_sinric_pro_class.html#a5df2137b8d06e894c917fd28c35c31a4',1,'SinricProClass']]]
];
diff --git a/docs/search/functions_3.js b/docs/search/functions_3.js
index a3cfc1c..c0f899d 100644
--- a/docs/search/functions_3.js
+++ b/docs/search/functions_3.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['restoredevicestates_143',['restoreDeviceStates',['../class_sinric_pro_class.html#a27a9bb7f1e8bde0f39398649493b6f93',1,'SinricProClass']]]
+ ['restoredevicestates_149',['restoreDeviceStates',['../class_sinric_pro_class.html#a27a9bb7f1e8bde0f39398649493b6f93',1,'SinricProClass']]]
];
diff --git a/docs/search/functions_4.js b/docs/search/functions_4.js
index e6cfbb7..00d6640 100644
--- a/docs/search/functions_4.js
+++ b/docs/search/functions_4.js
@@ -1,23 +1,23 @@
var searchData=
[
- ['sendbandsevent_144',['sendBandsEvent',['../class_sinric_pro_speaker.html#a4ad5674e36d96a73147388251b794c82',1,'SinricProSpeaker']]],
- ['sendbrightnessevent_145',['sendBrightnessEvent',['../class_sinric_pro_light.html#aa42df8ac91de826653626df67a8500b6',1,'SinricProLight']]],
- ['sendchangechannelevent_146',['sendChangeChannelEvent',['../class_sinric_pro_t_v.html#aa85e049284116b157e34159624680ae1',1,'SinricProTV']]],
- ['sendcolorevent_147',['sendColorEvent',['../class_sinric_pro_light.html#aa3019d161b320267666cdb11d1c3d827',1,'SinricProLight']]],
- ['sendcolortemperatureevent_148',['sendColorTemperatureEvent',['../class_sinric_pro_light.html#a9065e6d08309d313b16adc774cc642ff',1,'SinricProLight']]],
- ['sendcontactevent_149',['sendContactEvent',['../class_sinric_pro_contactsensor.html#a0b4b9006c0be003c615848bcc2b690fd',1,'SinricProContactsensor']]],
- ['senddoorbellevent_150',['sendDoorbellEvent',['../class_sinric_pro_doorbell.html#a084a5475db7127784c452deb3a080f62',1,'SinricProDoorbell']]],
- ['sendlockstateevent_151',['sendLockStateEvent',['../class_sinric_pro_lock.html#a3795d2fa1b8474239f46493915e70f1c',1,'SinricProLock']]],
- ['sendmediacontrolevent_152',['sendMediaControlEvent',['../class_sinric_pro_speaker.html#af69dc08522c75d484deab14beafcd176',1,'SinricProSpeaker::sendMediaControlEvent()'],['../class_sinric_pro_t_v.html#af69dc08522c75d484deab14beafcd176',1,'SinricProTV::sendMediaControlEvent()']]],
- ['sendmodeevent_153',['sendModeEvent',['../class_sinric_pro_speaker.html#a6ddd0a2abe7ab6d46e786057694ebb49',1,'SinricProSpeaker']]],
- ['sendmotionevent_154',['sendMotionEvent',['../class_sinric_pro_motionsensor.html#ab28a28a17768a38eea033ba700095672',1,'SinricProMotionsensor']]],
- ['sendmuteevent_155',['sendMuteEvent',['../class_sinric_pro_speaker.html#abc47e827f33ac8bcc43ed204c7c4b8fd',1,'SinricProSpeaker::sendMuteEvent()'],['../class_sinric_pro_t_v.html#abc47e827f33ac8bcc43ed204c7c4b8fd',1,'SinricProTV::sendMuteEvent()']]],
- ['sendpowerlevelevent_156',['sendPowerLevelEvent',['../class_sinric_pro_dim_switch.html#aaf81884c1f690ff2dd8862e192b8bbfa',1,'SinricProDimSwitch']]],
- ['sendpowerstateevent_157',['sendPowerStateEvent',['../class_sinric_pro_device.html#a8006e256414deac0f9a4e28774b47773',1,'SinricProDevice']]],
- ['sendrangevalueevent_158',['sendRangeValueEvent',['../class_sinric_pro_fan_u_s.html#af676bb2b419c4321d0a678cf9446da0c',1,'SinricProFanUS::sendRangeValueEvent()'],['../class_sinric_pro_window_a_c.html#af676bb2b419c4321d0a678cf9446da0c',1,'SinricProWindowAC::sendRangeValueEvent()']]],
- ['sendselectinputevent_159',['sendSelectInputEvent',['../class_sinric_pro_t_v.html#a8d79220a3a06331442d36524ceac1db3',1,'SinricProTV']]],
- ['sendtargettemperatureevent_160',['sendTargetTemperatureEvent',['../class_sinric_pro_thermostat.html#a07632bca425003b4ad559cb46fabca8c',1,'SinricProThermostat::sendTargetTemperatureEvent()'],['../class_sinric_pro_window_a_c.html#a07632bca425003b4ad559cb46fabca8c',1,'SinricProWindowAC::sendTargetTemperatureEvent()']]],
- ['sendtemperatureevent_161',['sendTemperatureEvent',['../class_sinric_pro_temperaturesensor.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProTemperaturesensor::sendTemperatureEvent()'],['../class_sinric_pro_thermostat.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProThermostat::sendTemperatureEvent()'],['../class_sinric_pro_window_a_c.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProWindowAC::sendTemperatureEvent()']]],
- ['sendthermostatmodeevent_162',['sendThermostatModeEvent',['../class_sinric_pro_thermostat.html#acd81e847a7f1029163729574c3d3971d',1,'SinricProThermostat::sendThermostatModeEvent()'],['../class_sinric_pro_window_a_c.html#acd81e847a7f1029163729574c3d3971d',1,'SinricProWindowAC::sendThermostatModeEvent()']]],
- ['sendvolumeevent_163',['sendVolumeEvent',['../class_sinric_pro_speaker.html#a0f301accc58742f867de88c66a5eb3c5',1,'SinricProSpeaker::sendVolumeEvent()'],['../class_sinric_pro_t_v.html#a0f301accc58742f867de88c66a5eb3c5',1,'SinricProTV::sendVolumeEvent()']]]
+ ['sendbandsevent_150',['sendBandsEvent',['../class_sinric_pro_speaker.html#a4ad5674e36d96a73147388251b794c82',1,'SinricProSpeaker']]],
+ ['sendbrightnessevent_151',['sendBrightnessEvent',['../class_sinric_pro_light.html#aa42df8ac91de826653626df67a8500b6',1,'SinricProLight']]],
+ ['sendchangechannelevent_152',['sendChangeChannelEvent',['../class_sinric_pro_t_v.html#aa85e049284116b157e34159624680ae1',1,'SinricProTV']]],
+ ['sendcolorevent_153',['sendColorEvent',['../class_sinric_pro_light.html#aa3019d161b320267666cdb11d1c3d827',1,'SinricProLight']]],
+ ['sendcolortemperatureevent_154',['sendColorTemperatureEvent',['../class_sinric_pro_light.html#a9065e6d08309d313b16adc774cc642ff',1,'SinricProLight']]],
+ ['sendcontactevent_155',['sendContactEvent',['../class_sinric_pro_contactsensor.html#a0b4b9006c0be003c615848bcc2b690fd',1,'SinricProContactsensor']]],
+ ['senddoorbellevent_156',['sendDoorbellEvent',['../class_sinric_pro_doorbell.html#a084a5475db7127784c452deb3a080f62',1,'SinricProDoorbell']]],
+ ['sendlockstateevent_157',['sendLockStateEvent',['../class_sinric_pro_lock.html#a3795d2fa1b8474239f46493915e70f1c',1,'SinricProLock']]],
+ ['sendmediacontrolevent_158',['sendMediaControlEvent',['../class_sinric_pro_speaker.html#af69dc08522c75d484deab14beafcd176',1,'SinricProSpeaker::sendMediaControlEvent()'],['../class_sinric_pro_t_v.html#af69dc08522c75d484deab14beafcd176',1,'SinricProTV::sendMediaControlEvent()']]],
+ ['sendmodeevent_159',['sendModeEvent',['../class_sinric_pro_speaker.html#a6ddd0a2abe7ab6d46e786057694ebb49',1,'SinricProSpeaker']]],
+ ['sendmotionevent_160',['sendMotionEvent',['../class_sinric_pro_motionsensor.html#ab28a28a17768a38eea033ba700095672',1,'SinricProMotionsensor']]],
+ ['sendmuteevent_161',['sendMuteEvent',['../class_sinric_pro_speaker.html#abc47e827f33ac8bcc43ed204c7c4b8fd',1,'SinricProSpeaker::sendMuteEvent()'],['../class_sinric_pro_t_v.html#abc47e827f33ac8bcc43ed204c7c4b8fd',1,'SinricProTV::sendMuteEvent()']]],
+ ['sendpowerlevelevent_162',['sendPowerLevelEvent',['../class_sinric_pro_dim_switch.html#aaf81884c1f690ff2dd8862e192b8bbfa',1,'SinricProDimSwitch']]],
+ ['sendpowerstateevent_163',['sendPowerStateEvent',['../class_sinric_pro_device.html#a8006e256414deac0f9a4e28774b47773',1,'SinricProDevice']]],
+ ['sendrangevalueevent_164',['sendRangeValueEvent',['../class_sinric_pro_fan_u_s.html#af676bb2b419c4321d0a678cf9446da0c',1,'SinricProFanUS::sendRangeValueEvent()'],['../class_sinric_pro_window_a_c.html#af676bb2b419c4321d0a678cf9446da0c',1,'SinricProWindowAC::sendRangeValueEvent()']]],
+ ['sendselectinputevent_165',['sendSelectInputEvent',['../class_sinric_pro_t_v.html#a8d79220a3a06331442d36524ceac1db3',1,'SinricProTV']]],
+ ['sendtargettemperatureevent_166',['sendTargetTemperatureEvent',['../class_sinric_pro_thermostat.html#a07632bca425003b4ad559cb46fabca8c',1,'SinricProThermostat::sendTargetTemperatureEvent()'],['../class_sinric_pro_window_a_c.html#a07632bca425003b4ad559cb46fabca8c',1,'SinricProWindowAC::sendTargetTemperatureEvent()']]],
+ ['sendtemperatureevent_167',['sendTemperatureEvent',['../class_sinric_pro_temperaturesensor.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProTemperaturesensor::sendTemperatureEvent()'],['../class_sinric_pro_thermostat.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProThermostat::sendTemperatureEvent()'],['../class_sinric_pro_window_a_c.html#a9545808dacd9efc40a05f16e09d79b4e',1,'SinricProWindowAC::sendTemperatureEvent()']]],
+ ['sendthermostatmodeevent_168',['sendThermostatModeEvent',['../class_sinric_pro_thermostat.html#acd81e847a7f1029163729574c3d3971d',1,'SinricProThermostat::sendThermostatModeEvent()'],['../class_sinric_pro_window_a_c.html#acd81e847a7f1029163729574c3d3971d',1,'SinricProWindowAC::sendThermostatModeEvent()']]],
+ ['sendvolumeevent_169',['sendVolumeEvent',['../class_sinric_pro_speaker.html#a0f301accc58742f867de88c66a5eb3c5',1,'SinricProSpeaker::sendVolumeEvent()'],['../class_sinric_pro_t_v.html#a0f301accc58742f867de88c66a5eb3c5',1,'SinricProTV::sendVolumeEvent()']]]
];
diff --git a/docs/search/pages_0.js b/docs/search/pages_0.js
index 9e735b1..c230b1a 100644
--- a/docs/search/pages_0.js
+++ b/docs/search/pages_0.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['sinricpro_20_28esp8266_20_2f_20esp32_20sdk_29_191',['SinricPro (ESP8266 / ESP32 SDK)',['../index.html',1,'']]]
+ ['sinricpro_20_28esp8266_20_2f_20esp32_20sdk_29_199',['SinricPro (ESP8266 / ESP32 SDK)',['../index.html',1,'']]]
];
diff --git a/docs/search/typedefs_0.js b/docs/search/typedefs_0.js
index acad662..48fadab 100644
--- a/docs/search/typedefs_0.js
+++ b/docs/search/typedefs_0.js
@@ -1,9 +1,9 @@
var searchData=
[
- ['adjustbandscallback_164',['AdjustBandsCallback',['../class_sinric_pro_speaker.html#a9fd3e3ebbb960707aa11e4fe77961368',1,'SinricProSpeaker']]],
- ['adjustbrightnesscallback_165',['AdjustBrightnessCallback',['../class_sinric_pro_light.html#ab2267f4b655928122371dcc0bc960e88',1,'SinricProLight']]],
- ['adjustpowerlevelcallback_166',['AdjustPowerLevelCallback',['../class_sinric_pro_dim_switch.html#a014ffde9f69bdc85629806073ee1ab7a',1,'SinricProDimSwitch']]],
- ['adjustrangevaluecallback_167',['AdjustRangeValueCallback',['../class_sinric_pro_fan_u_s.html#a8977055ae213732aaa3ef430259208f4',1,'SinricProFanUS::AdjustRangeValueCallback()'],['../class_sinric_pro_window_a_c.html#a8977055ae213732aaa3ef430259208f4',1,'SinricProWindowAC::AdjustRangeValueCallback()']]],
- ['adjusttargettemperaturecallback_168',['AdjustTargetTemperatureCallback',['../class_sinric_pro_thermostat.html#aeae1f9b5872cf8dcba7efc2548a671fa',1,'SinricProThermostat::AdjustTargetTemperatureCallback()'],['../class_sinric_pro_window_a_c.html#aeae1f9b5872cf8dcba7efc2548a671fa',1,'SinricProWindowAC::AdjustTargetTemperatureCallback()']]],
- ['adjustvolumecallback_169',['AdjustVolumeCallback',['../class_sinric_pro_speaker.html#a1dfe43a4f99caf28ad07a2ff84708f94',1,'SinricProSpeaker::AdjustVolumeCallback()'],['../class_sinric_pro_t_v.html#a1dfe43a4f99caf28ad07a2ff84708f94',1,'SinricProTV::AdjustVolumeCallback()']]]
+ ['adjustbandscallback_170',['AdjustBandsCallback',['../class_sinric_pro_speaker.html#a9fd3e3ebbb960707aa11e4fe77961368',1,'SinricProSpeaker']]],
+ ['adjustbrightnesscallback_171',['AdjustBrightnessCallback',['../class_sinric_pro_light.html#ab2267f4b655928122371dcc0bc960e88',1,'SinricProLight']]],
+ ['adjustpowerlevelcallback_172',['AdjustPowerLevelCallback',['../class_sinric_pro_dim_switch.html#a014ffde9f69bdc85629806073ee1ab7a',1,'SinricProDimSwitch']]],
+ ['adjustrangevaluecallback_173',['AdjustRangeValueCallback',['../class_sinric_pro_fan_u_s.html#a8977055ae213732aaa3ef430259208f4',1,'SinricProFanUS::AdjustRangeValueCallback()'],['../class_sinric_pro_window_a_c.html#a8977055ae213732aaa3ef430259208f4',1,'SinricProWindowAC::AdjustRangeValueCallback()']]],
+ ['adjusttargettemperaturecallback_174',['AdjustTargetTemperatureCallback',['../class_sinric_pro_thermostat.html#aeae1f9b5872cf8dcba7efc2548a671fa',1,'SinricProThermostat::AdjustTargetTemperatureCallback()'],['../class_sinric_pro_window_a_c.html#aeae1f9b5872cf8dcba7efc2548a671fa',1,'SinricProWindowAC::AdjustTargetTemperatureCallback()']]],
+ ['adjustvolumecallback_175',['AdjustVolumeCallback',['../class_sinric_pro_speaker.html#a1dfe43a4f99caf28ad07a2ff84708f94',1,'SinricProSpeaker::AdjustVolumeCallback()'],['../class_sinric_pro_t_v.html#a1dfe43a4f99caf28ad07a2ff84708f94',1,'SinricProTV::AdjustVolumeCallback()']]]
];
diff --git a/docs/search/typedefs_1.js b/docs/search/typedefs_1.js
index 7aa129d..596efc9 100644
--- a/docs/search/typedefs_1.js
+++ b/docs/search/typedefs_1.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['brightnesscallback_170',['BrightnessCallback',['../class_sinric_pro_light.html#a1bf03bd01ae1f4ddf164260435dc2026',1,'SinricProLight']]]
+ ['brightnesscallback_176',['BrightnessCallback',['../class_sinric_pro_light.html#a1bf03bd01ae1f4ddf164260435dc2026',1,'SinricProLight']]]
];
diff --git a/docs/search/typedefs_2.js b/docs/search/typedefs_2.js
index 4908f33..01c72e4 100644
--- a/docs/search/typedefs_2.js
+++ b/docs/search/typedefs_2.js
@@ -1,7 +1,8 @@
var searchData=
[
- ['changechannelcallback_171',['ChangeChannelCallback',['../class_sinric_pro_t_v.html#a276a4a418aa341936a2e8870cac15e79',1,'SinricProTV']]],
- ['changechannelnumbercallback_172',['ChangeChannelNumberCallback',['../class_sinric_pro_t_v.html#aed91a90de7d42e34af4a0d995e8b525b',1,'SinricProTV']]],
- ['colorcallback_173',['ColorCallback',['../class_sinric_pro_light.html#a916ceb3c8ef5094cc578f739b2d9edca',1,'SinricProLight']]],
- ['colortemperaturecallback_174',['ColorTemperatureCallback',['../class_sinric_pro_light.html#ac46e0327976c2cb38b6e97110763de5f',1,'SinricProLight']]]
+ ['changechannelcallback_177',['ChangeChannelCallback',['../class_sinric_pro_t_v.html#a276a4a418aa341936a2e8870cac15e79',1,'SinricProTV']]],
+ ['changechannelnumbercallback_178',['ChangeChannelNumberCallback',['../class_sinric_pro_t_v.html#aed91a90de7d42e34af4a0d995e8b525b',1,'SinricProTV']]],
+ ['colorcallback_179',['ColorCallback',['../class_sinric_pro_light.html#a916ceb3c8ef5094cc578f739b2d9edca',1,'SinricProLight']]],
+ ['colortemperaturecallback_180',['ColorTemperatureCallback',['../class_sinric_pro_light.html#ac46e0327976c2cb38b6e97110763de5f',1,'SinricProLight']]],
+ ['connectedcallbackhandler_181',['ConnectedCallbackHandler',['../class_sinric_pro_class.html#a4d7d8547a83d53c20cbd9aa7768e99f5',1,'SinricProClass']]]
];
diff --git a/docs/search/typedefs_3.js b/docs/search/typedefs_3.js
index 3fb4e60..ef63982 100644
--- a/docs/search/typedefs_3.js
+++ b/docs/search/typedefs_3.js
@@ -1,4 +1,5 @@
var searchData=
[
- ['decreasecolortemperaturecallback_175',['DecreaseColorTemperatureCallback',['../class_sinric_pro_light.html#a8fce91e931713aa452fb7bd0805e3c81',1,'SinricProLight']]]
+ ['decreasecolortemperaturecallback_182',['DecreaseColorTemperatureCallback',['../class_sinric_pro_light.html#a8fce91e931713aa452fb7bd0805e3c81',1,'SinricProLight']]],
+ ['disconnectedcallbackhandler_183',['DisconnectedCallbackHandler',['../class_sinric_pro_class.html#ad84930f3c26ac3692cc885be197d39c7',1,'SinricProClass']]]
];
diff --git a/docs/search/typedefs_4.js b/docs/search/typedefs_4.js
index aab425b..244fa05 100644
--- a/docs/search/typedefs_4.js
+++ b/docs/search/typedefs_4.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['increasecolortemperaturecallback_176',['IncreaseColorTemperatureCallback',['../class_sinric_pro_light.html#ac29cb175180abefcc181191de6be6c9f',1,'SinricProLight']]]
+ ['increasecolortemperaturecallback_184',['IncreaseColorTemperatureCallback',['../class_sinric_pro_light.html#ac29cb175180abefcc181191de6be6c9f',1,'SinricProLight']]]
];
diff --git a/docs/search/typedefs_5.js b/docs/search/typedefs_5.js
index 05d6149..4412538 100644
--- a/docs/search/typedefs_5.js
+++ b/docs/search/typedefs_5.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['lockstatecallback_177',['LockStateCallback',['../class_sinric_pro_lock.html#a2e4171a3cfcd3a87584fc114782ed4d8',1,'SinricProLock']]]
+ ['lockstatecallback_185',['LockStateCallback',['../class_sinric_pro_lock.html#a2e4171a3cfcd3a87584fc114782ed4d8',1,'SinricProLock']]]
];
diff --git a/docs/search/typedefs_6.js b/docs/search/typedefs_6.js
index 64b38d3..bfba5e6 100644
--- a/docs/search/typedefs_6.js
+++ b/docs/search/typedefs_6.js
@@ -1,6 +1,6 @@
var searchData=
[
- ['mediacontrolcallback_178',['MediaControlCallback',['../class_sinric_pro_speaker.html#a19062c8b2786a85d53129d572ec55bbd',1,'SinricProSpeaker::MediaControlCallback()'],['../class_sinric_pro_t_v.html#a19062c8b2786a85d53129d572ec55bbd',1,'SinricProTV::MediaControlCallback()']]],
- ['modecallback_179',['ModeCallback',['../class_sinric_pro_speaker.html#affad86b6a5068090c860b36d26280d49',1,'SinricProSpeaker']]],
- ['mutecallback_180',['MuteCallback',['../class_sinric_pro_speaker.html#a24d0844497c30b03f3c7ec9e30fcb33b',1,'SinricProSpeaker::MuteCallback()'],['../class_sinric_pro_t_v.html#a24d0844497c30b03f3c7ec9e30fcb33b',1,'SinricProTV::MuteCallback()']]]
+ ['mediacontrolcallback_186',['MediaControlCallback',['../class_sinric_pro_speaker.html#a19062c8b2786a85d53129d572ec55bbd',1,'SinricProSpeaker::MediaControlCallback()'],['../class_sinric_pro_t_v.html#a19062c8b2786a85d53129d572ec55bbd',1,'SinricProTV::MediaControlCallback()']]],
+ ['modecallback_187',['ModeCallback',['../class_sinric_pro_speaker.html#affad86b6a5068090c860b36d26280d49',1,'SinricProSpeaker']]],
+ ['mutecallback_188',['MuteCallback',['../class_sinric_pro_speaker.html#a24d0844497c30b03f3c7ec9e30fcb33b',1,'SinricProSpeaker::MuteCallback()'],['../class_sinric_pro_t_v.html#a24d0844497c30b03f3c7ec9e30fcb33b',1,'SinricProTV::MuteCallback()']]]
];
diff --git a/docs/search/typedefs_7.js b/docs/search/typedefs_7.js
index 6ec6c79..8deee85 100644
--- a/docs/search/typedefs_7.js
+++ b/docs/search/typedefs_7.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['powerstatecallback_181',['PowerStateCallback',['../class_sinric_pro_device.html#aa9db92ebe40a0df6deb43eba70d3dea3',1,'SinricProDevice']]]
+ ['powerstatecallback_189',['PowerStateCallback',['../class_sinric_pro_device.html#aa9db92ebe40a0df6deb43eba70d3dea3',1,'SinricProDevice']]]
];
diff --git a/docs/search/typedefs_8.js b/docs/search/typedefs_8.js
index 9ded5da..b853cb5 100644
--- a/docs/search/typedefs_8.js
+++ b/docs/search/typedefs_8.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['resetbandscallback_182',['ResetBandsCallback',['../class_sinric_pro_speaker.html#ae1ec62ffbf9d7f00df9760819305782e',1,'SinricProSpeaker']]]
+ ['resetbandscallback_190',['ResetBandsCallback',['../class_sinric_pro_speaker.html#ae1ec62ffbf9d7f00df9760819305782e',1,'SinricProSpeaker']]]
];
diff --git a/docs/search/typedefs_9.js b/docs/search/typedefs_9.js
index 5f40fa6..73a7ae0 100644
--- a/docs/search/typedefs_9.js
+++ b/docs/search/typedefs_9.js
@@ -1,10 +1,10 @@
var searchData=
[
- ['selectinputcallback_183',['SelectInputCallback',['../class_sinric_pro_t_v.html#a047ecacb194f2ad747fa2ab7e1117a88',1,'SinricProTV']]],
- ['setbandscallback_184',['SetBandsCallback',['../class_sinric_pro_speaker.html#a765ec6504ace15f556dbf2510ce93d0f',1,'SinricProSpeaker']]],
- ['setpowerlevelcallback_185',['SetPowerLevelCallback',['../class_sinric_pro_dim_switch.html#afbdda289acfd7d72c03bab3b69b42afd',1,'SinricProDimSwitch']]],
- ['setrangevaluecallback_186',['SetRangeValueCallback',['../class_sinric_pro_fan_u_s.html#ad2be7dbd98eae8443f8c76721cbffead',1,'SinricProFanUS::SetRangeValueCallback()'],['../class_sinric_pro_window_a_c.html#ad2be7dbd98eae8443f8c76721cbffead',1,'SinricProWindowAC::SetRangeValueCallback()']]],
- ['settargettemperaturecallback_187',['SetTargetTemperatureCallback',['../class_sinric_pro_thermostat.html#a345ea0fb9b4069b8c540b17009272f65',1,'SinricProThermostat::SetTargetTemperatureCallback()'],['../class_sinric_pro_window_a_c.html#a345ea0fb9b4069b8c540b17009272f65',1,'SinricProWindowAC::SetTargetTemperatureCallback()']]],
- ['setvolumecallback_188',['SetVolumeCallback',['../class_sinric_pro_speaker.html#aa495b90d483782760303ab45494deb7e',1,'SinricProSpeaker::SetVolumeCallback()'],['../class_sinric_pro_t_v.html#aa495b90d483782760303ab45494deb7e',1,'SinricProTV::SetVolumeCallback()']]],
- ['skipchannelscallback_189',['SkipChannelsCallback',['../class_sinric_pro_t_v.html#a955957998e893135fb04aa077304d3d6',1,'SinricProTV']]]
+ ['selectinputcallback_191',['SelectInputCallback',['../class_sinric_pro_t_v.html#a047ecacb194f2ad747fa2ab7e1117a88',1,'SinricProTV']]],
+ ['setbandscallback_192',['SetBandsCallback',['../class_sinric_pro_speaker.html#a765ec6504ace15f556dbf2510ce93d0f',1,'SinricProSpeaker']]],
+ ['setpowerlevelcallback_193',['SetPowerLevelCallback',['../class_sinric_pro_dim_switch.html#afbdda289acfd7d72c03bab3b69b42afd',1,'SinricProDimSwitch']]],
+ ['setrangevaluecallback_194',['SetRangeValueCallback',['../class_sinric_pro_fan_u_s.html#ad2be7dbd98eae8443f8c76721cbffead',1,'SinricProFanUS::SetRangeValueCallback()'],['../class_sinric_pro_window_a_c.html#ad2be7dbd98eae8443f8c76721cbffead',1,'SinricProWindowAC::SetRangeValueCallback()']]],
+ ['settargettemperaturecallback_195',['SetTargetTemperatureCallback',['../class_sinric_pro_thermostat.html#a345ea0fb9b4069b8c540b17009272f65',1,'SinricProThermostat::SetTargetTemperatureCallback()'],['../class_sinric_pro_window_a_c.html#a345ea0fb9b4069b8c540b17009272f65',1,'SinricProWindowAC::SetTargetTemperatureCallback()']]],
+ ['setvolumecallback_196',['SetVolumeCallback',['../class_sinric_pro_speaker.html#aa495b90d483782760303ab45494deb7e',1,'SinricProSpeaker::SetVolumeCallback()'],['../class_sinric_pro_t_v.html#aa495b90d483782760303ab45494deb7e',1,'SinricProTV::SetVolumeCallback()']]],
+ ['skipchannelscallback_197',['SkipChannelsCallback',['../class_sinric_pro_t_v.html#a955957998e893135fb04aa077304d3d6',1,'SinricProTV']]]
];
diff --git a/docs/search/typedefs_a.js b/docs/search/typedefs_a.js
index 9314c1e..3bd7604 100644
--- a/docs/search/typedefs_a.js
+++ b/docs/search/typedefs_a.js
@@ -1,4 +1,4 @@
var searchData=
[
- ['thermostatmodecallback_190',['ThermostatModeCallback',['../class_sinric_pro_thermostat.html#abe5ced42c285b52c2414e788dc8b63b3',1,'SinricProThermostat::ThermostatModeCallback()'],['../class_sinric_pro_window_a_c.html#abe5ced42c285b52c2414e788dc8b63b3',1,'SinricProWindowAC::ThermostatModeCallback()']]]
+ ['thermostatmodecallback_198',['ThermostatModeCallback',['../class_sinric_pro_thermostat.html#abe5ced42c285b52c2414e788dc8b63b3',1,'SinricProThermostat::ThermostatModeCallback()'],['../class_sinric_pro_window_a_c.html#abe5ced42c285b52c2414e788dc8b63b3',1,'SinricProWindowAC::ThermostatModeCallback()']]]
];
diff --git a/examples/DimSwitch/DimSwitch.ino b/examples/DimSwitch/DimSwitch.ino
new file mode 100644
index 0000000..a9287ee
--- /dev/null
+++ b/examples/DimSwitch/DimSwitch.ino
@@ -0,0 +1,99 @@
+/*
+ * If you encounter any issues:
+ * - check the readme.md at https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md
+ * - ensure all dependent libraries are installed
+ * - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
+ * - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
+ * - open serial monitor and check whats happening
+ * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
+ * - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
+ */
+
+// Uncomment the following line to enable serial debug output
+//#define ENABLE_DEBUG
+
+#ifdef ENABLE_DEBUG
+ #define DEBUG_ESP_PORT Serial
+ #define NODEBUG_WEBSOCKETS
+ #define NDEBUG
+#endif
+
+#include
+#ifdef ESP8266
+ #include
+#endif
+#ifdef ESP32
+ #include
+#endif
+
+#include "SinricPro.h"
+#include "SinricProDimSwitch.h"
+
+#define WIFI_SSID "YOUR-WIFI-SSID"
+#define WIFI_PASS "YOUR-WIFI-PASSWORD"
+#define APP_KEY "YOUR-APP-KEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
+#define APP_SECRET "YOUR-APP-SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
+#define DIMSWITCH_ID "YOUR-DEVICE-ID" // Should look like "5dc1564130xxxxxxxxxxxxxx"
+#define BAUD_RATE 9600 // Change baudrate to your need
+
+// we use a struct to store all states and values for our dimmable switch
+struct {
+ bool powerState = false;
+ int powerLevel = 0;
+} device_state;
+
+bool onPowerState(const String &deviceId, bool &state) {
+ Serial.printf("Device %s power turned %s \r\n", deviceId.c_str(), state?"on":"off");
+ device_state.powerState = state;
+ return true; // request handled properly
+}
+
+bool onPowerLevel(const String &deviceId, int &powerLevel) {
+ device_state.powerLevel = powerLevel;
+ Serial.printf("Device %s power level changed to %d\r\n", deviceId.c_str(), device_state.powerLevel);
+ return true;
+}
+
+bool onAdjustPowerLevel(const String &deviceId, int levelDelta) {
+ device_state.powerLevel += levelDelta;
+ Serial.printf("Device %s power level changed about %i to %d\r\n", deviceId.c_str(), levelDelta, device_state.powerLevel);
+ levelDelta = device_state.powerLevel;
+ return true;
+}
+
+void setupWiFi() {
+ Serial.printf("\r\n[Wifi]: Connecting");
+ WiFi.begin(WIFI_SSID, WIFI_PASS);
+
+ while (WiFi.status() != WL_CONNECTED) {
+ Serial.printf(".");
+ delay(250);
+ }
+ IPAddress localIP = WiFi.localIP();
+ Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
+}
+
+void setupSinricPro() {
+ SinricProDimSwitch &myDimSwitch = SinricPro[DIMSWITCH_ID];
+
+ // set callback function to device
+ myDimSwitch.onPowerState(onPowerState);
+ myDimSwitch.onPowerLevel(onPowerLevel);
+ myDimSwitch.onAdjustPowerLevel(onAdjustPowerLevel);
+
+ // setup SinricPro
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
+ SinricPro.begin(APP_KEY, APP_SECRET);
+}
+
+// main setup function
+void setup() {
+ Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
+ setupWiFi();
+ setupSinricPro();
+}
+
+void loop() {
+ SinricPro.handle();
+}
\ No newline at end of file
diff --git a/examples/GarageDoor/GarageDoor.ino b/examples/GarageDoor/GarageDoor.ino
index 59b1192..4577c4d 100644
--- a/examples/GarageDoor/GarageDoor.ino
+++ b/examples/GarageDoor/GarageDoor.ino
@@ -8,6 +8,7 @@
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
* - open serial monitor and check whats happening
+ * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
* - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
*/
@@ -164,15 +165,19 @@ void setupSinricPro() {
SinricProLock &garageDoor = SinricPro[GARAGEDOOR_ID];
garageDoor.onLockState(onLockState);
+ // setup SinricPro
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
SinricPro.begin(APP_KEY, APP_SECRET);
}
void setup() {
- Serial.begin(BAUD_RATE);
pinMode(RELAY, OUTPUT);
pinMode(ENDSTOP_OPEN, INPUT);
pinMode(ENDSTOP_CLOSED, INPUT);
lastDoorState = getDoorState();
+
+ Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
setupWiFi();
setupSinricPro();
}
diff --git a/examples/Light/Light.ino b/examples/Light/Light.ino
new file mode 100644
index 0000000..cf8faa4
--- /dev/null
+++ b/examples/Light/Light.ino
@@ -0,0 +1,165 @@
+/*
+ * If you encounter any issues:
+ * - check the readme.md at https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md
+ * - ensure all dependent libraries are installed
+ * - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
+ * - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
+ * - open serial monitor and check whats happening
+ * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
+ * - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
+ */
+
+// Uncomment the following line to enable serial debug output
+//#define ENABLE_DEBUG
+
+#ifdef ENABLE_DEBUG
+ #define DEBUG_ESP_PORT Serial
+ #define NODEBUG_WEBSOCKETS
+ #define NDEBUG
+#endif
+
+#include
+#ifdef ESP8266
+ #include
+#endif
+#ifdef ESP32
+ #include
+#endif
+
+#include "SinricPro.h"
+#include "SinricProLight.h"
+
+#define WIFI_SSID "YOUR-WIFI-SSID"
+#define WIFI_PASS "YOUR-WIFI-PASSWORD"
+#define APP_KEY "YOUR-APP-KEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
+#define APP_SECRET "YOUR-APP-SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
+#define LIGHT_ID "YOUR-DEVICE-ID" // Should look like "5dc1564130xxxxxxxxxxxxxx"
+#define BAUD_RATE 9600 // Change baudrate to your need
+
+// define array of supported color temperatures
+int colorTemperatureArray[] = {2200, 2700, 4000, 5500, 7000};
+int max_color_temperatures = sizeof(colorTemperatureArray) / sizeof(colorTemperatureArray[0]); // calculates how many elements are stored in colorTemperature array
+
+// a map used to convert a given color temperature into color temperature index (used for colorTemperatureArray)
+std::map colorTemperatureIndex;
+
+// initializes the map above with color temperatures and index values
+// so that the map can be used to do a reverse search like
+// int index = colorTemperateIndex[4000]; <- will result in index == 2
+void setupColorTemperatureIndex() {
+ Serial.printf("Setup color temperature lookup table\r\n");
+ for (int i=0;i < max_color_temperatures; i++) {
+ colorTemperatureIndex[colorTemperatureArray[i]] = i;
+ Serial.printf("colorTemperatureIndex[%i] = %i\r\n", colorTemperatureArray[i], colorTemperatureIndex[colorTemperatureArray[i]]);
+ }
+}
+
+// we use a struct to store all states and values for our light
+struct {
+ bool powerState = false;
+ int brightness = 0;
+ struct {
+ byte r = 0;
+ byte g = 0;
+ byte b = 0;
+ } color;
+ int colorTemperature = colorTemperatureArray[0]; // set colorTemperature to first element in colorTemperatureArray array
+} device_state;
+
+bool onPowerState(const String &deviceId, bool &state) {
+ Serial.printf("Device %s power turned %s \r\n", deviceId.c_str(), state?"on":"off");
+ device_state.powerState = state;
+ return true; // request handled properly
+}
+
+bool onBrightness(const String &deviceId, int &brightness) {
+ device_state.brightness = brightness;
+ Serial.printf("Device %s brightness level changed to %d\r\n", deviceId.c_str(), brightness);
+ return true;
+}
+
+bool onAdjustBrightness(const String &deviceId, int brightnessDelta) {
+ device_state.brightness += brightnessDelta;
+ Serial.printf("Device %s brightness level changed about %i to %d\r\n", deviceId.c_str(), brightnessDelta, device_state.brightness);
+ brightnessDelta = device_state.brightness;
+ return true;
+}
+
+bool onColor(const String &deviceId, byte &r, byte &g, byte &b) {
+ device_state.color.r = r;
+ device_state.color.g = g;
+ device_state.color.b = b;
+ Serial.printf("Device %s color changed to %d, %d, %d (RGB)\r\n", deviceId.c_str(), device_state.color.r, device_state.color.g, device_state.color.b);
+ return true;
+}
+
+bool onColorTemperature(const String &deviceId, int &colorTemperature) {
+ device_state.colorTemperature = colorTemperature;
+ Serial.printf("Device %s color temperature changed to %d\r\n", deviceId.c_str(), device_state.colorTemperature);
+ return true;
+}
+
+bool onIncreaseColorTemperature(const String &deviceId, int &colorTemperature) {
+ int index = colorTemperatureIndex[device_state.colorTemperature]; // get index of stored colorTemperature
+ index++; // do the increase
+ if (index < 0) index = 0; // make sure that index stays within array boundaries
+ if (index > max_color_temperatures-1) index = max_color_temperatures-1; // make sure that index stays within array boundaries
+ device_state.colorTemperature = colorTemperatureArray[index]; // get the color temperature value
+ Serial.printf("Device %s increased color temperature to %d\r\n", deviceId.c_str(), device_state.colorTemperature);
+ colorTemperature = device_state.colorTemperature; // return current color temperature value
+ return true;
+}
+
+bool onDecreaseColorTemperature(const String &deviceId, int &colorTemperature) {
+ int index = colorTemperatureIndex[device_state.colorTemperature]; // get index of stored colorTemperature
+ index--; // do the decrease
+ if (index < 0) index = 0; // make sure that index stays within array boundaries
+ if (index > max_color_temperatures-1) index = max_color_temperatures-1; // make sure that index stays within array boundaries
+ device_state.colorTemperature = colorTemperatureArray[index]; // get the color temperature value
+ Serial.printf("Device %s decreased color temperature to %d\r\n", deviceId.c_str(), device_state.colorTemperature);
+ colorTemperature = device_state.colorTemperature; // return current color temperature value
+ return true;
+}
+
+void setupWiFi() {
+ Serial.printf("\r\n[Wifi]: Connecting");
+ WiFi.begin(WIFI_SSID, WIFI_PASS);
+
+ while (WiFi.status() != WL_CONNECTED) {
+ Serial.printf(".");
+ delay(250);
+ }
+ IPAddress localIP = WiFi.localIP();
+ Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
+}
+
+void setupSinricPro() {
+ // get a new Light device from SinricPro
+ SinricProLight &myLight = SinricPro[LIGHT_ID];
+
+ // set callback function to device
+ myLight.onPowerState(onPowerState);
+ myLight.onBrightness(onBrightness);
+ myLight.onAdjustBrightness(onAdjustBrightness);
+ myLight.onColor(onColor);
+ myLight.onColorTemperature(onColorTemperature);
+ myLight.onIncreaseColorTemperature(onIncreaseColorTemperature);
+ myLight.onDecreaseColorTemperature(onDecreaseColorTemperature);
+
+ // setup SinricPro
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
+ SinricPro.begin(APP_KEY, APP_SECRET);
+}
+
+// main setup function
+void setup() {
+ Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
+ setupColorTemperatureIndex(); // setup our helper map
+ setupWiFi();
+ setupSinricPro();
+}
+
+void loop() {
+ SinricPro.handle();
+}
\ No newline at end of file
diff --git a/examples/Speaker/Speaker.ino b/examples/Speaker/Speaker.ino
new file mode 100644
index 0000000..0fcd94e
--- /dev/null
+++ b/examples/Speaker/Speaker.ino
@@ -0,0 +1,181 @@
+/*
+ * Example for how to use SinricPro Speaker device
+ *
+ * If you encounter any issues:
+ * - check the readme.md at https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md
+ * - ensure all dependent libraries are installed
+ * - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
+ * - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
+ * - open serial monitor and check whats happening
+ * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
+ * - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
+ */
+
+#include
+#ifdef ESP8266
+ #include
+#endif
+#ifdef ESP32
+ #include
+#endif
+
+#include "SinricPro.h"
+#include "SinricProSpeaker.h"
+
+#define WIFI_SSID "YOUR-WIFI-SSID"
+#define WIFI_PASS "YOUR-WIFI-PASSWORD"
+#define APP_KEY "YOUR-APP-KEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
+#define APP_SECRET "YOUR-APP-SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
+#define SPEAKER_ID "YOUR-DEVICE-ID" // Should look like "5dc1564130xxxxxxxxxxxxxx"
+#define BAUD_RATE 9600
+
+#define BANDS_INDEX_BASS 0
+#define BANDS_INDEX_MIDRANGE 1
+#define BANDS_INDEX_TREBBLE 2
+
+enum speakerModes {
+ mode_movie,
+ mode_music,
+ mode_night,
+ mode_sport,
+ mode_tv
+};
+
+// we use a struct to store all states and values for our speaker
+struct {
+ bool power;
+ unsigned int volume;
+ bool muted;
+ speakerModes mode;
+ int bands[3] = {0,0,0};
+} speakerState;
+
+// Speaker device callbacks
+bool onPowerState(const String &deviceId, bool &state) {
+ Serial.printf("Speaker turned %s\r\n", state?"on":"off");
+ speakerState.power = state; // set powerState
+ return true;
+}
+
+bool onSetVolume(const String &deviceId, int &volume) {
+ Serial.printf("Volume set to: %i\r\n", volume);
+ speakerState.volume = volume; // update Volume
+ return true;
+}
+
+bool onAdjustVolume(const String &deviceId, int &volumeDelta) {
+ speakerState.volume += volumeDelta; // calcualte new absolute volume
+ Serial.printf("Volume changed about %i to %i\r\n", volumeDelta, speakerState.volume);
+ volumeDelta = speakerState.volume; // return new absolute volume
+ return true;
+}
+
+bool onMute(const String &deviceId, bool &mute) {
+ Serial.printf("Speaker is %s\r\n", mute?"muted":"unmuted");
+ speakerState.muted = mute; // update muted state
+ return true;
+}
+
+bool onMediaControl(const String &deviceId, String &control) {
+ Serial.printf("MediaControl: %s\r\n", control.c_str());
+ if (control == "Play") {} // do whatever you want to do here
+ if (control == "Pause") {} // do whatever you want to do here
+ if (control == "Stop") {} // do whatever you want to do here
+ if (control == "StartOver") {} // do whatever you want to do here
+ if (control == "Previous") {} // do whatever you want to do here
+ if (control == "Next") {} // do whatever you want to do here
+ if (control == "Rewind") {} // do whatever you want to do here
+ if (control == "FastForward") {} // do whatever you want to do here
+ return true;
+}
+
+bool onSetMode(const String &deviceId, String &mode) {
+ Serial.printf("Speaker mode set to %s\r\n", mode.c_str());
+ if (mode == "MOVIE") speakerState.mode = mode_movie;
+ if (mode == "MUSIC") speakerState.mode = mode_music;
+ if (mode == "NIGHT") speakerState.mode = mode_night;
+ if (mode == "SPORT") speakerState.mode = mode_sport;
+ if (mode == "TV") speakerState.mode = mode_tv;
+ return true;
+}
+
+bool onSetBands(const String& deviceId, const String &bands, int &level) {
+ Serial.printf("Device %s bands %s set to %d\r\n", deviceId.c_str(), bands.c_str(), level);
+ int index;
+ if (bands == "BASS") index = BANDS_INDEX_BASS;
+ if (bands == "MIDRANGE") index = BANDS_INDEX_MIDRANGE;
+ if (bands == "TREBBLE") index = BANDS_INDEX_TREBBLE;
+ speakerState.bands[index] = level;
+ return true;
+}
+
+bool onAdjustBands(const String &deviceId, const String &bands, int &levelDelta) {
+ int index;
+ if (bands == "BASS") index = BANDS_INDEX_BASS;
+ if (bands == "MIDRANGE") index = BANDS_INDEX_MIDRANGE;
+ if (bands == "TREBBLE") index = BANDS_INDEX_TREBBLE;
+ speakerState.bands[index] += levelDelta;
+ levelDelta = speakerState.bands[index]; // return absolute trebble level
+
+ Serial.printf("Device %s bands \"%s\" adjusted about %i to %d\r\n", deviceId.c_str(), bands.c_str(), levelDelta, speakerState.bands[index]);
+ return true; // request handled properly
+}
+
+bool onResetBands(const String &deviceId, const String &bands, int &level) {
+ int index;
+ if (bands == "BASS") index = BANDS_INDEX_BASS;
+ if (bands == "MIDRANGE") index = BANDS_INDEX_MIDRANGE;
+ if (bands == "TREBBLE") index = BANDS_INDEX_TREBBLE;
+ speakerState.bands[index] = 0;
+ level = speakerState.bands[index]; // return new level
+
+ Serial.printf("Device %s bands \"%s\" reset to%d\r\n", deviceId.c_str(), bands.c_str(), speakerState.bands[index]);
+ return true; // request handled properly
+}
+
+
+// setup function for WiFi connection
+void setupWiFi() {
+ Serial.printf("\r\n[Wifi]: Connecting");
+ WiFi.begin(WIFI_SSID, WIFI_PASS);
+
+ while (WiFi.status() != WL_CONNECTED) {
+ Serial.printf(".");
+ delay(250);
+ }
+ IPAddress localIP = WiFi.localIP();
+ Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
+}
+
+// setup function for SinricPro
+void setupSinricPro() {
+ // add device to SinricPro
+ SinricProSpeaker& speaker = SinricPro[SPEAKER_ID];
+
+ // set callback functions to device
+ speaker.onPowerState(onPowerState);
+ speaker.onSetVolume(onSetVolume);
+ speaker.onAdjustVolume(onAdjustVolume);
+ speaker.onMute(onMute);
+ speaker.onSetBands(onSetBands);
+ speaker.onAdjustBands(onAdjustBands);
+ speaker.onResetBands(onResetBands);
+ speaker.onSetMode(onSetMode);
+ speaker.onMediaControl(onMediaControl);
+
+ // setup SinricPro
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
+ SinricPro.begin(APP_KEY, APP_SECRET);
+}
+
+// main setup function
+void setup() {
+ Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
+ setupWiFi();
+ setupSinricPro();
+}
+
+void loop() {
+ SinricPro.handle();
+}
diff --git a/examples/Switch/Switch.ino b/examples/Switch/Switch.ino
index 3ea92ab..52da510 100644
--- a/examples/Switch/Switch.ino
+++ b/examples/Switch/Switch.ino
@@ -10,6 +10,7 @@
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
* - open serial monitor and check whats happening
+ * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
* - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
*/
@@ -101,12 +102,14 @@ void setupWiFi() {
// setup function for SinricPro
void setupSinricPro() {
// add device to SinricPro
- SinricProSwitch& mySwitch = SinricPro.add(SWITCH_ID);
+ SinricProSwitch& mySwitch = SinricPro[SWITCH_ID];
// set callback function to device
mySwitch.onPowerState(onPowerState);
// setup SinricPro
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
SinricPro.begin(APP_KEY, APP_SECRET);
}
@@ -116,7 +119,7 @@ void setup() {
pinMode(LED_BUILTIN, OUTPUT); // define LED GPIO as output
digitalWrite(LED_BUILTIN, HIGH); // turn off LED on bootup
- Serial.begin(BAUD_RATE);
+ Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
setupWiFi();
setupSinricPro();
}
diff --git a/examples/TV/TV.ino b/examples/TV/TV.ino
index 0cc60ed..db61a22 100644
--- a/examples/TV/TV.ino
+++ b/examples/TV/TV.ino
@@ -9,6 +9,7 @@
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
* - open serial monitor and check whats happening
+ * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
* - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
*/
@@ -169,12 +170,14 @@ void setupSinricPro() {
myTV.onSkipChannels(onSkipChannels);
// setup SinricPro
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
SinricPro.begin(APP_KEY, APP_SECRET);
}
// main setup function
void setup() {
- Serial.begin(BAUD_RATE);
+ Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
Serial.printf("%d channels configured\r\n", MAX_CHANNELS);
setupWiFi();
diff --git a/examples/doorbell/doorbell.ino b/examples/doorbell/doorbell.ino
index 4ab4efe..9e2a6c6 100644
--- a/examples/doorbell/doorbell.ino
+++ b/examples/doorbell/doorbell.ino
@@ -9,6 +9,7 @@
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
* - open serial monitor and check whats happening
+ * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
* - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
*/
@@ -53,6 +54,7 @@ void checkButtonPress() {
if (actualMillis-lastBtnPress > 500) {
if (digitalRead(BUTTON_PIN)==LOW) {
+ Serial.printf("Ding dong...\r\n");
lastBtnPress = actualMillis;
// get Doorbell device back
@@ -82,6 +84,8 @@ void setupSinricPro() {
// add doorbell device to SinricPro
SinricPro.add(DOORBELL_ID);
// setup SinricPro
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
SinricPro.begin(APP_KEY, APP_SECRET);
}
@@ -89,7 +93,7 @@ void setupSinricPro() {
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP); // BUTTIN_PIN as INPUT
- Serial.begin(9600);
+ Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
setupWiFi();
setupSinricPro();
}
diff --git a/pio-examples/TV/platformio.ini b/examples/platformio/platformio.ini
similarity index 99%
rename from pio-examples/TV/platformio.ini
rename to examples/platformio/platformio.ini
index a392f2e..325d542 100644
--- a/pio-examples/TV/platformio.ini
+++ b/examples/platformio/platformio.ini
@@ -24,7 +24,7 @@ default_envs = ESP8266
; ============================================================
upload_speed = 921600
;upload_port = COM11
-monitor_speed = 115200
+monitor_speed = 9600
;monitor_port = COM11
lib_deps =
diff --git a/examples/temperaturesensor/temperaturesensor.ino b/examples/temperaturesensor/temperaturesensor.ino
index 43715d0..0d3db08 100644
--- a/examples/temperaturesensor/temperaturesensor.ino
+++ b/examples/temperaturesensor/temperaturesensor.ino
@@ -13,6 +13,7 @@
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#arduinoide
* - see https://github.com/sinricpro/esp8266-esp32-sdk/blob/master/README.md#dependencies
* - open serial monitor and check whats happening
+ * - check full user documentation at https://sinricpro.github.io/esp8266-esp32-sdk
* - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
*/
@@ -138,13 +139,15 @@ void setupSinricPro() {
mySensor.onPowerState(onPowerState);
// setup SinricPro
+ SinricPro.onConnected([](){ Serial.printf("Connected to SinricPro\r\n"); });
+ SinricPro.onDisconnected([](){ Serial.printf("Disconnected from SinricPro\r\n"); });
SinricPro.begin(APP_KEY, APP_SECRET);
SinricPro.restoreDeviceStates(true); // get latest known deviceState from server (is device turned on?)
}
// main setup function
void setup() {
- Serial.begin(BAUD_RATE);
+ Serial.begin(BAUD_RATE); Serial.printf("\r\n\r\n");
dht.setup(DHT_PIN);
setupWiFi();
diff --git a/library.json b/library.json
index 198b153..afd6b5b 100644
--- a/library.json
+++ b/library.json
@@ -13,17 +13,14 @@
"maintainer": true
}
],
- "version": "2.2.6",
+ "version": "2.2.7",
"frameworks": "arduino",
"platforms": [
"espressif8266",
"espressif32"
],
"examples":[
- "pio-examples/switch/src/switch.cpp",
- "pio-examples/doorbell/src/doorbell.cpp",
- "pio-examples/temperaturesensor/src/temperaturesensor.cpp",
- "pio-examples/tv/src/tv.cpp"
+ "examples/*/*.ino"
],
"license": "CC-BY-SA-4.0"
}
diff --git a/library.properties b/library.properties
index 2dc20d7..13e8ad0 100644
--- a/library.properties
+++ b/library.properties
@@ -1,11 +1,13 @@
name=SinricPro
-version=2.2.6
+version=2.2.7
author=Boris Jaeger
maintainer=Boris Jaeger
sentence=Library for https://sinric.pro - simple way to connect your device to alexa
paragraph=Simple way to control your IOT development boards like ESP8226 or ESP32 with Amazon Alexa or Google Home
category=Communication
-url=https://sinric.pro
+url=https://sinricpro.github.io/esp8266-esp32-sdk/index.html
architectures=esp8266,esp32
repository=https://github.com/sinricpro/esp8266-esp32-sdk.git
license=CC-BY-SA
+depends=ArduinoJson,WebSockets
+includes=SinricPro.h
diff --git a/pio-examples/TV/src/TV.cpp b/pio-examples/TV/src/TV.cpp
deleted file mode 100644
index c620f1f..0000000
--- a/pio-examples/TV/src/TV.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Example for how to use SinricPro TV device:
- * - setup a TV device
- * - handle request using callbacks
- *
- * If you encounter any issues:
- * - open serial monitor and check whats happening
- * - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
- */
-
-#include
-#ifdef ESP8266
- #include
-#endif
-#ifdef ESP32
- #include
-#endif
-
-#include "SinricPro.h"
-#include "SinricProTV.h"
-
-#define WIFI_SSID "YOUR-WIFI-SSID"
-#define WIFI_PASS "YOUR-WIFI-PASSWORD"
-#define APP_KEY "YOUR-APP-KEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
-#define APP_SECRET "YOUR-APP-SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
-#define TV_ID "YOUR-DEVICE-ID" // Should look like "5dc1564130xxxxxxxxxxxxxx"
-#define BAUD_RATE 115200
-
-bool tvPowerState;
-unsigned int tvVolume;
-unsigned int tvChannel;
-bool tvMuted;
-
-// channelNames used to convert channelNumber into channelName
-// please put in your TV channel names
-// channel numbers starts counting from 0!
-// so "ZDF" is channel 2
-const char* channelNames[] = {
- "A/V",
- "ard",
- "ZDF",
- "n. d. r.",
- "kabel eins",
- "VOX",
- "Sat.1",
- "ProSieben",
- "rtl",
- "RTL II",
- "SUPER RTL",
- "KiKA"
-};
-
-#define MAX_CHANNELS sizeof(channelNames) / sizeof(channelNames[0]) // just to determine how many channels are in channelNames array
-
-// map channelNumbers used to convert channelName into channelNumber
-// This map is initialized in "setupChannelNumbers()" function by using the "channelNames" array
-std::map channelNumbers;
-
-void setupChannelNumbers() {
- for (unsigned int i=0; i < MAX_CHANNELS; i++) {
- channelNumbers[channelNames[i]] = i;
- }
-}
-
-
-// TV device callbacks
-
-bool onAdjustVolume(const String &deviceId, int &volumeDelta) {
- tvVolume += volumeDelta; // calcualte new absolute volume
- Serial.printf("Volume changed about %i to %i\r\n", volumeDelta, tvVolume);
- volumeDelta = tvVolume; // return new absolute volume
- return true;
-}
-
-bool onChangeChannel(const String &deviceId, String &channel) {
- tvChannel = channelNumbers[channel]; // save new channelNumber in tvChannel variable
- Serial.printf("Change channel to \"%s\" (channel number %d)\r\n", channel.c_str(), tvChannel);
- return true;
-}
-
-bool onChangeChannelNumber(const String& deviceId, int channelNumber, String& channelName) {
- tvChannel = channelNumber; // update tvChannel to new channel number
- if (tvChannel < 0) tvChannel = 0;
- if (tvChannel > MAX_CHANNELS-1) tvChannel = MAX_CHANNELS-1;
-
- channelName = channelNames[tvChannel]; // return the channelName
-
- Serial.printf("Change to channel to %d (channel name \"%s\")\r\n", tvChannel, channelName.c_str());
- return true;
-}
-
-bool onMediaControl(const String &deviceId, String &control) {
- Serial.printf("MediaControl: %s\r\n", control.c_str());
- if (control == "Play") {} // do whatever you want to do here
- if (control == "Pause") {} // do whatever you want to do here
- if (control == "Stop") {} // do whatever you want to do here
- if (control == "StartOver") {} // do whatever you want to do here
- if (control == "Previous") {} // do whatever you want to do here
- if (control == "Next") {} // do whatever you want to do here
- if (control == "Rewind") {} // do whatever you want to do here
- if (control == "FastForward") {} // do whatever you want to do here
- return true;
-}
-
-bool onMute(const String &deviceId, bool &mute) {
- Serial.printf("TV volume is %s\r\n", mute?"muted":"unmuted");
- tvMuted = mute; // set tvMuted state
- return true;
-}
-
-bool onPowerState(const String &deviceId, bool &state) {
- Serial.printf("TV turned %s\r\n", state?"on":"off");
- tvPowerState = state; // set powerState
- return true;
-}
-
-bool onSelectInput(const String &deviceId, String &input) {
- Serial.printf("Input changed to %s\r\n", input.c_str());
- return true;
-}
-
-bool onSetVolume(const String &deviceId, int &volume) {
- Serial.printf("Volume set to: %i\r\n", volume);
- tvVolume = volume; // update tvVolume
- return true;
-}
-
-bool onSkipChannels(const String &deviceId, const int channelCount, String &channelName) {
- tvChannel += channelCount; // calculate new channel number
- if (tvChannel < 0) tvChannel = 0;
- if (tvChannel > MAX_CHANNELS-1) tvChannel = MAX_CHANNELS-1;
- channelName = String(channelNames[tvChannel]); // return channel name
-
- Serial.printf("Skip channel: %i (number: %i / name: \"%s\")\r\n", channelCount, tvChannel, channelName.c_str());
-
- return true;
-}
-
-// setup function for WiFi connection
-void setupWiFi() {
- Serial.printf("\r\n[Wifi]: Connecting");
- WiFi.begin(WIFI_SSID, WIFI_PASS);
-
- while (WiFi.status() != WL_CONNECTED) {
- Serial.printf(".");
- delay(250);
- }
- IPAddress localIP = WiFi.localIP();
- Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
-}
-
-// setup function for SinricPro
-void setupSinricPro() {
- // add device to SinricPro
- SinricProTV& myTV = SinricPro[TV_ID];
-
- // set callback functions to device
- myTV.onAdjustVolume(onAdjustVolume);
- myTV.onChangeChannel(onChangeChannel);
- myTV.onChangeChannelNumber(onChangeChannelNumber);
- myTV.onMediaControl(onMediaControl);
- myTV.onMute(onMute);
- myTV.onPowerState(onPowerState);
- myTV.onSelectInput(onSelectInput);
- myTV.onSetVolume(onSetVolume);
- myTV.onSkipChannels(onSkipChannels);
-
- // setup SinricPro
- SinricPro.begin(APP_KEY, APP_SECRET);
-}
-
-// main setup function
-void setup() {
- Serial.begin(BAUD_RATE);
- Serial.printf("%d channels configured\r\n", MAX_CHANNELS);
-
- setupWiFi();
- setupSinricPro();
- setupChannelNumbers();
-}
-
-void loop() {
- SinricPro.handle();
-}
diff --git a/pio-examples/doorbell/platformio.ini b/pio-examples/doorbell/platformio.ini
deleted file mode 100644
index bf6ec65..0000000
--- a/pio-examples/doorbell/platformio.ini
+++ /dev/null
@@ -1,129 +0,0 @@
-;PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; https://docs.platformio.org/page/projectconf.html
-
-[platformio]
-; ============================================================
-; chose environment:
-; ESP8266
-; ESP32
-; ============================================================
-default_envs = ESP8266
-;default_envs = ESP32
-
-[env]
-; ============================================================
-; Serial configuration
-; choose upload speed, serial-monitor speed
-; ============================================================
-upload_speed = 921600
-;upload_port = COM11
-monitor_speed = 115200
-;monitor_port = COM11
-
-lib_deps =
- ArduinoJson@~6.11
- WebSockets
-
-build_flags =
-; set your debug output (default=Serial)
- -D DEBUG_ESP_PORT=Serial
-; comment the folowing line to enable Websockets debugging
- -D NODEBUG_WEBSOCKETS
-; comment the folowing line to enable WiFi debugging
- -D NDEBUG
-; comment the following line to enable SinricPro debugging
-; -D NODEBUG_SINRIC
-
-
-[env:ESP8266]
-platform = espressif8266
-framework = arduino
-; ============================================================
-; Board configuration
-; choose your board by uncommenting one of the following lines
-; ============================================================
-;board = gen4iod
-;board = huzzah
-;board = oak
-;board = esp_wroom_02
-;board = espduino
-;board = espectro
-;board = espino
-;board = espresso_lite_v1
-;board = espresso_lite_v2
-;board = esp12e
-;board = esp01_1m
-;board = esp01
-;board = esp07
-;board = esp8285
-;board = heltec_wifi_kit_8
-;board = inventone
-;board = nodemcu
-board = nodemcuv2
-;board = modwifi
-;board = phoenix_v1
-;board = phoenix_v2
-;board = sparkfunBlynk
-;board = thing
-;board = thingdev
-;board = esp210
-;board = espinotee
-;board = d1
-;board = d1_mini
-;board = d1_mini_lite
-;board = d1_mini_pro
-;board = wifi_slot
-;board = wifiduino
-;board = wifinfo
-;board = wio_link
-;board = wio_node
-;board = xinabox_cw01
-;board = esp32doit-devkit-v1
-
-[env:ESP32]
-platform = espressif32
-framework = arduino
-; ============================================================
-; Board configuration
-; choose your board by uncommenting one of the following lines
-; ============================================================
-;board = esp32cam
-;board = alksesp32
-;board = featheresp32
-;board = espea32
-;board = bpi-bit
-;board = d-duino-32
-board = esp32doit-devkit-v1
-;board = pocket_32
-;board = fm-devkit
-;board = pico32
-;board = esp32-evb
-;board = esp32-gateway
-;board = esp32-pro
-;board = esp32-poe
-;board = oroca_edubot
-;board = onehorse32dev
-;board = lopy
-;board = lopy4
-;board = wesp32
-;board = esp32thing
-;board = sparkfun_lora_gateway_1-channel
-;board = ttgo-lora32-v1
-;board = ttgo-t-beam
-;board = turta_iot_node
-;board = lolin_d32
-;board = lolin_d32_pro
-;board = lolin32
-;board = wemosbat
-;board = widora-air
-;board = xinabox_cw02
-;board = iotbusio
-;board = iotbusproteus
-;board = nina_w10
diff --git a/pio-examples/doorbell/src/doorbell.cpp b/pio-examples/doorbell/src/doorbell.cpp
deleted file mode 100644
index 6eb6207..0000000
--- a/pio-examples/doorbell/src/doorbell.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Example for how to use SinricPro Doorbell device:
- * - setup a doorbell device
- * - send event to sinricPro server if button is pressed
- *
- * If you encounter any issues:
- * - open serial monitor and check whats happening
- * - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
- */
-
-#include
-#ifdef ESP8266
- #include
-#endif
-#ifdef ESP32
- #include
-#endif
-
-#include "SinricPro.h"
-#include "SinricProDoorbell.h"
-
-#define WIFI_SSID "YOUR-WIFI-SSID"
-#define WIFI_PASS "YOUR-WIFI-PASSWORD"
-#define APP_KEY "YOUR-APP-KEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
-#define APP_SECRET "YOUR-APP-SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
-#define DOORBELL_ID "YOUR-DEVICE-ID" // Should look like "5dc1564130xxxxxxxxxxxxxx"
-
-// change this to your button PIN
-// on NodeMCU D3 / GPIO-0 is flash button PIN so you can use the builtin flash button
-#define BUTTON_PIN 0
-
-
-// checkButtonpress
-// reads if BUTTON_PIN gets LOW and send Event
-void checkButtonPress() {
- static unsigned long lastBtnPress;
- unsigned long actualMillis = millis();
-
- if (actualMillis-lastBtnPress > 500) {
- if (digitalRead(BUTTON_PIN)==LOW) {
- lastBtnPress = actualMillis;
-
- // get Doorbell device back
- SinricProDoorbell& myDoorbell = SinricPro[DOORBELL_ID];
-
- // send doorbell event
- myDoorbell.sendDoorbellEvent();
- }
- }
-}
-
-// setup function for WiFi connection
-void setupWiFi() {
- Serial.printf("\r\n[Wifi]: Connecting");
- WiFi.begin(WIFI_SSID, WIFI_PASS);
-
- while (WiFi.status() != WL_CONNECTED) {
- Serial.printf(".");
- delay(250);
- }
- IPAddress localIP = WiFi.localIP();
- Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
-}
-
-// setup function for SinricPro
-void setupSinricPro() {
- // add doorbell device to SinricPro
- SinricPro.add(DOORBELL_ID);
- // setup SinricPro
- SinricPro.begin(APP_KEY, APP_SECRET);
-}
-
-// main setup function
-void setup() {
- pinMode(BUTTON_PIN, INPUT_PULLUP); // BUTTIN_PIN as INPUT
-
- Serial.begin(115200);
- setupWiFi();
- setupSinricPro();
-}
-
-void loop() {
- checkButtonPress();
- SinricPro.handle();
-}
diff --git a/pio-examples/switch/platformio.ini b/pio-examples/switch/platformio.ini
deleted file mode 100644
index bf6ec65..0000000
--- a/pio-examples/switch/platformio.ini
+++ /dev/null
@@ -1,129 +0,0 @@
-;PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; https://docs.platformio.org/page/projectconf.html
-
-[platformio]
-; ============================================================
-; chose environment:
-; ESP8266
-; ESP32
-; ============================================================
-default_envs = ESP8266
-;default_envs = ESP32
-
-[env]
-; ============================================================
-; Serial configuration
-; choose upload speed, serial-monitor speed
-; ============================================================
-upload_speed = 921600
-;upload_port = COM11
-monitor_speed = 115200
-;monitor_port = COM11
-
-lib_deps =
- ArduinoJson@~6.11
- WebSockets
-
-build_flags =
-; set your debug output (default=Serial)
- -D DEBUG_ESP_PORT=Serial
-; comment the folowing line to enable Websockets debugging
- -D NODEBUG_WEBSOCKETS
-; comment the folowing line to enable WiFi debugging
- -D NDEBUG
-; comment the following line to enable SinricPro debugging
-; -D NODEBUG_SINRIC
-
-
-[env:ESP8266]
-platform = espressif8266
-framework = arduino
-; ============================================================
-; Board configuration
-; choose your board by uncommenting one of the following lines
-; ============================================================
-;board = gen4iod
-;board = huzzah
-;board = oak
-;board = esp_wroom_02
-;board = espduino
-;board = espectro
-;board = espino
-;board = espresso_lite_v1
-;board = espresso_lite_v2
-;board = esp12e
-;board = esp01_1m
-;board = esp01
-;board = esp07
-;board = esp8285
-;board = heltec_wifi_kit_8
-;board = inventone
-;board = nodemcu
-board = nodemcuv2
-;board = modwifi
-;board = phoenix_v1
-;board = phoenix_v2
-;board = sparkfunBlynk
-;board = thing
-;board = thingdev
-;board = esp210
-;board = espinotee
-;board = d1
-;board = d1_mini
-;board = d1_mini_lite
-;board = d1_mini_pro
-;board = wifi_slot
-;board = wifiduino
-;board = wifinfo
-;board = wio_link
-;board = wio_node
-;board = xinabox_cw01
-;board = esp32doit-devkit-v1
-
-[env:ESP32]
-platform = espressif32
-framework = arduino
-; ============================================================
-; Board configuration
-; choose your board by uncommenting one of the following lines
-; ============================================================
-;board = esp32cam
-;board = alksesp32
-;board = featheresp32
-;board = espea32
-;board = bpi-bit
-;board = d-duino-32
-board = esp32doit-devkit-v1
-;board = pocket_32
-;board = fm-devkit
-;board = pico32
-;board = esp32-evb
-;board = esp32-gateway
-;board = esp32-pro
-;board = esp32-poe
-;board = oroca_edubot
-;board = onehorse32dev
-;board = lopy
-;board = lopy4
-;board = wesp32
-;board = esp32thing
-;board = sparkfun_lora_gateway_1-channel
-;board = ttgo-lora32-v1
-;board = ttgo-t-beam
-;board = turta_iot_node
-;board = lolin_d32
-;board = lolin_d32_pro
-;board = lolin32
-;board = wemosbat
-;board = widora-air
-;board = xinabox_cw02
-;board = iotbusio
-;board = iotbusproteus
-;board = nina_w10
diff --git a/pio-examples/switch/src/switch.cpp b/pio-examples/switch/src/switch.cpp
deleted file mode 100644
index 97ce489..0000000
--- a/pio-examples/switch/src/switch.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Example for how to use SinricPro Switch device:
- * - setup a switch device
- * - handle request using callback (turn on/off builtin led indicating device power state)
- * - send event to sinricPro server (flash button is used to turn on/off device manually)
- *
- * If you encounter any issues:
- * - open serial monitor and check whats happening
- * - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
- */
-
-#include
-#ifdef ESP8266
- #include
-#endif
-#ifdef ESP32
- #include
-#endif
-
-#include "SinricPro.h"
-#include "SinricProSwitch.h"
-
-#define WIFI_SSID "YOUR-WIFI-SSID"
-#define WIFI_PASS "YOUR-WIFI-PASSWORD"
-#define APP_KEY "YOUR-APP-KEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
-#define APP_SECRET "YOUR-APP-SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
-#define SWITCH_ID "YOUR-DEVICE-ID" // Should look like "5dc1564130xxxxxxxxxxxxxx"
-
-#define BTN_FLASH 0
-
-bool myPowerState = false;
-unsigned long lastBtnPress = 0;
-
-/* bool onPowerState(String deviceId, bool &state)
- *
- * Callback for setPowerState request
- * parameters
- * String deviceId (r)
- * contains deviceId (useful if this callback used by multiple devices)
- * bool &state (r/w)
- * contains the requested state (true:on / false:off)
- * must return the new state
- *
- * return
- * true if request should be marked as handled correctly / false if not
- */
-bool onPowerState(const String &deviceId, bool &state) {
- Serial.printf("Device %s turned %s (via SinricPro) \r\n", deviceId.c_str(), state?"on":"off");
- myPowerState = state;
- digitalWrite(LED_BUILTIN, myPowerState?LOW:HIGH);
- return true; // request handled properly
-}
-
-void handleButtonPress() {
- unsigned long actualMillis = millis(); // get actual millis() and keep it in variable actualMillis
- if (digitalRead(BTN_FLASH) == LOW && actualMillis - lastBtnPress > 1000) { // is button pressed (inverted logic! button pressed = LOW) and debounced?
- if (myPowerState) { // flip myPowerState: if it was true, set it to false, vice versa
- myPowerState = false;
- } else {
- myPowerState = true;
- }
- digitalWrite(LED_BUILTIN, myPowerState?LOW:HIGH); // if myPowerState indicates device turned on: turn on led (builtin led uses inverted logic: LOW = LED ON / HIGH = LED OFF)
-
- // get Switch device back
- SinricProSwitch& mySwitch = SinricPro[SWITCH_ID];
- // send powerstate event
- mySwitch.sendPowerStateEvent(myPowerState); // send the new powerState to SinricPro server
- Serial.printf("Device %s turned %s (manually via flashbutton)\r\n", mySwitch.getDeviceId(), myPowerState?"on":"off");
-
- lastBtnPress = actualMillis; // update last button press variable
- }
-}
-
-// setup function for WiFi connection
-void setupWiFi() {
- Serial.printf("\r\n[Wifi]: Connecting");
- WiFi.begin(WIFI_SSID, WIFI_PASS);
-
- while (WiFi.status() != WL_CONNECTED) {
- Serial.printf(".");
- delay(250);
- }
- IPAddress localIP = WiFi.localIP();
- Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
-}
-
-// setup function for SinricPro
-void setupSinricPro() {
- // add device to SinricPro
- SinricProSwitch& mySwitch = SinricPro.add(SWITCH_ID);
-
- // set callback function to device
- mySwitch.onPowerState(onPowerState);
-
- // setup SinricPro
- SinricPro.begin(APP_KEY, APP_SECRET);
-}
-
-// main setup function
-void setup() {
- pinMode(BTN_FLASH, INPUT_PULLUP); // GPIO 0 as input, pulled high
- pinMode(LED_BUILTIN, OUTPUT); // define LED GPIO as output
- digitalWrite(LED_BUILTIN, HIGH); // turn off LED on bootup
-
- Serial.begin(115200);
- setupWiFi();
- setupSinricPro();
-}
-
-void loop() {
- handleButtonPress();
- SinricPro.handle();
-}
diff --git a/pio-examples/temperaturesensor/DHT22_Wiring.png b/pio-examples/temperaturesensor/DHT22_Wiring.png
deleted file mode 100644
index 1aa8092..0000000
Binary files a/pio-examples/temperaturesensor/DHT22_Wiring.png and /dev/null differ
diff --git a/pio-examples/temperaturesensor/README.md b/pio-examples/temperaturesensor/README.md
deleted file mode 100644
index bf31efe..0000000
--- a/pio-examples/temperaturesensor/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Temperature Sensor Example
-
-
-D5: connected to DHT22 signal and via 10k resistor to +3.3V
diff --git a/pio-examples/temperaturesensor/platformio.ini b/pio-examples/temperaturesensor/platformio.ini
deleted file mode 100644
index 6c7d7a6..0000000
--- a/pio-examples/temperaturesensor/platformio.ini
+++ /dev/null
@@ -1,131 +0,0 @@
-;PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; https://docs.platformio.org/page/projectconf.html
-
-[platformio]
-; ============================================================
-; chose environment:
-; ESP8266
-; ESP32
-; ============================================================
-default_envs = ESP8266
-;default_envs = ESP32
-
-[env]
-; ============================================================
-; Serial configuration
-; choose upload speed, serial-monitor speed
-; ============================================================
-upload_speed = 921600
-;upload_port = COM11
-monitor_speed = 115200
-;monitor_port = COM11
-
-lib_deps =
- ArduinoJson@~6.11
- WebSockets
- 1671
-
-
-build_flags =
-; set your debug output (default=Serial)
- -D DEBUG_ESP_PORT=Serial
-; comment the folowing line to enable Websockets debugging
- -D NODEBUG_WEBSOCKETS
-; comment the folowing line to enable WiFi debugging
- -D NDEBUG
-; comment the following line to enable SinricPro debugging
- -D NODEBUG_SINRIC
-
-
-[env:ESP8266]
-platform = espressif8266
-framework = arduino
-; ============================================================
-; Board configuration
-; choose your board by uncommenting one of the following lines
-; ============================================================
-;board = gen4iod
-;board = huzzah
-;board = oak
-;board = esp_wroom_02
-;board = espduino
-;board = espectro
-;board = espino
-;board = espresso_lite_v1
-;board = espresso_lite_v2
-;board = esp12e
-;board = esp01_1m
-;board = esp01
-;board = esp07
-;board = esp8285
-;board = heltec_wifi_kit_8
-;board = inventone
-;board = nodemcu
-board = nodemcuv2
-;board = modwifi
-;board = phoenix_v1
-;board = phoenix_v2
-;board = sparkfunBlynk
-;board = thing
-;board = thingdev
-;board = esp210
-;board = espinotee
-;board = d1
-;board = d1_mini
-;board = d1_mini_lite
-;board = d1_mini_pro
-;board = wifi_slot
-;board = wifiduino
-;board = wifinfo
-;board = wio_link
-;board = wio_node
-;board = xinabox_cw01
-;board = esp32doit-devkit-v1
-
-[env:ESP32]
-platform = espressif32
-framework = arduino
-; ============================================================
-; Board configuration
-; choose your board by uncommenting one of the following lines
-; ============================================================
-;board = esp32cam
-;board = alksesp32
-;board = featheresp32
-;board = espea32
-;board = bpi-bit
-;board = d-duino-32
-board = esp32doit-devkit-v1
-;board = pocket_32
-;board = fm-devkit
-;board = pico32
-;board = esp32-evb
-;board = esp32-gateway
-;board = esp32-pro
-;board = esp32-poe
-;board = oroca_edubot
-;board = onehorse32dev
-;board = lopy
-;board = lopy4
-;board = wesp32
-;board = esp32thing
-;board = sparkfun_lora_gateway_1-channel
-;board = ttgo-lora32-v1
-;board = ttgo-t-beam
-;board = turta_iot_node
-;board = lolin_d32
-;board = lolin_d32_pro
-;board = lolin32
-;board = wemosbat
-;board = widora-air
-;board = xinabox_cw02
-;board = iotbusio
-;board = iotbusproteus
-;board = nina_w10
diff --git a/pio-examples/temperaturesensor/src/temperaturesensor.cpp b/pio-examples/temperaturesensor/src/temperaturesensor.cpp
deleted file mode 100644
index 723dd6f..0000000
--- a/pio-examples/temperaturesensor/src/temperaturesensor.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Example for how to use SinricPro Temperaturesensor device:
- * - setup a temperature sensor device
- * - send temperature event to SinricPro server when temperature has changed
- *
- * DHT Library used in this example: https://github.com/markruys/arduino-DHT
- * DHT Sensor is connected to D5 on ESP8266 devices / GPIO 5 on ESP32 devices
- *
- * If you encounter any issues:
- * - open serial monitor and check whats happening
- * - visit https://github.com/sinricpro/esp8266-esp32-sdk/issues and check for existing issues or open a new one
- */
-
-#include
-#ifdef ESP8266
- #include
-#endif
-#ifdef ESP32
- #include
-#endif
-
-#include "SinricPro.h"
-#include "SinricProTemperaturesensor.h"
-#include "DHT.h"
-
-#define WIFI_SSID "YOUR-WIFI-SSID"
-#define WIFI_PASS "YOUR-WIFI-PASSWORD"
-#define APP_KEY "YOUR-APP-KEY" // Should look like "de0bxxxx-1x3x-4x3x-ax2x-5dabxxxxxxxx"
-#define APP_SECRET "YOUR-APP-SECRET" // Should look like "5f36xxxx-x3x7-4x3x-xexe-e86724a9xxxx-4c4axxxx-3x3x-x5xe-x9x3-333d65xxxxxx"
-#define TEMP_SENSOR_ID "YOUR-DEVICE-ID" // Should look like "5dc1564130xxxxxxxxxxxxxx"
-#define BAUD_RATE 115200 // Change baudrate to your need (used for serial monitor)
-#define EVENT_WAIT_TIME 60000 // send event every 60 seconds
-
-#ifdef ESP8266
- #define DHT_PIN D5
-#endif
-#ifdef ESP32
- #define DHT_PIN 5
-#endif
-
-DHT dht; // DHT sensor
-
-bool deviceIsOn; // Temeprature sensor on/off state
-float temperature; // actual temperature
-float humidity; // actual humidity
-float lastTemperature; // last known temperature (for compare)
-float lastHumidity; // last known humidity (for compare)
-unsigned long lastEvent = (-EVENT_WAIT_TIME); // last time event has been sent
-
-/* bool onPowerState(String deviceId, bool &state)
- *
- * Callback for setPowerState request
- * parameters
- * String deviceId (r)
- * contains deviceId (useful if this callback used by multiple devices)
- * bool &state (r/w)
- * contains the requested state (true:on / false:off)
- * must return the new state
- *
- * return
- * true if request should be marked as handled correctly / false if not
- */
-bool onPowerState(const String &deviceId, bool &state) {
- Serial.printf("Temperaturesensor turned %s (via SinricPro) \r\n", state?"on":"off");
- deviceIsOn = state; // turn on / off temperature sensor
- return true; // request handled properly
-}
-
-/* handleTemperatatureSensor()
- * - Checks if Temperaturesensor is turned on
- * - Checks if time since last event > EVENT_WAIT_TIME to prevent sending too much events
- * - Get actual temperature and humidity and check if these values are valid
- * - Compares actual temperature and humidity to last known temperature and humidity
- * - Send event to SinricPro Server if temperature or humidity changed
- */
-void handleTemperaturesensor() {
- if (deviceIsOn == false) return; // device is off...do nothing
-
- unsigned long actualMillis = millis();
- if (actualMillis - lastEvent < EVENT_WAIT_TIME) return; //only check every EVENT_WAIT_TIME milliseconds
-
- temperature = dht.getTemperature(); // get actual temperature
- humidity = dht.getHumidity(); // get actual humidity
-
- if (isnan(temperature) || isnan(humidity)) { // reading failed...
- Serial.printf("DHT reading failed!\r\n"); // print error message
- return; // try again next time
- }
-
- if (temperature == lastTemperature || humidity == lastHumidity) return; // if no values changed do nothing...
-
- SinricProTemperaturesensor &mySensor = SinricPro[TEMP_SENSOR_ID]; // get temperaturesensor device
- bool success = mySensor.sendTemperatureEvent(temperature, humidity); // send event
- if (success) { // if event was sent successfuly, print temperature and humidity to serial
- Serial.printf("Temperature: %2.1f Celsius\tHumidity: %2.1f%%\r\n", temperature, humidity);
- } else { // if sending event failed, print error message
- Serial.printf("Something went wrong...could not send Event to server!\r\n");
- }
-
- lastTemperature = temperature; // save actual temperature for next compare
- lastHumidity = humidity; // save actual humidity for next compare
- lastEvent = actualMillis; // save actual time for next compare
-}
-
-
-// setup function for WiFi connection
-void setupWiFi() {
- Serial.printf("\r\n[Wifi]: Connecting");
- WiFi.begin(WIFI_SSID, WIFI_PASS);
-
- while (WiFi.status() != WL_CONNECTED) {
- Serial.printf(".");
- delay(250);
- }
- IPAddress localIP = WiFi.localIP();
- Serial.printf("connected!\r\n[WiFi]: IP-Address is %d.%d.%d.%d\r\n", localIP[0], localIP[1], localIP[2], localIP[3]);
-}
-
-// setup function for SinricPro
-void setupSinricPro() {
- // add device to SinricPro
- SinricProTemperaturesensor &mySensor = SinricPro[TEMP_SENSOR_ID];
- mySensor.onPowerState(onPowerState);
-
- // setup SinricPro
- SinricPro.begin(APP_KEY, APP_SECRET);
- SinricPro.restoreDeviceStates(true); // get latest known deviceState from server (is device turned on?)
-}
-
-// main setup function
-void setup() {
- Serial.begin(BAUD_RATE);
- dht.setup(DHT_PIN);
-
- setupWiFi();
- setupSinricPro();
-}
-
-void loop() {
- SinricPro.handle();
- handleTemperaturesensor();
-}
diff --git a/src/SinricPro.h b/src/SinricPro.h
index 7babf64..0d5f10f 100644
--- a/src/SinricPro.h
+++ b/src/SinricPro.h
@@ -32,9 +32,24 @@ class SinricProClass : public SinricProInterface {
void stop();
bool isConnected();
- typedef std::function ConnectCallbackHandler;
- void onConnected(ConnectCallbackHandler cb);
- void onDisconnected(ConnectCallbackHandler cb);
+ /**
+ * @brief Callback definition for onConnected function
+ *
+ * Gets called when device is connected to SinricPro server
+ * @param void
+ * @return void
+ */
+ typedef std::function ConnectedCallbackHandler;
+ /**
+ * @brief Callback definition for onDisconnected function
+ *
+ * Gets called when device is disconnected from SinricPro server
+ * @param void
+ * @return void
+ */
+ typedef std::function DisconnectedCallbackHandler;
+ void onConnected(ConnectedCallbackHandler cb);
+ void onDisconnected(DisconnectedCallbackHandler cb);
void restoreDeviceStates(bool flag);
@@ -395,12 +410,29 @@ bool SinricProClass::isConnected() {
return _websocketListener.isConnected();
};
-
-void SinricProClass::onConnected(ConnectCallbackHandler cb) {
+/**
+ * @brief Set callback function for websocket connected event
+ *
+ * @param cb Function pointer to a `ConnectedCallbackHandler` function
+ * @return void
+ * @see ConnectedCallbackHandler
+ * @section onConnected Example-Code
+ * @snippet callbacks.cpp onConnected
+ **/
+void SinricProClass::onConnected(ConnectedCallbackHandler cb) {
_websocketListener.onConnected(cb);
}
-void SinricProClass::onDisconnected(ConnectCallbackHandler cb) {
+/**
+ * @brief Set callback function for websocket disconnected event
+ *
+ * @param cb Function pointer to a `DisconnectedCallbackHandler` function
+ * @return void
+ * @see DisconnectedCallbackHandler
+ * @section onDisconnected Example-Code
+ * @snippet callbacks.cpp onDisconnected
+ **/
+void SinricProClass::onDisconnected(DisconnectedCallbackHandler cb) {
_websocketListener.onDisconnected(cb);
}
diff --git a/src/SinricProConfig.h b/src/SinricProConfig.h
index ddc533f..a317f29 100644
--- a/src/SinricProConfig.h
+++ b/src/SinricProConfig.h
@@ -25,7 +25,7 @@
// Version Configuration
#define SINRICPRO_VERSION_MAJOR 2
#define SINRICPRO_VERSION_MINOR 2
-#define SINRICPRO_VERSION_REVISION 6
+#define SINRICPRO_VERSION_REVISION 7
#define SINRICPRO_VERSION STR(SINRICPRO_VERSION_MAJOR) "." STR(SINRICPRO_VERSION_MINOR) "." STR(SINRICPRO_VERSION_REVISION)
// Server Configuration