mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 19:12:10 +01:00
Added timezone for Europe/Berlin #49. Publish v1.6.0
This commit is contained in:
parent
930348ead8
commit
2378ac780e
6 changed files with 23 additions and 72 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef configsettings_h
|
#ifndef configsettings_h
|
||||||
#define configsettings_h
|
#define configsettings_h
|
||||||
|
|
||||||
#define FW_VERSION "v1.6.0beta"
|
#define FW_VERSION "v1.6.0"
|
||||||
enum DeviceStatus {
|
enum DeviceStatus {
|
||||||
DS_OK = 0,
|
DS_OK = 0,
|
||||||
DS_ERROR = 1,
|
DS_ERROR = 1,
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
52
Web.cpp
52
Web.cpp
|
|
@ -1,4 +1,3 @@
|
||||||
#include <Arduino.h>
|
|
||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
#include <WebServer.h>
|
#include <WebServer.h>
|
||||||
#include <LittleFS.h>
|
#include <LittleFS.h>
|
||||||
|
|
@ -918,57 +917,6 @@ void Web::begin() {
|
||||||
server.send(200, _encoding_json, g_content);
|
server.send(200, _encoding_json, g_content);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
server.on("/pairShade", []() {
|
|
||||||
webServer.sendCORSHeaders();
|
|
||||||
HTTPMethod method = server.method();
|
|
||||||
if (method == HTTP_PUT || method == HTTP_POST) {
|
|
||||||
uint8_t shadeId = 255;
|
|
||||||
if (server.hasArg("plain")) {
|
|
||||||
// Its coming in the body.
|
|
||||||
DynamicJsonDocument doc(512);
|
|
||||||
DeserializationError err = deserializeJson(doc, server.arg("plain"));
|
|
||||||
if (err) {
|
|
||||||
switch (err.code()) {
|
|
||||||
case DeserializationError::InvalidInput:
|
|
||||||
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Invalid JSON payload\"}"));
|
|
||||||
break;
|
|
||||||
case DeserializationError::NoMemory:
|
|
||||||
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Out of memory parsing JSON\"}"));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"General JSON Deserialization failed\"}"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
JsonObject obj = doc.as<JsonObject>();
|
|
||||||
if (obj.containsKey("shadeId")) shadeId = obj["shadeId"];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (server.hasArg("shadeId"))
|
|
||||||
shadeId = atoi(server.arg("shadeId").c_str());
|
|
||||||
SomfyShade* shade = nullptr;
|
|
||||||
if (shadeId != 255) shade = somfy.getShadeById(shadeId);
|
|
||||||
if (!shade) {
|
|
||||||
server.send(500, _encoding_json, F("{\"status\":\"ERROR\",\"desc\":\"Shade not found to pair\"}"));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//if(shade->bitLength == 56)
|
|
||||||
shade->sendCommand(somfy_commands::Prog, 4);
|
|
||||||
//else
|
|
||||||
// shade->sendCommand(somfy_commands::Prog, 1);
|
|
||||||
shade->paired = true;
|
|
||||||
shade->save();
|
|
||||||
DynamicJsonDocument doc(512);
|
|
||||||
JsonObject obj = doc.to<JsonObject>();
|
|
||||||
shade->toJSON(obj);
|
|
||||||
serializeJson(doc, g_content);
|
|
||||||
server.send(200, _encoding_json, g_content);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
server.on("/unpairShade", []() {
|
server.on("/unpairShade", []() {
|
||||||
webServer.sendCORSHeaders();
|
webServer.sendCORSHeaders();
|
||||||
HTTPMethod method = server.method();
|
HTTPMethod method = server.method();
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="stylesheet" href="main.css?v=1.6.0b" type="text/css" />
|
<link rel="stylesheet" href="main.css?v=1.6.0" type="text/css" />
|
||||||
<link rel="stylesheet" href="icons.css?v=1.6.0b" type="text/css" />
|
<link rel="stylesheet" href="icons.css?v=1.6.0" type="text/css" />
|
||||||
<link rel="icon" type="image/png" href="favicon.png" />
|
<link rel="icon" type="image/png" href="favicon.png" />
|
||||||
<script type="text/javascript" src="index.js?v=1.6.0b"></script>
|
<script type="text/javascript" src="index.js?v=1.6.0"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="divContainer" class="container" style="user-select:none;position:relative;border-radius:27px;">
|
<div id="divContainer" class="container" style="user-select:none;position:relative;border-radius:27px;">
|
||||||
|
|
@ -216,23 +216,25 @@
|
||||||
<div id="somfyShade" style="width:100%;display:none;">
|
<div id="somfyShade" style="width:100%;display:none;">
|
||||||
<form method="post" action="/shadesettings">
|
<form method="post" action="/shadesettings">
|
||||||
<div style="display:inline-block;float:right;position:relative;margin-top:-14px;"><span id="spanShadeId">*</span>/<span id="spanMaxShades">5</span></div>
|
<div style="display:inline-block;float:right;position:relative;margin-top:-14px;"><span id="spanShadeId">*</span>/<span id="spanMaxShades">5</span></div>
|
||||||
|
<div class="field-group" style="padding:0px;">
|
||||||
|
<div class="field-group" style="margin-top:-18px;display:inline-block;width:77px;">
|
||||||
|
<select id="selShadeProto" name="proto" style="width:100%;">
|
||||||
|
<option value="0">RTS</option>
|
||||||
|
<option value="1">RTW</option>
|
||||||
|
</select>
|
||||||
|
<label for="selShadeBitLength">Protocol</label>
|
||||||
|
</div>
|
||||||
|
<div class="field-group" style="margin-top:-18px;display:inline-block;width:77px;">
|
||||||
|
<select id="selShadeBitLength" name="bitLength" style="width:100%;" onchange="somfy.onShadeBitLengthChanged(this);">
|
||||||
|
<option value="56">56-BIT</option>
|
||||||
|
<option value="80">80-BIT</option>
|
||||||
|
</select>
|
||||||
|
<label for="selShadeBitLength">Bit Length</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="field-group" style="width:127px;display:inline-block;margin-top:-20px;float:left;">
|
<div class="field-group" style="width:127px;display:inline-block;margin-top:-10px;float:left;">
|
||||||
<div class="field-group">
|
<div class="field-group">
|
||||||
<div class="field-group" style="margin-top:-10px;">
|
|
||||||
<select id="selShadeProto" name="proto" style="width:50%;">
|
|
||||||
<option value="0">RTS</option>
|
|
||||||
<option value="1">RTW</option>
|
|
||||||
</select>
|
|
||||||
<label for="selShadeBitLength">Protocol</label>
|
|
||||||
</div>
|
|
||||||
<div class="field-group" style="margin-top:-10px;">
|
|
||||||
<select id="selShadeBitLength" name="bitLength" style="width:50%;" onchange="somfy.onShadeBitLengthChanged(this);">
|
|
||||||
<option value="56">56-BIT</option>
|
|
||||||
<option value="80">80-BIT</option>
|
|
||||||
</select>
|
|
||||||
<label for="selShadeBitLength">Bit Length</label>
|
|
||||||
</div>
|
|
||||||
<div class="field-group" style="margin-top:-10px;">
|
<div class="field-group" style="margin-top:-10px;">
|
||||||
<select id="selShadeType" name="shadeType" style="width:100%;" onchange="somfy.onShadeTypeChanged(this);">
|
<select id="selShadeType" name="shadeType" style="width:100%;" onchange="somfy.onShadeTypeChanged(this);">
|
||||||
<option value="0">Roller Shade</option>
|
<option value="0">Roller Shade</option>
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,7 @@ async function reopenSocket() {
|
||||||
await initSockets();
|
await initSockets();
|
||||||
}
|
}
|
||||||
class General {
|
class General {
|
||||||
appVersion = 'v1.6.0beta';
|
appVersion = 'v1.6.0';
|
||||||
reloadApp = false;
|
reloadApp = false;
|
||||||
async init() {
|
async init() {
|
||||||
this.setAppVersion();
|
this.setAppVersion();
|
||||||
|
|
@ -485,6 +485,7 @@ class General {
|
||||||
{ city: "Etc/GMT-14", code: "<+14>-14" },
|
{ city: "Etc/GMT-14", code: "<+14>-14" },
|
||||||
{ city: "Etc/GMT-2", code: "<+02>-2" },
|
{ city: "Etc/GMT-2", code: "<+02>-2" },
|
||||||
{ city: "Etc/Universal Coorinated Time", code: "UTC0" },
|
{ city: "Etc/Universal Coorinated Time", code: "UTC0" },
|
||||||
|
{ city: "Europe/Berlin", code: "CEST-1CET,M3.2.0/2:00:00,M11.1.0/2:00:00" },
|
||||||
{ city: "Europe/Chisinau", code: "EET-2EEST,M3.5.0,M10.5.0/3" },
|
{ city: "Europe/Chisinau", code: "EET-2EEST,M3.5.0,M10.5.0/3" },
|
||||||
{ city: "Europe/Dublin", code: "IST-1GMT0,M10.5.0,M3.5.0/1" },
|
{ city: "Europe/Dublin", code: "IST-1GMT0,M10.5.0,M3.5.0/1" },
|
||||||
{ city: "Europe/Guernsey", code: "GMT0BST,M3.5.0/1,M10.5.0" },
|
{ city: "Europe/Guernsey", code: "GMT0BST,M3.5.0/1,M10.5.0" },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue