diff --git a/docs/Modbus-Entity-Registers.md b/docs/Modbus-Entity-Registers.md
index c416151dd..12f04c138 100644
--- a/docs/Modbus-Entity-Registers.md
+++ b/docs/Modbus-Entity-Registers.md
@@ -4779,7 +4779,7 @@
| circmode | circulation pump mode | enum [off\|on\|auto\|own prog] | | true | DHW | 3 | 1 | 1 |
| chargeduration | charge duration | uint8 (>=0<=3810) | minutes | true | DHW | 4 | 1 | 15 |
| charge | charge | boolean | | true | DHW | 5 | 1 | 1 |
-| extra | extra | uint8 (>=0<=254) | | false | DHW | 6 | 1 | 1 |
+| extra | extra | boolean | | false | DHW | 6 | 1 | 1 |
| disinfecting | disinfecting | boolean | | true | DHW | 7 | 1 | 1 |
| disinfectday | disinfection day | enum [mo\|tu\|we\|th\|fr\|sa\|su\|all] | | true | DHW | 8 | 1 | 1 |
| disinfecttime | disinfection time | uint8 (>=0<=1431) | minutes | true | DHW | 9 | 1 | 15 |
@@ -4895,7 +4895,7 @@
| circmode | circulation pump mode | enum [off\|on\|auto\|own prog] | | true | DHW | 3 | 1 | 1 |
| chargeduration | charge duration | uint8 (>=0<=3810) | minutes | true | DHW | 4 | 1 | 15 |
| charge | charge | boolean | | true | DHW | 5 | 1 | 1 |
-| extra | extra | uint8 (>=0<=254) | | false | DHW | 6 | 1 | 1 |
+| extra | extra | boolean | | false | DHW | 6 | 1 | 1 |
| disinfecting | disinfecting | boolean | | true | DHW | 7 | 1 | 1 |
| disinfectday | disinfection day | enum [mo\|tu\|we\|th\|fr\|sa\|su\|all] | | true | DHW | 8 | 1 | 1 |
| disinfecttime | disinfection time | uint8 (>=0<=1431) | minutes | true | DHW | 9 | 1 | 15 |
@@ -5023,7 +5023,7 @@
| circmode | circulation pump mode | enum [off\|on\|auto\|own prog] | | true | DHW | 3 | 1 | 1 |
| chargeduration | charge duration | uint8 (>=0<=3810) | minutes | true | DHW | 4 | 1 | 15 |
| charge | charge | boolean | | true | DHW | 5 | 1 | 1 |
-| extra | extra | uint8 (>=0<=254) | | false | DHW | 6 | 1 | 1 |
+| extra | extra | boolean | | false | DHW | 6 | 1 | 1 |
| disinfecting | disinfecting | boolean | | true | DHW | 7 | 1 | 1 |
| disinfectday | disinfection day | enum [mo\|tu\|we\|th\|fr\|sa\|su\|all] | | true | DHW | 8 | 1 | 1 |
| disinfecttime | disinfection time | uint8 (>=0<=1431) | minutes | true | DHW | 9 | 1 | 15 |
@@ -5267,7 +5267,7 @@
| circmode | circulation pump mode | enum [off\|on\|auto\|own prog] | | true | DHW | 3 | 1 | 1 |
| chargeduration | charge duration | uint8 (>=0<=3810) | minutes | true | DHW | 4 | 1 | 15 |
| charge | charge | boolean | | true | DHW | 5 | 1 | 1 |
-| extra | extra | uint8 (>=0<=254) | | false | DHW | 6 | 1 | 1 |
+| extra | extra | boolean | | false | DHW | 6 | 1 | 1 |
| disinfecting | disinfecting | boolean | | true | DHW | 7 | 1 | 1 |
| disinfectday | disinfection day | enum [mo\|tu\|we\|th\|fr\|sa\|su\|all] | | true | DHW | 8 | 1 | 1 |
| disinfecttime | disinfection time | uint8 (>=0<=1431) | minutes | true | DHW | 9 | 1 | 15 |
@@ -5355,7 +5355,7 @@
| circmode | circulation pump mode | enum [off\|on\|auto\|own prog] | | true | DHW | 3 | 1 | 1 |
| chargeduration | charge duration | uint8 (>=0<=3810) | minutes | true | DHW | 4 | 1 | 15 |
| charge | charge | boolean | | true | DHW | 5 | 1 | 1 |
-| extra | extra | uint8 (>=0<=254) | | false | DHW | 6 | 1 | 1 |
+| extra | extra | boolean | | false | DHW | 6 | 1 | 1 |
| disinfecting | disinfecting | boolean | | true | DHW | 7 | 1 | 1 |
| disinfectday | disinfection day | enum [mo\|tu\|we\|th\|fr\|sa\|su\|all] | | true | DHW | 8 | 1 | 1 |
| disinfecttime | disinfection time | uint8 (>=0<=1431) | minutes | true | DHW | 9 | 1 | 15 |
@@ -5453,7 +5453,7 @@
| circmode | circulation pump mode | enum [off\|on\|auto\|own prog] | | true | DHW | 3 | 1 | 1 |
| chargeduration | charge duration | uint8 (>=0<=3810) | minutes | true | DHW | 4 | 1 | 15 |
| charge | charge | boolean | | true | DHW | 5 | 1 | 1 |
-| extra | extra | uint8 (>=0<=254) | | false | DHW | 6 | 1 | 1 |
+| extra | extra | boolean | | false | DHW | 6 | 1 | 1 |
| disinfecting | disinfecting | boolean | | true | DHW | 7 | 1 | 1 |
| disinfectday | disinfection day | enum [mo\|tu\|we\|th\|fr\|sa\|su\|all] | | true | DHW | 8 | 1 | 1 |
| disinfecttime | disinfection time | uint8 (>=0<=1431) | minutes | true | DHW | 9 | 1 | 15 |
diff --git a/docs/dump_entities.csv b/docs/dump_entities.csv
index 10ec99089..89809c6f0 100644
--- a/docs/dump_entities.csv
+++ b/docs/dump_entities.csv
@@ -3438,7 +3438,7 @@ device name,device type,product id,shortname,fullname,type [options...] \| (min/
"UI800, BC400",thermostat,4,circmode,circulation pump mode,enum [off\|on\|auto\|own prog], ,true,select.thermostat_dhw_circulation_pump_mode,select.thermostat_dhw_circmode,6,9,1,3,1
"UI800, BC400",thermostat,4,chargeduration,charge duration,uint8 (>=0<=3810),minutes,true,number.thermostat_dhw_charge_duration,number.thermostat_dhw_chargeduration,6,9,15,4,1
"UI800, BC400",thermostat,4,charge,charge,boolean, ,true,switch.thermostat_dhw_charge,switch.thermostat_dhw_charge,6,9,1,5,1
-"UI800, BC400",thermostat,4,extra,extra,uint8 (>=0<=254), ,false,sensor.thermostat_dhw_extra,sensor.thermostat_dhw_extra,6,9,1,6,1
+"UI800, BC400",thermostat,4,extra,extra,boolean, ,false,binary_sensor.thermostat_dhw_extra,binary_sensor.thermostat_dhw_extra,6,9,1,6,1
"UI800, BC400",thermostat,4,disinfecting,disinfecting,boolean, ,true,switch.thermostat_dhw_disinfecting,switch.thermostat_dhw_disinfecting,6,9,1,7,1
"UI800, BC400",thermostat,4,disinfectday,disinfection day,enum [mo\|tu\|we\|th\|fr\|sa\|su\|all], ,true,select.thermostat_dhw_disinfection_day,select.thermostat_dhw_disinfectday,6,9,1,8,1
"UI800, BC400",thermostat,4,disinfecttime,disinfection time,uint8 (>=0<=1431),minutes,true,number.thermostat_dhw_disinfection_time,number.thermostat_dhw_disinfecttime,6,9,15,9,1
@@ -3807,7 +3807,7 @@ device name,device type,product id,shortname,fullname,type [options...] \| (min/
"RC200, CW100, CR120, CR50",thermostat,157,circmode,circulation pump mode,enum [off\|on\|auto\|own prog], ,true,select.thermostat_dhw_circulation_pump_mode,select.thermostat_dhw_circmode,6,9,1,3,1
"RC200, CW100, CR120, CR50",thermostat,157,chargeduration,charge duration,uint8 (>=0<=3810),minutes,true,number.thermostat_dhw_charge_duration,number.thermostat_dhw_chargeduration,6,9,15,4,1
"RC200, CW100, CR120, CR50",thermostat,157,charge,charge,boolean, ,true,switch.thermostat_dhw_charge,switch.thermostat_dhw_charge,6,9,1,5,1
-"RC200, CW100, CR120, CR50",thermostat,157,extra,extra,uint8 (>=0<=254), ,false,sensor.thermostat_dhw_extra,sensor.thermostat_dhw_extra,6,9,1,6,1
+"RC200, CW100, CR120, CR50",thermostat,157,extra,extra,boolean, ,false,binary_sensor.thermostat_dhw_extra,binary_sensor.thermostat_dhw_extra,6,9,1,6,1
"RC200, CW100, CR120, CR50",thermostat,157,disinfecting,disinfecting,boolean, ,true,switch.thermostat_dhw_disinfecting,switch.thermostat_dhw_disinfecting,6,9,1,7,1
"RC200, CW100, CR120, CR50",thermostat,157,disinfectday,disinfection day,enum [mo\|tu\|we\|th\|fr\|sa\|su\|all], ,true,select.thermostat_dhw_disinfection_day,select.thermostat_dhw_disinfectday,6,9,1,8,1
"RC200, CW100, CR120, CR50",thermostat,157,disinfecttime,disinfection time,uint8 (>=0<=1431),minutes,true,number.thermostat_dhw_disinfection_time,number.thermostat_dhw_disinfecttime,6,9,15,9,1
@@ -3891,7 +3891,7 @@ device name,device type,product id,shortname,fullname,type [options...] \| (min/
"RC3*0, Moduline 3000/1010H, CW400, Sense II, HPC410",thermostat,158,circmode,circulation pump mode,enum [off\|on\|auto\|own prog], ,true,select.thermostat_dhw_circulation_pump_mode,select.thermostat_dhw_circmode,6,9,1,3,1
"RC3*0, Moduline 3000/1010H, CW400, Sense II, HPC410",thermostat,158,chargeduration,charge duration,uint8 (>=0<=3810),minutes,true,number.thermostat_dhw_charge_duration,number.thermostat_dhw_chargeduration,6,9,15,4,1
"RC3*0, Moduline 3000/1010H, CW400, Sense II, HPC410",thermostat,158,charge,charge,boolean, ,true,switch.thermostat_dhw_charge,switch.thermostat_dhw_charge,6,9,1,5,1
-"RC3*0, Moduline 3000/1010H, CW400, Sense II, HPC410",thermostat,158,extra,extra,uint8 (>=0<=254), ,false,sensor.thermostat_dhw_extra,sensor.thermostat_dhw_extra,6,9,1,6,1
+"RC3*0, Moduline 3000/1010H, CW400, Sense II, HPC410",thermostat,158,extra,extra,boolean, ,false,binary_sensor.thermostat_dhw_extra,binary_sensor.thermostat_dhw_extra,6,9,1,6,1
"RC3*0, Moduline 3000/1010H, CW400, Sense II, HPC410",thermostat,158,disinfecting,disinfecting,boolean, ,true,switch.thermostat_dhw_disinfecting,switch.thermostat_dhw_disinfecting,6,9,1,7,1
"RC3*0, Moduline 3000/1010H, CW400, Sense II, HPC410",thermostat,158,disinfectday,disinfection day,enum [mo\|tu\|we\|th\|fr\|sa\|su\|all], ,true,select.thermostat_dhw_disinfection_day,select.thermostat_dhw_disinfectday,6,9,1,8,1
"RC3*0, Moduline 3000/1010H, CW400, Sense II, HPC410",thermostat,158,disinfecttime,disinfection time,uint8 (>=0<=1431),minutes,true,number.thermostat_dhw_disinfection_time,number.thermostat_dhw_disinfecttime,6,9,15,9,1
@@ -3975,7 +3975,7 @@ device name,device type,product id,shortname,fullname,type [options...] \| (min/
"RC100, CR10, Moduline 1000/1010",thermostat,165,circmode,circulation pump mode,enum [off\|on\|auto\|own prog], ,true,select.thermostat_dhw_circulation_pump_mode,select.thermostat_dhw_circmode,6,9,1,3,1
"RC100, CR10, Moduline 1000/1010",thermostat,165,chargeduration,charge duration,uint8 (>=0<=3810),minutes,true,number.thermostat_dhw_charge_duration,number.thermostat_dhw_chargeduration,6,9,15,4,1
"RC100, CR10, Moduline 1000/1010",thermostat,165,charge,charge,boolean, ,true,switch.thermostat_dhw_charge,switch.thermostat_dhw_charge,6,9,1,5,1
-"RC100, CR10, Moduline 1000/1010",thermostat,165,extra,extra,uint8 (>=0<=254), ,false,sensor.thermostat_dhw_extra,sensor.thermostat_dhw_extra,6,9,1,6,1
+"RC100, CR10, Moduline 1000/1010",thermostat,165,extra,extra,boolean, ,false,binary_sensor.thermostat_dhw_extra,binary_sensor.thermostat_dhw_extra,6,9,1,6,1
"RC100, CR10, Moduline 1000/1010",thermostat,165,disinfecting,disinfecting,boolean, ,true,switch.thermostat_dhw_disinfecting,switch.thermostat_dhw_disinfecting,6,9,1,7,1
"RC100, CR10, Moduline 1000/1010",thermostat,165,disinfectday,disinfection day,enum [mo\|tu\|we\|th\|fr\|sa\|su\|all], ,true,select.thermostat_dhw_disinfection_day,select.thermostat_dhw_disinfectday,6,9,1,8,1
"RC100, CR10, Moduline 1000/1010",thermostat,165,disinfecttime,disinfection time,uint8 (>=0<=1431),minutes,true,number.thermostat_dhw_disinfection_time,number.thermostat_dhw_disinfecttime,6,9,15,9,1
@@ -4060,7 +4060,7 @@ device name,device type,product id,shortname,fullname,type [options...] \| (min/
"Rego 2000/3000",thermostat,172,circmode,circulation pump mode,enum [off\|on\|auto\|own prog], ,true,select.thermostat_dhw_circulation_pump_mode,select.thermostat_dhw_circmode,6,9,1,3,1
"Rego 2000/3000",thermostat,172,chargeduration,charge duration,uint8 (>=0<=3810),minutes,true,number.thermostat_dhw_charge_duration,number.thermostat_dhw_chargeduration,6,9,15,4,1
"Rego 2000/3000",thermostat,172,charge,charge,boolean, ,true,switch.thermostat_dhw_charge,switch.thermostat_dhw_charge,6,9,1,5,1
-"Rego 2000/3000",thermostat,172,extra,extra,uint8 (>=0<=254), ,false,sensor.thermostat_dhw_extra,sensor.thermostat_dhw_extra,6,9,1,6,1
+"Rego 2000/3000",thermostat,172,extra,extra,boolean, ,false,binary_sensor.thermostat_dhw_extra,binary_sensor.thermostat_dhw_extra,6,9,1,6,1
"Rego 2000/3000",thermostat,172,disinfecting,disinfecting,boolean, ,true,switch.thermostat_dhw_disinfecting,switch.thermostat_dhw_disinfecting,6,9,1,7,1
"Rego 2000/3000",thermostat,172,disinfectday,disinfection day,enum [mo\|tu\|we\|th\|fr\|sa\|su\|all], ,true,select.thermostat_dhw_disinfection_day,select.thermostat_dhw_disinfectday,6,9,1,8,1
"Rego 2000/3000",thermostat,172,disinfecttime,disinfection time,uint8 (>=0<=1431),minutes,true,number.thermostat_dhw_disinfection_time,number.thermostat_dhw_disinfecttime,6,9,15,9,1
@@ -4171,7 +4171,7 @@ device name,device type,product id,shortname,fullname,type [options...] \| (min/
"Rego 3000, UI800, Logamatic BC400",thermostat,253,circmode,circulation pump mode,enum [off\|on\|auto\|own prog], ,true,select.thermostat_dhw_circulation_pump_mode,select.thermostat_dhw_circmode,6,9,1,3,1
"Rego 3000, UI800, Logamatic BC400",thermostat,253,chargeduration,charge duration,uint8 (>=0<=3810),minutes,true,number.thermostat_dhw_charge_duration,number.thermostat_dhw_chargeduration,6,9,15,4,1
"Rego 3000, UI800, Logamatic BC400",thermostat,253,charge,charge,boolean, ,true,switch.thermostat_dhw_charge,switch.thermostat_dhw_charge,6,9,1,5,1
-"Rego 3000, UI800, Logamatic BC400",thermostat,253,extra,extra,uint8 (>=0<=254), ,false,sensor.thermostat_dhw_extra,sensor.thermostat_dhw_extra,6,9,1,6,1
+"Rego 3000, UI800, Logamatic BC400",thermostat,253,extra,extra,boolean, ,false,binary_sensor.thermostat_dhw_extra,binary_sensor.thermostat_dhw_extra,6,9,1,6,1
"Rego 3000, UI800, Logamatic BC400",thermostat,253,disinfecting,disinfecting,boolean, ,true,switch.thermostat_dhw_disinfecting,switch.thermostat_dhw_disinfecting,6,9,1,7,1
"Rego 3000, UI800, Logamatic BC400",thermostat,253,disinfectday,disinfection day,enum [mo\|tu\|we\|th\|fr\|sa\|su\|all], ,true,select.thermostat_dhw_disinfection_day,select.thermostat_dhw_disinfectday,6,9,1,8,1
"Rego 3000, UI800, Logamatic BC400",thermostat,253,disinfecttime,disinfection time,uint8 (>=0<=1431),minutes,true,number.thermostat_dhw_disinfection_time,number.thermostat_dhw_disinfecttime,6,9,15,9,1
diff --git a/interface/package.json b/interface/package.json
index 1fa3a5d6b..a75874e78 100644
--- a/interface/package.json
+++ b/interface/package.json
@@ -61,7 +61,7 @@
"typescript-eslint": "8.13.0",
"vite": "^5.4.10",
"vite-plugin-imagemin": "^0.6.1",
- "vite-tsconfig-paths": "^5.1.0"
+ "vite-tsconfig-paths": "^5.1.1"
},
"packageManager": "yarn@4.5.1"
}
diff --git a/interface/src/api/endpoints.ts b/interface/src/api/endpoints.ts
index 08f5dea0f..cbc0a4bca 100644
--- a/interface/src/api/endpoints.ts
+++ b/interface/src/api/endpoints.ts
@@ -57,7 +57,10 @@ export const alovaInstance = createAlova({
});
export const alovaInstanceGH = createAlova({
- baseURL: 'https://api.github.com/repos/emsesp/EMS-ESP32/releases',
+ baseURL:
+ process.env.NODE_ENV === 'development'
+ ? '/gh'
+ : 'https://api.github.com/repos/emsesp/EMS-ESP32/releases',
statesHook: ReactHook,
requestAdapter: xhrRequestAdapter()
});
diff --git a/interface/src/app/settings/Settings.tsx b/interface/src/app/settings/Settings.tsx
index 57c902489..7aba45df7 100644
--- a/interface/src/app/settings/Settings.tsx
+++ b/interface/src/app/settings/Settings.tsx
@@ -86,8 +86,8 @@ const Settings = () => {
diff --git a/interface/src/app/settings/Version.tsx b/interface/src/app/settings/Version.tsx
index dacd284c2..94332f96a 100644
--- a/interface/src/app/settings/Version.tsx
+++ b/interface/src/app/settings/Version.tsx
@@ -1,7 +1,9 @@
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
import { toast } from 'react-toastify';
import CancelIcon from '@mui/icons-material/Cancel';
+import CheckIcon from '@mui/icons-material/Done';
+import DownloadIcon from '@mui/icons-material/GetApp';
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
import WarningIcon from '@mui/icons-material/Warning';
import {
@@ -11,7 +13,6 @@ import {
DialogActions,
DialogContent,
DialogTitle,
- Divider,
Link,
Typography
} from '@mui/material';
@@ -36,15 +37,13 @@ const Version = () => {
const [upgradeAvailable, setUpgradeAvailable] = useState(false);
const { send: sendCheckUpgrade } = useRequest(
- (version: string) => callAction({ action: 'checkUpgrade', param: version }),
+ (versions: string) => callAction({ action: 'checkUpgrade', param: versions }),
{
immediate: false
}
).onSuccess((event) => {
const data = event.data as { emsesp_version: string; upgradeable: boolean };
- if (data.upgradeable != undefined) {
- setUpgradeAvailable(data.upgradeable);
- }
+ setUpgradeAvailable(data.upgradeable);
});
const { data, send: loadData, error } = useRequest(SystemApi.readSystemStatus);
@@ -56,23 +55,20 @@ const Version = () => {
}
);
- // called immediately to get the latest version, on page load
- const { data: latestVersion } = useRequest(getStableVersion, {
- // uncomment next 2 lines for testing, uses https://github.com/emsesp/EMS-ESP32/releases/download/v3.6.5/EMS-ESP-3_6_5-ESP32-16MB+.bin
- // immediate: false,
- // initialData: '3.6.5'
- }).onSuccess((event) => {
- void sendCheckUpgrade(event.data);
- });
+ // called immediately to get the latest versions on page load
+ const { data: latestVersion } = useRequest(getStableVersion);
+ const { data: latestDevVersion } = useRequest(getDevVersion);
- // called immediately to get the latest version, on page load, then check for upgrade (works for both dev and stable)
- const { data: latestDevVersion } = useRequest(getDevVersion, {
- // uncomment next 2 lines for testing, uses https://github.com/emsesp/EMS-ESP32/releases/download/latest/EMS-ESP-3_7_0-dev_31-ESP32-16MB+.bin
- // immediate: false,
- // initialData: '3.7.0-dev.32'
- }).onSuccess((event) => {
- void sendCheckUpgrade(event.data);
- });
+ useEffect(() => {
+ if (latestVersion && latestDevVersion) {
+ // console.log("Latest versions, stable: " + latestVersion + " dev: " + latestDevVersion);
+ sendCheckUpgrade(latestDevVersion + ',' + latestVersion).catch(
+ (error: Error) => {
+ toast.error('Failed to check upgrade: ' + error.message);
+ }
+ );
+ }
+ }, [latestVersion, latestDevVersion]);
const STABLE_URL = 'https://github.com/emsesp/EMS-ESP32/releases/download/';
const STABLE_RELNOTES_URL =
@@ -111,11 +107,15 @@ const Version = () => {
setRestarting(true);
};
- useLayoutTitle(LL.EMS_ESP_VER());
+ useLayoutTitle('EMS-ESP Firmware');
+ // see if we have internet access
const internet_live =
latestDevVersion !== undefined && latestVersion !== undefined;
+ // check for older boards where auto-upgrade is not supported
+ const download_only = data && !data.psram;
+
const renderUploadDialog = () => {
if (!internet_live) {
return null;
@@ -128,26 +128,15 @@ const Version = () => {
onClose={() => setOpenDialog(false)}
>
- {LL.INSTALL('') +
- ' ' +
- (useDev ? LL.DEVELOPMENT() : LL.STABLE()) +
- ' Firmware'}
+ {(download_only ? LL.DOWNLOAD(0) : LL.INSTALL('')) + ' ' + ' Firmware'}
- {LL.INSTALL_VERSION(useDev ? latestDevVersion : latestVersion)}
+ {LL.INSTALL_VERSION(
+ download_only ? LL.DOWNLOAD(1) : LL.INSTALL(''),
+ useDev ? latestDevVersion : latestVersion
+ )}
-
- changelog
-
- |
-
- {LL.DOWNLOAD(1)}
-
}
+ startIcon={}
variant="outlined"
- onClick={() => installFirmwareURL(getBinURL(useDev))}
+ onClick={() => setOpenDialog(false)}
color="primary"
>
- {LL.INSTALL('')}
+
+ {LL.DOWNLOAD(1)}
+
+ {!download_only && (
+ }
+ variant="outlined"
+ onClick={() => installFirmwareURL(getBinURL(useDev))}
+ color="primary"
+ >
+ {LL.INSTALL('')}
+
+ )}
);
};
- // useDevVersion = true to force using the dev version
const showFirmwareDialog = (useDevVersion: boolean) => {
if (useDevVersion || data.emsesp_version.includes('dev')) {
setUseDev(true);
@@ -189,19 +189,23 @@ const Version = () => {
return (
<>
-
+
+ Firmware Version
+
+
+
-
+
{LL.VERSION()}
-
+
Platform
-
- Release
+
+ Release Type
-
+
{data.emsesp_version}
{data.build_flags && (
@@ -211,62 +215,101 @@ const Version = () => {
)}
{getPlatform()}
-
- {isDev ? LL.DEVELOPMENT() : LL.STABLE()}
-
- (changelog)
-
+
+ {isDev ? LL.DEVELOPMENT() : LL.STABLE()}
+ {!isDev && internet_live && (
+
+
+
+ )}
-
-
- {!isDev && (
-
- )}
-
-
-
-
- {upgradeAvailable ? LL.UPGRADE_AVAILABLE() : LL.LATEST_VERSION()}
- {upgradeAvailable &&
- internet_live &&
- (data.psram ? (
-
- ) : (
- <>
-
-
- {LL.DOWNLOAD(1)} v
- {isDev ? latestDevVersion : latestVersion}
-
- >
- ))}
+
+ Latest Available Versions
+ {internet_live ? (
+ <>
+
+
+
+ Stable Release
+
+
+ Development Release
+
+
+
+
+ {latestVersion}
+
+ (changelog)
+
+ {!isDev && upgradeAvailable && (
+
+ )}
+
+
+ {latestDevVersion}
+
+ (changelog)
+
+ {isDev && upgradeAvailable && (
+
+ )}
+
+
+
+ {upgradeAvailable ? (
+
+
+ {LL.UPGRADE_AVAILABLE()}
+
+ ) : (
+
+
+ {LL.LATEST_VERSION()}
+
+ )}
+ >
+ ) : (
+
+ not online
+
+ )}
+
{renderUploadDialog()}
>
diff --git a/interface/src/app/settings/security/ManageUsers.tsx b/interface/src/app/settings/security/ManageUsers.tsx
index affcf6496..758882869 100644
--- a/interface/src/app/settings/security/ManageUsers.tsx
+++ b/interface/src/app/settings/security/ManageUsers.tsx
@@ -2,9 +2,9 @@ import { useContext, useState } from 'react';
import { useBlocker } from 'react-router-dom';
import CancelIcon from '@mui/icons-material/Cancel';
-import CheckIcon from '@mui/icons-material/Check';
import CloseIcon from '@mui/icons-material/Close';
import DeleteIcon from '@mui/icons-material/Delete';
+import CheckIcon from '@mui/icons-material/Done';
import EditIcon from '@mui/icons-material/Edit';
import PersonAddIcon from '@mui/icons-material/PersonAdd';
import VpnKeyIcon from '@mui/icons-material/VpnKey';
diff --git a/interface/src/i18n/cz/index.ts b/interface/src/i18n/cz/index.ts
index 6b9d0a32c..e8935fa62 100644
--- a/interface/src/i18n/cz/index.ts
+++ b/interface/src/i18n/cz/index.ts
@@ -177,7 +177,6 @@ const cz: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Opravdu chcete resetovat zařízení EMS-ESP do továrního nastavení?',
STABLE: 'Stabilní',
DEVELOPMENT: 'Vývojová verze',
- EMS_ESP_VER: 'Verze firmwaru',
UPTIME: 'Doba provozu systému',
FREE_MEMORY: 'Volná paměť',
PSRAM: 'PSRAM (Velikost / Volná)',
@@ -332,7 +331,7 @@ const cz: Translation = {
ALLVALUES: 'Všechny hodnoty',
SPECIAL_FUNCTIONS: 'Speciální funkce',
WAIT_FIRMWARE: 'Firmware se nahrává a instaluje',
- INSTALL_VERSION: 'Tímto se nainstaluje verze {0}. Jste si jistí?',
+ INSTALL_VERSION: 'Tímto se {0} verze {1}. Jste si jistí?',
SWITCH_DEV: 'přepnout na vývojovou verzi',
UPGRADE_AVAILABLE: 'Je k dispozici aktualizace firmwaru!',
LATEST_VERSION: 'Používáte nejnovější verzi firmwaru.',
diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts
index e53e92cdc..a1a384452 100644
--- a/interface/src/i18n/de/index.ts
+++ b/interface/src/i18n/de/index.ts
@@ -177,7 +177,6 @@ const de: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Sind Sie sicher, alle Einstellungen auf Werkseinstellung zu setzen?',
STABLE: 'Stabil',
DEVELOPMENT: 'Entwicklung',
- EMS_ESP_VER: 'Firmware-Version',
UPTIME: 'Systembetriebszeit',
FREE_MEMORY: 'Freier RAM Speicher',
PSRAM: 'PSRAM (Größe / Frei)',
@@ -332,7 +331,7 @@ const de: Translation = {
ALLVALUES: 'Alle Werte',
SPECIAL_FUNCTIONS: 'Sonderfunktionen',
WAIT_FIRMWARE: 'Die Firmware wird hochgeladen und installiert.',
- INSTALL_VERSION: 'Dadurch wird die Version installiert {0}. Sind Sie sicher?',
+ INSTALL_VERSION: 'Dadurch wird die Version {0} {1}. Sind Sie sicher?',
SWITCH_DEV: 'Wechseln Sie zur Entwicklungsversion!',
UPGRADE_AVAILABLE: 'Es ist ein Firmware-Upgrade verfügbar.',
LATEST_VERSION: 'Sie verwenden die neueste Firmware-Version.',
diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts
index 0ad95342f..e52b31977 100644
--- a/interface/src/i18n/en/index.ts
+++ b/interface/src/i18n/en/index.ts
@@ -177,7 +177,6 @@ const en: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Are you sure you want to reset EMS-ESP to its factory defaults?',
STABLE: 'Stable',
DEVELOPMENT: 'Development',
- EMS_ESP_VER: 'Firmware Version',
UPTIME: 'System Uptime',
FREE_MEMORY: 'Free Memory',
PSRAM: 'PSRAM (Size / Free)',
@@ -332,7 +331,7 @@ const en: Translation = {
ALLVALUES: 'All Values',
SPECIAL_FUNCTIONS: 'Special Functions',
WAIT_FIRMWARE: 'Firmware is uploading and installing',
- INSTALL_VERSION: 'This will install version {0}. Are you sure?',
+ INSTALL_VERSION: 'This will {0} version {1}. Are you sure?',
SWITCH_DEV: 'switch to the development version',
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!',
LATEST_VERSION: 'You are using the latest firmware version.',
diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts
index 759bd9ef4..f29674778 100644
--- a/interface/src/i18n/fr/index.ts
+++ b/interface/src/i18n/fr/index.ts
@@ -177,7 +177,6 @@ const fr: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: "Êtes-vous sûr de vouloir réinitialiser l'appareil à ses paramètres d'usine ?",
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Développement',
- EMS_ESP_VER: 'Firmware Version', // TODO translate
UPTIME: 'Durée de fonctionnement du système',
FREE_MEMORY: 'Libre Memory',
PSRAM: 'PSRAM (Taille / Libre)',
@@ -332,7 +331,7 @@ const fr: Translation = {
ALLVALUES: 'All Values', // TODO translate
SPECIAL_FUNCTIONS: 'Special Functions',
WAIT_FIRMWARE: 'Firmware is uploading and installing', // TODO translate
- INSTALL_VERSION: 'This will install version {0}. Are you sure?', // TODO translate
+ INSTALL_VERSION: 'This will {0} version {1}. Are you sure?', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest firmware version.', // TODO translate
diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts
index e27340b09..582490226 100644
--- a/interface/src/i18n/it/index.ts
+++ b/interface/src/i18n/it/index.ts
@@ -177,7 +177,6 @@ const it: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Sei sicuro di voler ripristinare il dispositivo alle impostazioni di fabbrica??',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Sviluppo',
- EMS_ESP_VER: 'Versione Firmware',
UPTIME: 'Tempo di attività del sistema',
FREE_MEMORY: 'Free Memory',
PSRAM: 'PSRAM (Size / Free)',
@@ -332,7 +331,7 @@ const it: Translation = {
ALLVALUES: 'All Values', // TODO translate
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Firmware is uploading and installing', // TODO translate
- INSTALL_VERSION: 'This will install version {0}. Are you sure?', // TODO translate
+ INSTALL_VERSION: 'This will {0} version {1}. Are you sure?', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest firmware version.', // TODO translate
diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts
index 9b5851139..2e5314a00 100644
--- a/interface/src/i18n/nl/index.ts
+++ b/interface/src/i18n/nl/index.ts
@@ -177,7 +177,6 @@ const nl: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Weet je zeker dat je een reset naar fabrieksinstellingen uit wilt voeren?',
STABLE: 'Stable',
DEVELOPMENT: 'Development',
- EMS_ESP_VER: 'Firmware Versie',
UPTIME: 'Systeem Uptime',
FREE_MEMORY: 'Free Memory',
PSRAM: 'PSRAM (Size / Free)',
@@ -332,7 +331,7 @@ const nl: Translation = {
ALLVALUES: 'All Values', // TODO translate
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Firmware is uploading and installing', // TODO translate
- INSTALL_VERSION: 'This will install version {0}. Are you sure?', // TODO translate
+ INSTALL_VERSION: 'This will {0} version {1}. Are you sure?', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest firmware version.', // TODO translate
diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts
index 048cb75f3..2ea128bb8 100644
--- a/interface/src/i18n/no/index.ts
+++ b/interface/src/i18n/no/index.ts
@@ -177,7 +177,6 @@ const no: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Er du sikker på at du vil resette enheten til fabrikkinstillinger?',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Development',
- EMS_ESP_VER: 'Firmware Version', // TODO translate
UPTIME: 'System Oppetid',
FREE_MEMORY: 'Ledig Memory',
PSRAM: 'PSRAM (Størrelse / Ledig)',
@@ -332,7 +331,7 @@ const no: Translation = {
ALLVALUES: 'All Values', // TODO translate
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Firmware is uploading and installing', // TODO translate
- INSTALL_VERSION: 'This will install version {0}. Are you sure?', // TODO translate
+ INSTALL_VERSION: 'This will {0} version {1}. Are you sure?', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest firmware version.', // TODO translate
diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts
index 216dc58ea..3910815af 100644
--- a/interface/src/i18n/pl/index.ts
+++ b/interface/src/i18n/pl/index.ts
@@ -177,7 +177,6 @@ const pl: BaseTranslation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Na pewno chcesz przywrócić ustawienia fabryczne interfejsu EMS-ESP?',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Testowe',
- EMS_ESP_VER: 'Wersja Firmware',
UPTIME: 'Czas działania systemu',
FREE_MEMORY: 'Wolne Memory',
PSRAM: 'PSRAM (rozmiar / wolne)',
@@ -332,7 +331,7 @@ const pl: BaseTranslation = {
ALLVALUES: 'All Values', // TODO translate
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Firmware is uploading and installing', // TODO translate
- INSTALL_VERSION: 'This will install version {0}. Are you sure?', // TODO translate
+ INSTALL_VERSION: 'This will {0} version {1}. Are you sure?', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest firmware version.', // TODO translate
diff --git a/interface/src/i18n/sk/index.ts b/interface/src/i18n/sk/index.ts
index 07e88a183..13e2bfcdc 100644
--- a/interface/src/i18n/sk/index.ts
+++ b/interface/src/i18n/sk/index.ts
@@ -177,7 +177,6 @@ const sk: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Naozaj chcete resetovať EMS-ESP na predvolené výrobné nastavenia?',
STABLE: 'Stabilná',
DEVELOPMENT: 'Vývojárska',
- EMS_ESP_VER: 'Firmware verzia',
UPTIME: 'Beh systému',
FREE_MEMORY: 'Voľné Memory',
PSRAM: 'PSRAM (Veľkosť / Voľné)',
@@ -332,7 +331,7 @@ const sk: Translation = {
ALLVALUES: 'Všetky hodnoty',
SPECIAL_FUNCTIONS: 'Špeciálne funkcie',
WAIT_FIRMWARE: 'Firmvér sa nahráva a inštaluje',
- INSTALL_VERSION: 'Týmto sa nainštaluje verzia {0}. Si si istý?',
+ INSTALL_VERSION: 'Týmto sa {0} verzia {1}. Si si istý?',
SWITCH_DEV: 'prejsť na vývojovú verziu',
UPGRADE_AVAILABLE: 'K dispozícii je aktualizácia firmvéru!',
LATEST_VERSION: 'Používate poslednú verziu firmvéru.',
diff --git a/interface/src/i18n/sv/index.ts b/interface/src/i18n/sv/index.ts
index 2dccd1c21..ce9b6a3b1 100644
--- a/interface/src/i18n/sv/index.ts
+++ b/interface/src/i18n/sv/index.ts
@@ -177,7 +177,6 @@ const sv: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Är du säker att du vill fabriksåterställa enheten?',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Utveckling',
- EMS_ESP_VER: 'Firmware Version', // TODO translate
UPTIME: 'Systemets Upptid',
FREE_MEMORY: 'Ledigt Memory',
PSRAM: 'PSRAM (Storlek / Ledigt)',
@@ -332,7 +331,7 @@ const sv: Translation = {
ALLVALUES: 'All Values', // TODO translate
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Firmware is uploading and installing', // TODO translate
- INSTALL_VERSION: 'This will install version {0}. Are you sure?', // TODO translate
+ INSTALL_VERSION: 'This will {0} version {1}. Are you sure?', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest firmware version.', // TODO translate
diff --git a/interface/src/i18n/tr/index.ts b/interface/src/i18n/tr/index.ts
index 7f84a6fa4..0ac801948 100644
--- a/interface/src/i18n/tr/index.ts
+++ b/interface/src/i18n/tr/index.ts
@@ -177,7 +177,6 @@ const tr: Translation = {
SYSTEM_FACTORY_TEXT_DIALOG: 'Cihazı fabrika ayarlarına döndürmek istediğinize emin misiniz?',
STABLE: 'Stable', // TODO translate
DEVELOPMENT: 'Geliştirme',
- EMS_ESP_VER: 'Firmware Sürümü',
UPTIME: 'Sistem Çalışma Süresi',
FREE_MEMORY: 'Yığın Memory',
PSRAM: 'PSRAM (Boyut / Boş)',
@@ -332,7 +331,7 @@ const tr: Translation = {
ALLVALUES: 'All Values', // TODO translate
SPECIAL_FUNCTIONS: 'Special Functions', // TODO translate
WAIT_FIRMWARE: 'Firmware is uploading and installing', // TODO translate
- INSTALL_VERSION: 'This will install version {0}. Are you sure?', // TODO translate
+ INSTALL_VERSION: 'This will {0} version {1}. Are you sure?', // TODO translate
SWITCH_DEV: 'switch to the development version', // TODO translate
UPGRADE_AVAILABLE: 'There is a firmware upgrade available!', // TODO translate
LATEST_VERSION: 'You are using the latest firmware version.', // TODO translate
diff --git a/interface/vite.config.ts b/interface/vite.config.ts
index faf902d63..5198143d4 100644
--- a/interface/vite.config.ts
+++ b/interface/vite.config.ts
@@ -20,7 +20,8 @@ export default defineConfig(({ command, mode }) => {
changeOrigin: true,
secure: false
},
- '/rest': 'http://localhost:3080'
+ '/rest': 'http://localhost:3080',
+ '/gh': 'http://localhost:3080' // mock for GitHub API
}
}
};
diff --git a/interface/yarn.lock b/interface/yarn.lock
index 7bdb8f559..9c955c8b0 100644
--- a/interface/yarn.lock
+++ b/interface/yarn.lock
@@ -1697,7 +1697,7 @@ __metadata:
typescript-eslint: "npm:8.13.0"
vite: "npm:^5.4.10"
vite-plugin-imagemin: "npm:^0.6.1"
- vite-tsconfig-paths: "npm:^5.1.0"
+ vite-tsconfig-paths: "npm:^5.1.1"
languageName: unknown
linkType: soft
@@ -6954,9 +6954,9 @@ __metadata:
languageName: node
linkType: hard
-"vite-tsconfig-paths@npm:^5.1.0":
- version: 5.1.0
- resolution: "vite-tsconfig-paths@npm:5.1.0"
+"vite-tsconfig-paths@npm:^5.1.1":
+ version: 5.1.1
+ resolution: "vite-tsconfig-paths@npm:5.1.1"
dependencies:
debug: "npm:^4.1.1"
globrex: "npm:^0.1.2"
@@ -6966,7 +6966,7 @@ __metadata:
peerDependenciesMeta:
vite:
optional: true
- checksum: 10c0/fff3fc7ada55aa4cfd6cad5c6006a8eaf74df0cc1ed5e9282c0c479012c57095d391379cb1742c394711cbb3ee591c66e27838779d8388297bdf033aa6e57719
+ checksum: 10c0/7d18e2f6daa057e21885bffd3dc751f2a8fe1f249a70e4ca35b944c505d1b59d6e7c3f2278afef5139aa4cabdcb307567d3d26f2009dcccff4281c485c89a231
languageName: node
linkType: hard
diff --git a/mock-api/rest_server.ts b/mock-api/rest_server.ts
index 9b209bba6..d6b00e235 100644
--- a/mock-api/rest_server.ts
+++ b/mock-api/rest_server.ts
@@ -21,6 +21,7 @@ const router = AutoRouter({
const REST_ENDPOINT_ROOT = '/rest/';
const API_ENDPOINT_ROOT = '/api/';
+const GH_ENDPOINT_ROOT = '/gh/'; // for mock GitHub API for version checking
// HTTP HEADERS for msgpack
const headers = {
@@ -28,6 +29,20 @@ const headers = {
'Content-type': 'application/msgpack'
};
+// Versions - all without the 'v'
+let THIS_VERSION = '3.7.0';
+let LATEST_STABLE_VERSION = '3.7.0';
+let LATEST_DEV_VERSION = '3.7.1-dev.4';
+let VERSION_IS_UPGRADEABLE = false;
+
+// for testing - scenario 1
+// THIS_VERSION = '3.7.1-dev.1';
+// VERSION_IS_UPGRADEABLE = true;
+
+// for testing - scenario 2
+// THIS_VERSION = '3.6.5';
+// VERSION_IS_UPGRADEABLE = true;
+
// GLOBAL VARIABLES
let countWifiScanPoll = 0; // wifi network scan
let countHardwarePoll = 0; // for during an upload
@@ -199,16 +214,18 @@ function custom_support() {
function check_upgrade(version: string) {
let data = {};
if (version) {
- console.log('check upgrade from version', version);
+ const dev_version = version.split(',')[0];
+ const stable_version = version.split(',')[1];
+ console.log("latest dev version: " + dev_version + ", latest stable version: " + stable_version);
+ console.log('Version upgrade check from version ' + THIS_VERSION + ', upgradable: ' + VERSION_IS_UPGRADEABLE);
data = {
- emsesp_version: VERSION,
- // upgradeable: true
- upgradeable: false
+ emsesp_version: THIS_VERSION,
+ upgradeable: VERSION_IS_UPGRADEABLE
};
} else {
- console.log('requesting ems-esp version');
+ console.log('requesting ems-esp version ('+THIS_VERSION+')');
data = {
- emsesp_version: VERSION
+ emsesp_version: THIS_VERSION
};
}
return data;
@@ -468,11 +485,8 @@ const VERIFY_AUTHORIZATION_ENDPOINT = REST_ENDPOINT_ROOT + 'verifyAuthorization'
const SIGN_IN_ENDPOINT = REST_ENDPOINT_ROOT + 'signIn';
const GENERATE_TOKEN_ENDPOINT = REST_ENDPOINT_ROOT + 'generateToken';
-const VERSION = '3.7.0';
-// const VERSION = '3.6.4';
-
let system_status = {
- emsesp_version: VERSION,
+ emsesp_version: THIS_VERSION,
bus_status: 0,
// status: 2,
uptime: 77186,
@@ -573,7 +587,7 @@ const EMSESP_SYSTEM_INFO_ENDPOINT = API_ENDPOINT_ROOT + 'system/info';
const emsesp_info = {
System: {
- version: VERSION,
+ version: THIS_VERSION,
uptime: '001+06:40:34.018',
'uptime (seconds)': 110434,
freemem: 131,
@@ -4878,6 +4892,18 @@ router
return status(404); // not found
});
+// Mock GitHub API
+
+router
+ .get(GH_ENDPOINT_ROOT + '/tags/latest', () => {
+ console.log('returning latest development version: ' + LATEST_DEV_VERSION);
+ return { name: 'v'+LATEST_DEV_VERSION };
+ })
+ .get(GH_ENDPOINT_ROOT + '/latest', () => {
+ console.log('returning latest stable version: ' + LATEST_STABLE_VERSION);
+ return { name: 'v'+LATEST_STABLE_VERSION };
+ });
+
export default router;
// use this with cloudflare workers instead
diff --git a/src/common.h b/src/common.h
index 608527620..aa49be717 100644
--- a/src/common.h
+++ b/src/common.h
@@ -52,18 +52,19 @@ using string_vector = std::vector;
#define F_(string_name) (__pstr__##string_name)
#define FL_(list_name) (__pstr__L_##list_name)
+// The language settings below must match system.cpp
#if defined(EMSESP_TEST)
// in Test mode use two languages (en & de) to save flash memory needed for the tests
-#define MAKE_WORD_TRANSLATION(list_name, en, de, ...) static const char * const __pstr__L_##list_name[] = {de, nullptr};
-#define MAKE_TRANSLATION(list_name, shortname, en, de, ...) static const char * const __pstr__L_##list_name[] = {shortname, de, nullptr};
+#define MAKE_WORD_TRANSLATION(list_name, en, de, ...) static const char * const __pstr__L_##list_name[] = {en, de, nullptr};
+#define MAKE_TRANSLATION(list_name, shortname, en, de, ...) static const char * const __pstr__L_##list_name[] = {shortname, en, de, nullptr};
#elif defined(EMSESP_EN_ONLY)
// EN only
#define MAKE_WORD_TRANSLATION(list_name, en, ...) static const char * const __pstr__L_##list_name[] = {en, nullptr};
#define MAKE_TRANSLATION(list_name, shortname, en, ...) static const char * const __pstr__L_##list_name[] = {shortname, en, nullptr};
#elif defined(EMSESP_DE_ONLY)
// EN + DE
-#define MAKE_WORD_TRANSLATION(list_name, en, de, ...) static const char * const __pstr__L_##list_name[] = {de, nullptr};
-#define MAKE_TRANSLATION(list_name, shortname, en, de, ...) static const char * const __pstr__L_##list_name[] = {shortname, de, nullptr};
+#define MAKE_WORD_TRANSLATION(list_name, en, de, ...) static const char * const __pstr__L_##list_name[] = {en, de, nullptr};
+#define MAKE_TRANSLATION(list_name, shortname, en, de, ...) static const char * const __pstr__L_##list_name[] = {shortname, en, de, nullptr};
#else
#define MAKE_WORD_TRANSLATION(list_name, ...) static const char * const __pstr__L_##list_name[] = {__VA_ARGS__, nullptr};
#define MAKE_TRANSLATION(list_name, ...) static const char * const __pstr__L_##list_name[] = {__VA_ARGS__, nullptr};
diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp
index a1efd137e..70ae30a15 100644
--- a/src/emsdevice.cpp
+++ b/src/emsdevice.cpp
@@ -1271,7 +1271,7 @@ void EMSdevice::getCustomizationEntities(std::vector & entity_ids)
// pipe symbols (|) are escaped so they can be converted to Markdown in the Wiki
// format is: device name,device type,product id,shortname,fullname,type [options...] \\| (min/max),uom,writeable,discovery entityid v3.4, discovery entityid
#if defined(EMSESP_STANDALONE)
-void EMSdevice::dump_value_info() {
+void EMSdevice::dump_devicevalue_info() {
for (auto & dv : devicevalues_) {
if (dv.fullname != nullptr) {
Serial.print('\"');
@@ -1438,8 +1438,6 @@ void EMSdevice::dump_value_info() {
Serial.print(",");
// modbus specific infos
-
-
Serial.print(device_type());
Serial.print(',');
diff --git a/src/emsdevice.h b/src/emsdevice.h
index 62540d5c2..4f02fd76e 100644
--- a/src/emsdevice.h
+++ b/src/emsdevice.h
@@ -483,7 +483,7 @@ class EMSdevice {
}
};
void dump_telegram_info(std::vector & telegram_functions_dump);
- void dump_value_info();
+ void dump_devicevalue_info();
#endif
private:
@@ -518,14 +518,13 @@ class EMSdevice {
}
};
- std::vector telegram_functions_; // each EMS device has its own set of registered telegram types
-
std::vector handlers_ignored_;
#if defined(EMSESP_STANDALONE) || defined(EMSESP_TEST)
- public: // so we can call it from WebCustomizationService::test()
+ public: // so we can call it from WebCustomizationService::test() and EMSESP::dump_all_entities()
#endif
- std::vector devicevalues_; // all the device values
+ std::vector telegram_functions_; // each EMS device has its own set of registered telegram types
+ std::vector devicevalues_; // all the device values
};
} // namespace emsesp
diff --git a/src/emsesp.cpp b/src/emsesp.cpp
index b2c826353..bae7a1b67 100644
--- a/src/emsesp.cpp
+++ b/src/emsesp.cpp
@@ -332,7 +332,7 @@ void EMSESP::show_ems(uuid::console::Shell & shell) {
// Dump all entities to Serial out
// this is intended to run within the OS with lots of available memory!
#if defined(EMSESP_STANDALONE)
-void EMSESP::dump_all_values(uuid::console::Shell & shell) {
+void EMSESP::dump_all_entities(uuid::console::Shell & shell) {
Serial.println("---- CSV START ----"); // marker use by py script
// add header for CSV
Serial.println("device name,device type,product id,shortname,fullname,type [options...] \\| (min/max),uom,writeable,discovery entityid v3.4,discovery "
@@ -361,7 +361,7 @@ void EMSESP::dump_all_values(uuid::console::Shell & shell) {
// for testing the mixer use ... if (device.product_id == 69) {
emsdevices.push_back(
EMSFactory::add(device.device_type, device_id, device.product_id, "1.0", device.default_name, device.flags, EMSdevice::Brand::NO_BRAND));
- emsdevices.back()->dump_value_info();
+ emsdevices.back()->dump_devicevalue_info();
}
}
}
diff --git a/src/emsesp.h b/src/emsesp.h
index 018dae180..df418a9f5 100644
--- a/src/emsesp.h
+++ b/src/emsesp.h
@@ -124,25 +124,23 @@ class EMSESP {
static void send_write_request(const uint16_t type_id, const uint8_t dest, const uint8_t offset, const uint8_t value);
static void send_write_request(const uint16_t type_id, const uint8_t dest, const uint8_t offset, const uint8_t value, const uint16_t validate_typeid);
- static bool device_exists(const uint8_t device_id);
- static void device_active(const uint8_t device_id, const bool active);
- static bool cmd_is_readonly(const uint8_t device_type, const uint8_t device_id, const char * cmd, const int8_t id);
-
+ static bool device_exists(const uint8_t device_id);
+ static void device_active(const uint8_t device_id, const bool active);
+ static bool cmd_is_readonly(const uint8_t device_type, const uint8_t device_id, const char * cmd, const int8_t id);
static uint8_t device_id_from_cmd(const uint8_t device_type, const char * cmd, const int8_t id);
static uint8_t count_devices(const uint8_t device_type);
static uint8_t count_devices();
static uint8_t device_index(const uint8_t device_type, const uint8_t unique_id);
-
- static bool get_device_value_info(JsonObject root, const char * cmd, const int8_t id, const uint8_t devicetype);
+ static bool get_device_value_info(JsonObject root, const char * cmd, const int8_t id, const uint8_t devicetype);
static void show_device_values(uuid::console::Shell & shell);
static void show_sensor_values(uuid::console::Shell & shell);
- static void dump_all_values(uuid::console::Shell & shell);
- static void dump_all_telegrams(uuid::console::Shell & shell);
-
static void show_devices(uuid::console::Shell & shell);
static void show_ems(uuid::console::Shell & shell);
+ static void dump_all_entities(uuid::console::Shell & shell);
+ static void dump_all_telegrams(uuid::console::Shell & shell);
+
static void uart_init();
static void incoming_telegram(uint8_t * data, const uint8_t length);
diff --git a/src/mqtt.cpp b/src/mqtt.cpp
index a52e1d5ae..e2c588fac 100644
--- a/src/mqtt.cpp
+++ b/src/mqtt.cpp
@@ -1141,6 +1141,9 @@ void Mqtt::add_ha_uom(JsonObject doc, const uint8_t type, const uint8_t uom, con
doc[uom_ha] = "s";
} else if (uom != DeviceValueUOM::NONE) {
doc[uom_ha] = EMSdevice::uom_to_string(uom); // default
+ } else if (discovery_type() != discoveryType::HOMEASSISTANT) {
+ // Domoticz use " " for a no-uom
+ doc[uom_ha] = " ";
}
}
diff --git a/src/test/test.cpp b/src/test/test.cpp
index 03854c796..3c9bf294e 100644
--- a/src/test/test.cpp
+++ b/src/test/test.cpp
@@ -442,7 +442,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
if (command == "entity_dump") {
System::test_set_all_active(true);
- EMSESP::dump_all_values(shell);
+ EMSESP::dump_all_entities(shell);
ok = true;
}
@@ -1014,25 +1014,36 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
// request.url("/api");
// EMSESP::webAPIService.webAPIService(&request, doc.as());
- char data2[] = "{\"action\":\"customSupport\", \"param\":\"hello\"}";
- deserializeJson(doc, data2);
+ // char data2[] = "{\"action\":\"customSupport\", \"param\":\"hello\"}";
+ // deserializeJson(doc, data2);
+ // request.url("/rest/action");
+ // EMSESP::webStatusService.action(&request, doc.as());
+
+ // char data3[] = "{\"action\":\"export\", \"param\":\"schedule\"}";
+ // deserializeJson(doc, data3);
+ // request.url("/rest/action");
+ // EMSESP::webStatusService.action(&request, doc.as());
+
+ // char data4[] = "{\"action\":\"export\", \"param\":\"allvalues\"}";
+ // deserializeJson(doc, data4);
+ // request.url("/rest/action");
+ // EMSESP::webStatusService.action(&request, doc.as());
+
+ // test version checks
+ // test with "current_version_s = "3.7.1-dev.8" in WebStatusService::checkUpgrade()
request.url("/rest/action");
+ deserializeJson(doc, "{\"action\":\"checkUpgrade\", \"param\":\"3.7.1-dev.9,3.7.0\"}"); // is upgradable
+ EMSESP::webStatusService.action(&request, doc.as());
+ deserializeJson(doc, "{\"action\":\"checkUpgrade\", \"param\":\"3.7.1-dev.7,3.7.0\"}"); // is not upgradable
EMSESP::webStatusService.action(&request, doc.as());
- char data3[] = "{\"action\":\"export\", \"param\":\"schedule\"}";
- deserializeJson(doc, data3);
- request.url("/rest/action");
- EMSESP::webStatusService.action(&request, doc.as());
+ // test with "current_version_s = "3.6.5" in WebStatusService::checkUpgrade()
+ // request.url("/rest/action");
+ // deserializeJson(doc, "{\"action\":\"checkUpgrade\", \"param\":\"3.7.1-dev.9,3.6.5\"}"); // is noy upgradable
+ // EMSESP::webStatusService.action(&request, doc.as());
+ // deserializeJson(doc, "{\"action\":\"checkUpgrade\", \"param\":\"3.7.1-dev.7,3.7.0\"}"); // is upgradable
+ // EMSESP::webStatusService.action(&request, doc.as());
- char data4[] = "{\"action\":\"export\", \"param\":\"allvalues\"}";
- deserializeJson(doc, data4);
- request.url("/rest/action");
- EMSESP::webStatusService.action(&request, doc.as());
-
- char data5[] = "{\"action\":\"checkUpgrade\", \"param\":\"3.7.0-dev.99\"}";
- deserializeJson(doc, data5);
- request.url("/rest/action");
- EMSESP::webStatusService.action(&request, doc.as());
// char data6[] = "{\"device\":\"system\", \"cmd\":\"read\",\"value\":\"8 2 27 1\"}";
// deserializeJson(doc, data6);
diff --git a/src/test/test.h b/src/test/test.h
index e2c6fd94e..e979985b7 100644
--- a/src/test/test.h
+++ b/src/test/test.h
@@ -41,7 +41,7 @@ namespace emsesp {
// #define EMSESP_DEBUG_DEFAULT "310"
// #define EMSESP_DEBUG_DEFAULT "render"
// #define EMSESP_DEBUG_DEFAULT "api"
-// #define EMSESP_DEBUG_DEFAULT "api3"
+#define EMSESP_DEBUG_DEFAULT "api3"
// #define EMSESP_DEBUG_DEFAULT "crash"
// #define EMSESP_DEBUG_DEFAULT "dv"
// #define EMSESP_DEBUG_DEFAULT "lastcode"
diff --git a/src/version.h b/src/version.h
index bc1eb86f2..4386509df 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1 +1 @@
-#define EMSESP_APP_VERSION "3.7.1-dev.4"
\ No newline at end of file
+#define EMSESP_APP_VERSION "3.7.1-dev.5"
\ No newline at end of file
diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp
index 1c5d175d8..e9e4a3b4c 100644
--- a/src/web/WebStatusService.cpp
+++ b/src/web/WebStatusService.cpp
@@ -203,24 +203,44 @@ void WebStatusService::action(AsyncWebServerRequest * request, JsonVariant json)
}
// action = checkUpgrade
-bool WebStatusService::checkUpgrade(JsonObject root, std::string & latest_version) {
- root["emsesp_version"] = EMSESP_APP_VERSION;
-
- if (!latest_version.empty()) {
-#if defined(EMSESP_DEBUG)
- emsesp::EMSESP::logger().debug("Checking for upgrade: %s < %s", EMSESP_APP_VERSION, latest_version.c_str());
+// versions holds the latest development version and stable version in one string, comma separated
+bool WebStatusService::checkUpgrade(JsonObject root, std::string & versions) {
+ std::string current_version_s;
+#ifndef EMSESP_STANDALONE
+ current_version_s = EMSESP_APP_VERSION;
+#else
+ // for testing only - see api3 test in test.cpp
+ // current_version_s = "3.6.5";
+ current_version_s = "3.7.1-dev.8";
#endif
- version::Semver200_version settings_version(EMSESP_APP_VERSION);
- version::Semver200_version this_version(latest_version);
+ if (!versions.empty()) {
+ version::Semver200_version current_version(current_version_s);
+ bool using_dev_version = !current_version.prerelease().find("dev"); // look for dev in the name to determine if we're using dev version
+ version::Semver200_version latest_version(using_dev_version ? versions.substr(0, versions.find(',')) : versions.substr(versions.find(',') + 1));
+ bool upgradeable = (latest_version > current_version);
- if ((this_version.prerelease().empty() && settings_version.prerelease().empty())
- || (!this_version.prerelease().empty() && !settings_version.prerelease().empty())) {
- root["upgradeable"] = (this_version > settings_version);
- }
+#if defined(EMSESP_DEBUG)
+ emsesp::EMSESP::logger()
+ .debug("Checking Version upgrade. Using %s release branch. current version=%d.%d.%d-%s, latest version=%d.%d.%d-%s (%s upgradeable)",
+ (using_dev_version ? "dev" : "stable"),
+ current_version.major(),
+ current_version.minor(),
+ current_version.patch(),
+ current_version.prerelease().c_str(),
+ latest_version.major(),
+ latest_version.minor(),
+ latest_version.patch(),
+ latest_version.prerelease().c_str(),
+ upgradeable ? "IS" : "NOT");
+#endif
+
+ root["upgradeable"] = upgradeable;
}
- return true; // always ok
+ root["emsesp_version"] = current_version_s; // always send back current version
+
+ return true;
}
// action = allvalues