mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-07-29 01:52:51 +00:00
fix standalone, formatting
This commit is contained in:
@@ -21,4 +21,4 @@ For more details go to [emsesp.org](https://emsesp.org/).
|
|||||||
|
|
||||||
- call compute value direct, enlarge TCP stack [#3127](https://github.com/emsesp/EMS-ESP32/discussions/3127)
|
- call compute value direct, enlarge TCP stack [#3127](https://github.com/emsesp/EMS-ESP32/discussions/3127)
|
||||||
- Dewtemperature for Easycontrol calculated by ems-esp [3135](https://github.com/emsesp/EMS-ESP32/issues/3135)
|
- Dewtemperature for Easycontrol calculated by ems-esp [3135](https://github.com/emsesp/EMS-ESP32/issues/3135)
|
||||||
- add option for sync thermostat to ntp, allow different time zones [3148](https://github.com/emsesp/EMS-ESP32/discussions/3148), defaults to no sync.
|
- add option for sync thermostat to ntp, allow different time zones [3148](https://github.com/emsesp/EMS-ESP32/discussions/3148), **defaults to no sync**.
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ build_flags =
|
|||||||
-D FACTORY_NTP_TIME_ZONE_LABEL=\"Europe/Amsterdam\"
|
-D FACTORY_NTP_TIME_ZONE_LABEL=\"Europe/Amsterdam\"
|
||||||
-D FACTORY_NTP_TIME_ZONE_FORMAT=\"CET-1CEST,M3.5.0,M10.5.0/3\"
|
-D FACTORY_NTP_TIME_ZONE_FORMAT=\"CET-1CEST,M3.5.0,M10.5.0/3\"
|
||||||
-D FACTORY_NTP_SERVER=\"time.google.com\"
|
-D FACTORY_NTP_SERVER=\"time.google.com\"
|
||||||
|
-D FACTORY_NTP_THERMOSTAT_SYNC=0
|
||||||
|
|
||||||
; MQTT settings
|
; MQTT settings
|
||||||
-D FACTORY_MQTT_ENABLED=false
|
-D FACTORY_MQTT_ENABLED=false
|
||||||
|
|||||||
@@ -215,11 +215,11 @@ const changeTimeZoneT = useCallback(
|
|||||||
<Grid>
|
<Grid>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors || {}}
|
fieldErrors={fieldErrors || {}}
|
||||||
name="thermostat_option"
|
name="thermostat_sync"
|
||||||
label="Sync EMS-Thermostat"
|
label="Sync EMS-Thermostat"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
sx={{ width: '30ch' }}
|
sx={{ width: '30ch' }}
|
||||||
value={data.thermostat_option}
|
value={data.thermostat_sync}
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
margin="normal"
|
margin="normal"
|
||||||
select
|
select
|
||||||
@@ -230,7 +230,7 @@ const changeTimeZoneT = useCallback(
|
|||||||
</ValidatedTextField >
|
</ValidatedTextField >
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid>
|
<Grid>
|
||||||
{data.thermostat_option === 2 && (
|
{data.thermostat_sync === 2 && (
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors || {}}
|
fieldErrors={fieldErrors || {}}
|
||||||
name="tz_label_t"
|
name="tz_label_t"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export interface NTPSettingsType {
|
|||||||
server: string;
|
server: string;
|
||||||
tz_label: string;
|
tz_label: string;
|
||||||
tz_format: string;
|
tz_format: string;
|
||||||
thermostat_option: number;
|
thermostat_sync: number;
|
||||||
tz_label_t: string;
|
tz_label_t: string;
|
||||||
tz_format_t: string;
|
tz_format_t: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ class DummySettings {
|
|||||||
// NTP
|
// NTP
|
||||||
String server = "pool.ntp.org";
|
String server = "pool.ntp.org";
|
||||||
String tzLabel = "Europe/London";
|
String tzLabel = "Europe/London";
|
||||||
|
String tzFormat = "GMT0BST,M3.5.0/1,M10.5.0";
|
||||||
|
String tzLabelT = "Europe/Berlin";
|
||||||
|
String tzFormatT = "CET-1CEST,M3.5.0,M10.5.0/3";
|
||||||
|
uint8_t thermostat_sync = 0;
|
||||||
|
|
||||||
static void read(DummySettings & settings, JsonObject root) {};
|
static void read(DummySettings & settings, JsonObject root) {};
|
||||||
static void read(DummySettings & settings) {};
|
static void read(DummySettings & settings) {};
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ void NTPSettings::read(NTPSettings & settings, JsonObject root) {
|
|||||||
root["server"] = settings.server;
|
root["server"] = settings.server;
|
||||||
root["tz_label"] = settings.tzLabel;
|
root["tz_label"] = settings.tzLabel;
|
||||||
root["tz_format"] = settings.tzFormat;
|
root["tz_format"] = settings.tzFormat;
|
||||||
root["thermostat_option"] = settings.thermostat_option;
|
root["thermostat_sync"] = settings.thermostat_sync;
|
||||||
root["tz_label_t"] = settings.tzLabelT;
|
root["tz_label_t"] = settings.tzLabelT;
|
||||||
root["tz_format_t"] = settings.tzFormatT;
|
root["tz_format_t"] = settings.tzFormatT;
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ StateUpdateResult NTPSettings::update(JsonObject root, NTPSettings & settings) {
|
|||||||
settings.server = root["server"] | FACTORY_NTP_SERVER;
|
settings.server = root["server"] | FACTORY_NTP_SERVER;
|
||||||
settings.tzLabel = root["tz_label"] | FACTORY_NTP_TIME_ZONE_LABEL;
|
settings.tzLabel = root["tz_label"] | FACTORY_NTP_TIME_ZONE_LABEL;
|
||||||
settings.tzFormat = root["tz_format"] | FACTORY_NTP_TIME_ZONE_FORMAT;
|
settings.tzFormat = root["tz_format"] | FACTORY_NTP_TIME_ZONE_FORMAT;
|
||||||
settings.thermostat_option = root["thermostat_option"] | 0;
|
settings.thermostat_sync = root["thermostat_sync"] | FACTORY_NTP_THERMOSTAT_SYNC;
|
||||||
settings.tzLabelT = root["tz_label_t"] | settings.tzLabel;
|
settings.tzLabelT = root["tz_label_t"] | settings.tzLabel;
|
||||||
settings.tzFormatT = root["tz_format_t"] | settings.tzFormat;
|
settings.tzFormatT = root["tz_format_t"] | settings.tzFormat;
|
||||||
return StateUpdateResult::CHANGED;
|
return StateUpdateResult::CHANGED;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class NTPSettings {
|
|||||||
String tzLabel = FACTORY_NTP_TIME_ZONE_LABEL;
|
String tzLabel = FACTORY_NTP_TIME_ZONE_LABEL;
|
||||||
String tzFormat = FACTORY_NTP_TIME_ZONE_FORMAT;
|
String tzFormat = FACTORY_NTP_TIME_ZONE_FORMAT;
|
||||||
String server = FACTORY_NTP_SERVER;
|
String server = FACTORY_NTP_SERVER;
|
||||||
uint8_t thermostat_option = 0;
|
uint8_t thermostat_sync = FACTORY_NTP_THERMOSTAT_SYNC;
|
||||||
String tzLabelT = FACTORY_NTP_TIME_ZONE_LABEL;
|
String tzLabelT = FACTORY_NTP_TIME_ZONE_LABEL;
|
||||||
String tzFormatT = FACTORY_NTP_TIME_ZONE_FORMAT;
|
String tzFormatT = FACTORY_NTP_TIME_ZONE_FORMAT;
|
||||||
|
|
||||||
|
|||||||
@@ -1741,7 +1741,7 @@ void Thermostat::process_RCTime(std::shared_ptr<const Telegram> telegram) {
|
|||||||
tm * tm_;
|
tm * tm_;
|
||||||
bool sync = true;
|
bool sync = true;
|
||||||
EMSESP::esp32React.getNTPSettingsService()->read([&](const NTPSettings & settings) {
|
EMSESP::esp32React.getNTPSettingsService()->read([&](const NTPSettings & settings) {
|
||||||
switch (settings.thermostat_option) {
|
switch (settings.thermostat_sync) {
|
||||||
default:
|
default:
|
||||||
sync = false;
|
sync = false;
|
||||||
break;
|
break;
|
||||||
@@ -3085,7 +3085,7 @@ bool Thermostat::set_datetime(const char * value, const int8_t id) {
|
|||||||
time_t now = time(nullptr);
|
time_t now = time(nullptr);
|
||||||
tm * tm_;
|
tm * tm_;
|
||||||
EMSESP::esp32React.getNTPSettingsService()->read([&](const NTPSettings & settings) {
|
EMSESP::esp32React.getNTPSettingsService()->read([&](const NTPSettings & settings) {
|
||||||
switch (settings.thermostat_option) {
|
switch (settings.thermostat_sync) {
|
||||||
default:
|
default:
|
||||||
tm_ = localtime(&now);
|
tm_ = localtime(&now);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user