mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
@@ -274,11 +274,11 @@ enum {
|
||||
};
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#define EMSESP_PLATFORM "ESP32-C3"
|
||||
#define EMSESP_PLATFORM "ESP32C3"
|
||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||
#define EMSESP_PLATFORM "ESP32-S2"
|
||||
#define EMSESP_PLATFORM "ESP32S2"
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
#define EMSESP_PLATFORM "ESP32-S3"
|
||||
#define EMSESP_PLATFORM "ESP32S3"
|
||||
#elif CONFIG_IDF_TARGET_ESP32 || EMSESP_STANDALONE
|
||||
#define EMSESP_PLATFORM "ESP32"
|
||||
#else
|
||||
|
||||
@@ -4525,8 +4525,13 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
register_device_value(tag, &hc->coolstart, DeviceValueType::UINT8, FL_(coolstart), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_coolstart), 20, 35);
|
||||
register_device_value(tag, &hc->coolondelay, DeviceValueType::UINT8, FL_(coolondelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_coolondelay), 1, 48);
|
||||
register_device_value(tag, &hc->cooloffdelay, DeviceValueType::UINT8, FL_(cooloffdelay), DeviceValueUOM::HOURS, MAKE_CF_CB(set_cooloffdelay), 1, 48);
|
||||
register_device_value(
|
||||
tag, &hc->switchProgMode, DeviceValueType::ENUM, FL_(enum_switchProgMode), FL_(switchProgMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_switchProgMode));
|
||||
register_device_value(tag,
|
||||
&hc->switchProgMode,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_switchProgMode),
|
||||
FL_(switchProgMode),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_switchProgMode));
|
||||
|
||||
break;
|
||||
case EMSdevice::EMS_DEVICE_FLAG_CRF:
|
||||
|
||||
@@ -1834,7 +1834,7 @@ void EMSdevice::mqtt_ha_entity_config_create() {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef EMSESP_DEBUG
|
||||
#if defined(EMSESP_DEBUG) || defined(EMSESP_STANDALONE)
|
||||
if (count) {
|
||||
EMSESP::logger().debug("Created %d HA-%s-configs", count, device_type_name());
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ class EMSdevice {
|
||||
char * show_telegram_handlers(char * result, const size_t len, const uint8_t handlers);
|
||||
void show_mqtt_handlers(uuid::console::Shell & shell) const;
|
||||
// void list_device_entries(JsonObject output) const;
|
||||
void add_handlers_ignored(const uint16_t handler);
|
||||
void add_handlers_ignored(const uint16_t handler);
|
||||
|
||||
void set_climate_minmax(int8_t tag, int16_t min, uint32_t max);
|
||||
void setCustomizationEntity(const std::string & entity_id);
|
||||
|
||||
@@ -1538,7 +1538,9 @@ EMSESP::EMSESP()
|
||||
// start all the core services
|
||||
// the services must be loaded in the correct order
|
||||
void EMSESP::start() {
|
||||
#ifndef EMSESP_STANDALONE
|
||||
system_.PSram(ESP.getPsramSize());
|
||||
#endif
|
||||
// don't need shell if running unit tests
|
||||
#ifndef EMSESP_UNITY
|
||||
// Serial console's shell
|
||||
|
||||
@@ -379,7 +379,9 @@ std::string Helpers::data_to_hex(const uint8_t * data, const uint8_t length) {
|
||||
return "<empty>";
|
||||
}
|
||||
|
||||
char str[length * 3] = {0};
|
||||
char str[length * 3];
|
||||
memset(str, 0, length * sizeof(char));
|
||||
|
||||
char buffer[4];
|
||||
char * p = &str[0];
|
||||
for (uint8_t i = 0; i < length; i++) {
|
||||
|
||||
@@ -142,8 +142,7 @@ void WebDataService::sensor_data(AsyncWebServerRequest * request) {
|
||||
}
|
||||
|
||||
root["analog_enabled"] = EMSESP::analog_enabled();
|
||||
String platform = EMSESP_PLATFORM;
|
||||
root["platform"] = (platform == "ESP32" && EMSESP::system_.PSram()) ? "ESP32R" : platform;
|
||||
root["platform"] = EMSESP_PLATFORM;
|
||||
|
||||
response->setLength();
|
||||
request->send(response);
|
||||
|
||||
@@ -75,8 +75,7 @@ void WebSettings::read(WebSettings & settings, JsonObject root) {
|
||||
root["eth_power"] = settings.eth_power;
|
||||
root["eth_phy_addr"] = settings.eth_phy_addr;
|
||||
root["eth_clock_mode"] = settings.eth_clock_mode;
|
||||
String platform = EMSESP_PLATFORM;
|
||||
root["platform"] = (platform == "ESP32" && EMSESP::system_.PSram()) ? "ESP32R" : platform;
|
||||
root["platform"] = EMSESP_PLATFORM;
|
||||
root["modbus_enabled"] = settings.modbus_enabled;
|
||||
root["modbus_port"] = settings.modbus_port;
|
||||
root["modbus_max_clients"] = settings.modbus_max_clients;
|
||||
|
||||
@@ -46,7 +46,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
root["esp_platform"] = EMSESP_PLATFORM; // from default_settings.h: ESP32, ESP32-C3, ESP32-S2, ESP32-S3
|
||||
root["esp_platform"] = EMSESP_PLATFORM; // from default_settings.h: ESP32, ESP32C3, ESP32S2, ESP32S3
|
||||
root["status"] = EMSESP::bus_status(); // 0, 1 or 2
|
||||
root["bus_uptime"] = EMSbus::bus_uptime();
|
||||
root["num_devices"] = EMSESP::count_devices();
|
||||
@@ -81,6 +81,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef EMSESP_STANDALONE
|
||||
const esp_partition_t * partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, nullptr);
|
||||
root["has_loader"] = partition != NULL && partition != esp_ota_get_running_partition();
|
||||
partition = esp_ota_get_next_update_partition(nullptr);
|
||||
@@ -91,6 +92,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
|
||||
} else {
|
||||
root["has_partition"] = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
response->setLength();
|
||||
request->send(response);
|
||||
|
||||
Reference in New Issue
Block a user