Skip to content

Commit 12aaf22

Browse files
committed
fix: pin mapping and refactor headers
1 parent 40a669e commit 12aaf22

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

examples/Relay/MultiRelays_advance/MultiRelays_advance.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#define RELAYPIN_6 D6
4747
#define RELAYPIN_7 D7
4848
#define RELAYPIN_8 D8
49-
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
49+
#else
5050
#define RELAYPIN_1 16
5151
#define RELAYPIN_2 17
5252
#define RELAYPIN_3 18

examples/Relay/Relay/Relay.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
#if defined(ESP8266)
4646
#define RELAY_PIN D5 // Pin where the relay is connected (D5 = GPIO 14 on ESP8266)
47-
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
47+
#else
4848
#define RELAY_PIN 16 // Pin where the relay is connected (GPIO 16 on ESP32)
4949
#endif
5050

examples/Switch/MultiSwitch_advance/MultiSwitch_advance.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
#define SWITCHPIN_2 D7
7171
#define SWITCHPIN_3 D6
7272
#define SWITCHPIN_4 D5
73-
#elif defined(ESP32) || defined(ARDUINO_ARCH_RP2040)
73+
#else
7474
#define LED_BUILTIN 2
7575

7676
#define RELAYPIN_1 16

src/SinricProWebsocket.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ void WebsocketListener::setExtraHeaders() {
111111
const char* platform = "UNKNOWN";
112112
#endif
113113

114+
String headers = "appkey:" + appKey;
115+
headers += "\r\ndeviceids:" + deviceIds;
116+
headers += "\r\nrestoredevicestates:" + String(restoreDeviceStates ? "true" : "false");
117+
headers += "\r\nip:" + WiFi.localIP().toString();
114118
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_MINIMA)
115119
// WiFiNINA and WiFiS3 return MAC address as byte array in network order (LSB first).
116120
// mac[0] = LSB, mac[5] = MSB. We format it in standard notation (MSB:...:LSB).
@@ -123,13 +127,6 @@ void WebsocketListener::setExtraHeaders() {
123127
mac[5], mac[4], mac[3], mac[2], mac[1], mac[0]);
124128
return String(macStr);
125129
};
126-
#endif
127-
128-
String headers = "appkey:" + appKey;
129-
headers += "\r\ndeviceids:" + deviceIds;
130-
headers += "\r\nrestoredevicestates:" + String(restoreDeviceStates ? "true" : "false");
131-
headers += "\r\nip:" + WiFi.localIP().toString();
132-
#if defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_UNOWIFIR4) || defined(ARDUINO_MINIMA)
133130
headers += "\r\nmac:" + formatMacAddress();
134131
#else
135132
headers += "\r\nmac:" + WiFi.macAddress();

0 commit comments

Comments
 (0)