diff --git a/app/Models/Plugin.php b/app/Models/Plugin.php
index fc49f3c..d377956 100644
--- a/app/Models/Plugin.php
+++ b/app/Models/Plugin.php
@@ -192,12 +192,8 @@ class Plugin extends Model
$httpRequest = Http::withHeaders($headers);
if ($this->polling_verb === 'post' && $this->polling_body) {
- $contentType = (array_key_exists('Content-Type', $headers))
- ? $headers['Content-Type']
- : 'application/json';
-
$resolvedBody = $this->resolveLiquidVariables($this->polling_body);
- $httpRequest = $httpRequest->withBody($resolvedBody, $contentType);
+ $httpRequest = $httpRequest->withBody($resolvedBody);
}
try {
diff --git a/public/mirror/index.html b/public/mirror/index.html
index ef60a19..64746fe 100644
--- a/public/mirror/index.html
+++ b/public/mirror/index.html
@@ -39,6 +39,7 @@
var data = trmnl.getSettings();
trmnl.ui.apiKeyInput.value = data.api_key || "";
trmnl.ui.baseURLInput.value = data.base_url || "";
+ trmnl.ui.macAddressInput.value = data.mac_address || "";
trmnl.ui.displayModeSelect.value = data.display_mode || "";
trmnl.ui.setup.style.display = "flex";
@@ -49,6 +50,7 @@
var apiKey = trmnl.ui.apiKeyInput.value;
var baseURL = trmnl.ui.baseURLInput.value;
+ var macAddress = trmnl.ui.macAddressInput.value;
var displayMode = trmnl.ui.displayModeSelect.value;
if (!apiKey) {
@@ -58,6 +60,7 @@
trmnl.saveSettings({
api_key: apiKey,
base_url: baseURL,
+ mac_address: macAddress,
display_mode: displayMode
});
@@ -81,6 +84,7 @@
var apiKey = setup.api_key;
var displayMode = setup.display_mode;
var baseURL = setup.base_url || "https://your-byos-trmnl.com";
+ var macAddress = setup.mac_address || "00:00:00:00:00:01";
document.body.classList.remove("dark", "night")
if (displayMode) {
@@ -88,7 +92,8 @@
}
var headers = {
- "Access-Token": apiKey
+ "Access-Token": apiKey,
+ "id": macAddress
};
var url = baseURL + "/api/display";
@@ -205,6 +210,10 @@
hasOverrides = true;
}
+ if (key === "mac_address" && value) {
+ newSettings.mac_address = value;
+ hasOverrides = true;
+ }
}
if (hasOverrides) {
@@ -265,6 +274,7 @@
// settings
trmnl.ui.apiKeyInput = document.getElementById("api_key");
trmnl.ui.baseURLInput = document.getElementById("base_url");
+ trmnl.ui.macAddressInput = document.getElementById("mac_address");
trmnl.ui.displayModeSelect = document.getElementById("display_mode");
trmnl.ui.setup = document.getElementById("setup");
@@ -459,6 +469,12 @@