Merge branch 'dev' into dev

This commit is contained in:
Proddy
2021-03-30 17:09:52 +02:00
committed by GitHub
9 changed files with 128 additions and 779 deletions

View File

@@ -75,9 +75,13 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
uint8_t default_tx_gpio = data[3];
uint8_t default_pbutton_gpio = data[4];
EMSESP::logger().info(F("EMS-ESP version %s"), EMSESP_APP_VERSION);
// check to see if we have a settings file, if not it's a fresh install
if (!root.size()) {
EMSESP::logger().info(F("Initializing configuration with board profile %s"), settings.board_profile.c_str());
} else {
EMSESP::logger().info(F("Using configuration from board profile %s"), settings.board_profile.c_str());
}
int prev;

View File

@@ -1248,7 +1248,6 @@ bool Thermostat::set_wwonetime(const char * value, const int8_t id) {
LOG_WARNING(F("Set warm water onetime: Invalid value"));
return false;
}
char s[7];
LOG_INFO(F("Setting warm water onetime to %s"), b ? F_(on) : F_(off));
write_command(0x02F5, 11, b ? 0xFF : 0x00, 0x031D);
return true;
@@ -1404,7 +1403,7 @@ bool Thermostat::set_datetime(const char * value, const int8_t id) {
data[5] = (dt[6] - '0') * 10 + (dt[7] - '0'); // sec
data[6] = (dt[20] - '0'); // day of week
data[7] = (dt[22] - '0') + 2; // DST and flag
LOG_INFO(F("Date and time: %02d.%02d.2%03d-%02d:%02d:%02d"),data[3], data[1], data[0], data[2], data[4], data[5]);
LOG_INFO(F("Date and time: %02d.%02d.2%03d-%02d:%02d:%02d"), data[3], data[1], data[0], data[2], data[4], data[5]);
}
LOG_INFO(F("Setting date and time"));

View File

@@ -322,8 +322,6 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) {
char s[10];
shell.print(Helpers::render_value(s, (float)data.as<float>(), 1));
} else if (data.is<bool>()) {
char s[10];
// shell.print(Helpers::render_boolean(s, data.as<bool>()));
shell.print(data.as<bool>() ? F_(on) : F_(off));
}

View File

@@ -255,8 +255,8 @@ void System::start(uint32_t heap_start) {
get_settings();
EMSESP::esp8266React.getNetworkSettingsService()->read([&](NetworkSettings & networkSettings) {
hostname(networkSettings.hostname.c_str()); // sets the hostname
LOG_INFO(F("System %s booted (EMS-ESP version %s) "), networkSettings.hostname.c_str(), EMSESP_APP_VERSION); // print boot message
hostname(networkSettings.hostname.c_str()); // sets the hostname
LOG_INFO(F("System name: %s"), hostname().c_str());
});
commands_init(); // console & api commands
@@ -277,12 +277,14 @@ void System::adc_init(bool refresh) {
#ifndef EMSESP_STANDALONE
// setCpuFrequencyMhz(160); // default is 240
// disable bluetooth
// disable bluetooth & ADC
/*
btStop();
esp_bt_controller_disable();
if (!analog_enabled_) {
adc_power_off(); // turn off ADC to save power if not needed
adc_power_release(); // turn off ADC to save power if not needed
}
*/
#endif
}
@@ -421,9 +423,12 @@ void System::send_heartbeat() {
return;
}
int8_t rssi = wifi_quality();
if (rssi == -1) {
return;
int8_t rssi;
if (!ethernet_connected_) {
rssi = wifi_quality();
if (rssi == -1) {
return;
}
}
StaticJsonDocument<EMSESP_JSON_SIZE_SMALL> doc;
@@ -437,7 +442,9 @@ void System::send_heartbeat() {
doc["status"] = FJSON("disconnected");
}
doc["rssi"] = rssi;
if (!ethernet_connected_) {
doc["rssi"] = rssi;
}
doc["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3);
doc["uptime_sec"] = uuid::get_uptime_sec();
doc["mqttfails"] = Mqtt::publish_fails();

View File

@@ -1,2 +1,2 @@
#define EMSESP_APP_VERSION "3.0.1b7"
#define EMSESP_APP_VERSION "3.0.2b0"
#define EMSESP_PLATFORM "ESP32"