diff --git a/interface/src/project/DashboardData.tsx b/interface/src/project/DashboardData.tsx index 827120708..5b4bd827d 100644 --- a/interface/src/project/DashboardData.tsx +++ b/interface/src/project/DashboardData.tsx @@ -355,7 +355,7 @@ const DashboardData: FC = () => { if (sc === '' || sc === '""') { return sc; } - if (sc.includes('"') || sc.includes(',') || sc.includes('\n') || sc.includes('\r')) { + if (sc.includes('"') || sc.includes(';') || sc.includes('\n') || sc.includes('\r')) { return '"' + sc.replace(/"/g, '""') + '"'; } return sc; @@ -363,13 +363,13 @@ const DashboardData: FC = () => { const makeCsvData = (columns: any, data: any) => { return data.reduce((csvString: any, rowItem: any) => { - return csvString + columns.map(({ accessor }: any) => escapeCsvCell(accessor(rowItem))).join(',') + '\r\n'; - }, columns.map(({ name }: any) => escapeCsvCell(name)).join(',') + '\r\n'); + return csvString + columns.map(({ accessor }: any) => escapeCsvCell(accessor(rowItem))).join(';') + '\r\n'; + }, columns.map(({ name }: any) => escapeCsvCell(name)).join(';') + '\r\n'); }; const downloadAsCsv = (columns: any, data: any, filename: string) => { const csvData = makeCsvData(columns, data); - const csvFile = new Blob([csvData], { type: 'text/csv' }); + const csvFile = new Blob([csvData], { type: 'text/csv;charset:utf-8' }); const downloadLink = document.createElement('a'); downloadLink.download = filename; @@ -384,8 +384,8 @@ const DashboardData: FC = () => { const handleDownloadCsv = () => { const columns = [ { accessor: (dv: any) => dv.id.slice(2), name: 'Entity' }, - { accessor: (dv: any) => dv.v, name: 'Value' }, - { accessor: (dv: any) => (dv.u >= 1 && dv.u <= 2 ? 'C' : DeviceValueUOM_s[dv.u]), name: 'UoM' } + { accessor: (dv: any) => (typeof dv.v === 'number') ? new Intl.NumberFormat().format(dv.v) : dv.v, name: 'Value' }, + { accessor: (dv: any) => DeviceValueUOM_s[dv.u], name: 'UoM' } ]; downloadAsCsv( columns, diff --git a/lib_standalone/ESP8266React.h b/lib_standalone/ESP8266React.h index 2b1bd5039..d8c9a52d0 100644 --- a/lib_standalone/ESP8266React.h +++ b/lib_standalone/ESP8266React.h @@ -93,6 +93,7 @@ class DummySettings { String dnsIP1 = ""; String dnsIP2 = ""; bool enableIPv6 = false; + bool enableMDNS = true; uint8_t phy_type = 0; uint8_t eth_power = 0; // 0 means -1 diff --git a/src/shower.h b/src/shower.h index 809a18031..b4fb29f7c 100644 --- a/src/shower.h +++ b/src/shower.h @@ -30,6 +30,8 @@ class Shower { void set_shower_state(bool state, bool force = false); + /* unused header + * bool shower_alert() const { return shower_alert_; } @@ -45,6 +47,7 @@ class Shower { void shower_timer(const bool shower_timer) { shower_timer_ = shower_timer; } + */ private: static uuid::log::Logger logger_; diff --git a/src/system.cpp b/src/system.cpp index f0f03fad3..f63159737 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -1000,8 +1000,8 @@ bool System::command_settings(const char * value, const int8_t id, JsonObject & node["shower_timer"] = settings.shower_timer; node["shower_alert"] = settings.shower_alert; if (settings.shower_alert) { - node["shower_alert_coldshot"] = settings.shower_alert_coldshot / 1000; // seconds - node["shower_alert_trigger"] = settings.shower_alert_trigger / 60000; // minutes + node["shower_alert_coldshot"] = settings.shower_alert_coldshot; // seconds + node["shower_alert_trigger"] = settings.shower_alert_trigger; // minutes } node["rx_gpio"] = settings.rx_gpio; diff --git a/src/web/WebAPIService.cpp b/src/web/WebAPIService.cpp index be8966a1e..c79e04ca5 100644 --- a/src/web/WebAPIService.cpp +++ b/src/web/WebAPIService.cpp @@ -124,7 +124,7 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject & input) { // https://github.com/emsesp/EMS-ESP32/issues/462#issuecomment-1093877210 if (output.containsKey("api_data")) { JsonVariant data = output["api_data"]; - request->send(200, "text/plain", data.as()); + request->send(200, "text/plain; charset=utf-8", data.as()); api_count_++; return; }