Merge pull request #715 from proddy/dev

minor changes
This commit is contained in:
Proddy
2022-10-31 20:56:54 +01:00
committed by GitHub
16 changed files with 102 additions and 91 deletions

View File

@@ -12,10 +12,10 @@
"@emotion/styled": "^11.10.5", "@emotion/styled": "^11.10.5",
"@msgpack/msgpack": "^2.8.0", "@msgpack/msgpack": "^2.8.0",
"@mui/icons-material": "^5.10.9", "@mui/icons-material": "^5.10.9",
"@mui/material": "^5.10.11", "@mui/material": "^5.10.12",
"@table-library/react-table-library": "4.0.23", "@table-library/react-table-library": "4.0.23",
"@types/lodash": "^4.14.186", "@types/lodash": "^4.14.186",
"@types/node": "^18.11.7", "@types/node": "^18.11.8",
"@types/react": "^18.0.24", "@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8", "@types/react-dom": "^18.0.8",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
@@ -3091,9 +3091,9 @@
} }
}, },
"node_modules/@mui/base": { "node_modules/@mui/base": {
"version": "5.0.0-alpha.103", "version": "5.0.0-alpha.104",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.103.tgz", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.104.tgz",
"integrity": "sha512-fJIyB2df3CHn7D26WHnutnY7vew6aytTlhmRJz6GX7ag19zU2GcOUhJAzY5qwWcrXKnlYgzimhEjaEnuiUWU4g==", "integrity": "sha512-tQPxZTzfYMwxYfKhEwufbTfdLpNjFdW7bXq6dK0j8651AAyZL4M8wynWUQ98hH1362R26mZFhVxHB2UD9t7VuA==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.19.0", "@babel/runtime": "^7.19.0",
"@emotion/is-prop-valid": "^1.2.0", "@emotion/is-prop-valid": "^1.2.0",
@@ -3123,9 +3123,9 @@
} }
}, },
"node_modules/@mui/core-downloads-tracker": { "node_modules/@mui/core-downloads-tracker": {
"version": "5.10.11", "version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.11.tgz", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.12.tgz",
"integrity": "sha512-u5ff+UCFDHcR8MoQ8tuJR4c35vt7T/ki3aMEE2O3XQoGs8KJSrBiisFpFKyldg9/W2NSyoZxN+kxEGIfRxh+9Q==", "integrity": "sha512-cR8lOS606G++iVHR8I6ySgMAEiPoA3DxO/nLeqiv7w7d1707kvKoV4/7SWjh4ui+kHb052xlf/G196q2EKx31w==",
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/mui" "url": "https://opencollective.com/mui"
@@ -3157,14 +3157,14 @@
} }
}, },
"node_modules/@mui/material": { "node_modules/@mui/material": {
"version": "5.10.11", "version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.11.tgz", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.12.tgz",
"integrity": "sha512-KJ0wPCTbv6sFzwA3dgg0gowdfF+SRl7D510J9l6Nl/KFX0EawcewQudqKY4slYGFXniKa5PykqokpaWXsCCPqg==", "integrity": "sha512-rG9ZTkG9qUwujyAY1I+uQAa9pkGdsWY3KN+wvS/6H6ZbYIA06QRwmig6ySC6LbeB3WL/I/1ngwJqWX7nfINSbA==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.19.0", "@babel/runtime": "^7.19.0",
"@mui/base": "5.0.0-alpha.103", "@mui/base": "5.0.0-alpha.104",
"@mui/core-downloads-tracker": "^5.10.11", "@mui/core-downloads-tracker": "^5.10.12",
"@mui/system": "^5.10.10", "@mui/system": "^5.10.12",
"@mui/types": "^7.2.0", "@mui/types": "^7.2.0",
"@mui/utils": "^5.10.9", "@mui/utils": "^5.10.9",
"@types/react-transition-group": "^4.4.5", "@types/react-transition-group": "^4.4.5",
@@ -3258,9 +3258,9 @@
} }
}, },
"node_modules/@mui/system": { "node_modules/@mui/system": {
"version": "5.10.10", "version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.10.tgz", "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.12.tgz",
"integrity": "sha512-TXwtKN0adKpBrZmO+eilQWoPf2veh050HLYrN78Kps9OhlvO70v/2Kya0+mORFhu9yhpAwjHXO8JII/R4a5ZLA==", "integrity": "sha512-9DcN3hF2KTTTpZ0K5Tn20B+Tz7tIqDmJLk1M6P0CYoAGUN/xrcF/6dn1zZ829rxE5tmauoDUekTfomrvPsvlSQ==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.19.0", "@babel/runtime": "^7.19.0",
"@mui/private-theming": "^5.10.9", "@mui/private-theming": "^5.10.9",
@@ -19614,9 +19614,9 @@
"integrity": "sha512-h9u4u/jiIRKbq25PM+zymTyW6bhTzELvOoUd+AvYriWOAKpLGnIamaET3pnHYoI5iYphAHBI4ayx0MehR+VVPQ==" "integrity": "sha512-h9u4u/jiIRKbq25PM+zymTyW6bhTzELvOoUd+AvYriWOAKpLGnIamaET3pnHYoI5iYphAHBI4ayx0MehR+VVPQ=="
}, },
"@mui/base": { "@mui/base": {
"version": "5.0.0-alpha.103", "version": "5.0.0-alpha.104",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.103.tgz", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.104.tgz",
"integrity": "sha512-fJIyB2df3CHn7D26WHnutnY7vew6aytTlhmRJz6GX7ag19zU2GcOUhJAzY5qwWcrXKnlYgzimhEjaEnuiUWU4g==", "integrity": "sha512-tQPxZTzfYMwxYfKhEwufbTfdLpNjFdW7bXq6dK0j8651AAyZL4M8wynWUQ98hH1362R26mZFhVxHB2UD9t7VuA==",
"requires": { "requires": {
"@babel/runtime": "^7.19.0", "@babel/runtime": "^7.19.0",
"@emotion/is-prop-valid": "^1.2.0", "@emotion/is-prop-valid": "^1.2.0",
@@ -19629,9 +19629,9 @@
} }
}, },
"@mui/core-downloads-tracker": { "@mui/core-downloads-tracker": {
"version": "5.10.11", "version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.11.tgz", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.12.tgz",
"integrity": "sha512-u5ff+UCFDHcR8MoQ8tuJR4c35vt7T/ki3aMEE2O3XQoGs8KJSrBiisFpFKyldg9/W2NSyoZxN+kxEGIfRxh+9Q==" "integrity": "sha512-cR8lOS606G++iVHR8I6ySgMAEiPoA3DxO/nLeqiv7w7d1707kvKoV4/7SWjh4ui+kHb052xlf/G196q2EKx31w=="
}, },
"@mui/icons-material": { "@mui/icons-material": {
"version": "5.10.9", "version": "5.10.9",
@@ -19642,14 +19642,14 @@
} }
}, },
"@mui/material": { "@mui/material": {
"version": "5.10.11", "version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.11.tgz", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.12.tgz",
"integrity": "sha512-KJ0wPCTbv6sFzwA3dgg0gowdfF+SRl7D510J9l6Nl/KFX0EawcewQudqKY4slYGFXniKa5PykqokpaWXsCCPqg==", "integrity": "sha512-rG9ZTkG9qUwujyAY1I+uQAa9pkGdsWY3KN+wvS/6H6ZbYIA06QRwmig6ySC6LbeB3WL/I/1ngwJqWX7nfINSbA==",
"requires": { "requires": {
"@babel/runtime": "^7.19.0", "@babel/runtime": "^7.19.0",
"@mui/base": "5.0.0-alpha.103", "@mui/base": "5.0.0-alpha.104",
"@mui/core-downloads-tracker": "^5.10.11", "@mui/core-downloads-tracker": "^5.10.12",
"@mui/system": "^5.10.10", "@mui/system": "^5.10.12",
"@mui/types": "^7.2.0", "@mui/types": "^7.2.0",
"@mui/utils": "^5.10.9", "@mui/utils": "^5.10.9",
"@types/react-transition-group": "^4.4.5", "@types/react-transition-group": "^4.4.5",
@@ -19682,9 +19682,9 @@
} }
}, },
"@mui/system": { "@mui/system": {
"version": "5.10.10", "version": "5.10.12",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.10.tgz", "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.12.tgz",
"integrity": "sha512-TXwtKN0adKpBrZmO+eilQWoPf2veh050HLYrN78Kps9OhlvO70v/2Kya0+mORFhu9yhpAwjHXO8JII/R4a5ZLA==", "integrity": "sha512-9DcN3hF2KTTTpZ0K5Tn20B+Tz7tIqDmJLk1M6P0CYoAGUN/xrcF/6dn1zZ829rxE5tmauoDUekTfomrvPsvlSQ==",
"requires": { "requires": {
"@babel/runtime": "^7.19.0", "@babel/runtime": "^7.19.0",
"@mui/private-theming": "^5.10.9", "@mui/private-theming": "^5.10.9",

View File

@@ -8,10 +8,10 @@
"@emotion/styled": "^11.10.5", "@emotion/styled": "^11.10.5",
"@msgpack/msgpack": "^2.8.0", "@msgpack/msgpack": "^2.8.0",
"@mui/icons-material": "^5.10.9", "@mui/icons-material": "^5.10.9",
"@mui/material": "^5.10.11", "@mui/material": "^5.10.12",
"@table-library/react-table-library": "4.0.23", "@table-library/react-table-library": "4.0.23",
"@types/lodash": "^4.14.186", "@types/lodash": "^4.14.186",
"@types/node": "^18.11.7", "@types/node": "^18.11.8",
"@types/react": "^18.0.24", "@types/react": "^18.0.24",
"@types/react-dom": "^18.0.8", "@types/react-dom": "^18.0.8",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",

View File

@@ -51,7 +51,7 @@ const useFileUpload = ({ upload }: MediaUploadOptions) => {
if (response.status === 200) { if (response.status === 200) {
enqueueSnackbar(LL.UPLOAD() + ' ' + LL.SUCCESSFUL(), { variant: 'success' }); enqueueSnackbar(LL.UPLOAD() + ' ' + LL.SUCCESSFUL(), { variant: 'success' });
} else if (response.status === 201) { } else if (response.status === 201) {
setMd5((String)(response.data)); setMd5(String(response.data));
enqueueSnackbar(LL.UPLOAD() + ' MD5 ' + LL.SUCCESSFUL(), { variant: 'success' }); enqueueSnackbar(LL.UPLOAD() + ' MD5 ' + LL.SUCCESSFUL(), { variant: 'success' });
} }
} catch (error) { } catch (error) {

View File

@@ -22,7 +22,6 @@ interface UploadFileProps {
} }
const GeneralFileUpload: FC<UploadFileProps> = ({ uploadGeneralFile }) => { const GeneralFileUpload: FC<UploadFileProps> = ({ uploadGeneralFile }) => {
const [uploadFile, cancelUpload, uploading, uploadProgress, md5] = useFileUpload({ upload: uploadGeneralFile }); const [uploadFile, cancelUpload, uploading, uploadProgress, md5] = useFileUpload({ upload: uploadGeneralFile });
const { enqueueSnackbar } = useSnackbar(); const { enqueueSnackbar } = useSnackbar();

View File

@@ -72,7 +72,6 @@ const SystemStatusForm: FC = () => {
version: response.data.name, version: response.data.name,
url: response.data.assets[1].browser_download_url, url: response.data.assets[1].browser_download_url,
changelog: response.data.assets[0].browser_download_url changelog: response.data.assets[0].browser_download_url
}); });
}); });
axios.get(VERSIONCHECK_DEV_ENDPOINT).then((response) => { axios.get(VERSIONCHECK_DEV_ENDPOINT).then((response) => {
@@ -308,7 +307,9 @@ const SystemStatusForm: FC = () => {
</ListItemAvatar> </ListItemAvatar>
<ListItemText <ListItemText
primary={LL.FLASH()} primary={LL.FLASH()}
secondary={formatNumber(data.flash_chip_size) + ' KB / ' + (data.flash_chip_speed / 1000000).toFixed(0) + ' MHz'} secondary={
formatNumber(data.flash_chip_size) + ' KB / ' + (data.flash_chip_speed / 1000000).toFixed(0) + ' MHz'
}
/> />
</ListItem> </ListItem>
<Divider variant="inset" component="li" /> <Divider variant="inset" component="li" />

View File

@@ -31,7 +31,7 @@ const de: Translation = {
DEVICE_DETAILS: 'Geräte Details', DEVICE_DETAILS: 'Geräte Details',
BRAND: 'Marke', BRAND: 'Marke',
ENTITY_NAME: 'Entitätsname', ENTITY_NAME: 'Entitätsname',
VALUE: 'Wert', VALUE: '{{Wert||wert}}',
SHOW_FAV: 'nur Favoriten anzeigen', SHOW_FAV: 'nur Favoriten anzeigen',
DEVICE_SENSOR_DATA: 'Geräte- und Sensordaten', DEVICE_SENSOR_DATA: 'Geräte- und Sensordaten',
DEVICES_SENSORS: 'Geräte & Sensoren', DEVICES_SENSORS: 'Geräte & Sensoren',
@@ -202,7 +202,8 @@ const de: Translation = {
DOWNLOAD_CUSTOMIZATION_TEXT: 'Herunterladen der individuellen Entitätsanpassungen', DOWNLOAD_CUSTOMIZATION_TEXT: 'Herunterladen der individuellen Entitätsanpassungen',
DOWNLOAD_SETTINGS_TEXT: DOWNLOAD_SETTINGS_TEXT:
'Herunterladen der Anwendungseinstellungen. Vorsicht beim Teilen der Einstellungen, da sie Passwörter und andere sensitive Einstellungen enthalten', 'Herunterladen der Anwendungseinstellungen. Vorsicht beim Teilen der Einstellungen, da sie Passwörter und andere sensitive Einstellungen enthalten',
UPLOAD_TEXT: 'Hochladen von neuer Firmware (.bin), Geräte- oder Entitätseinstellungen (.json), zur optionalen Validitätsprüfung zuerst die (.md5) Datei hochladen', UPLOAD_TEXT:
'Hochladen von neuer Firmware (.bin), Geräte- oder Entitätseinstellungen (.json), zur optionalen Validitätsprüfung zuerst die (.md5) Datei hochladen',
UPLOADING: 'Hochladen', UPLOADING: 'Hochladen',
UPLOAD_DROP_TEXT: 'Klicken Sie hier, oder ziehen eine Datei hierher', UPLOAD_DROP_TEXT: 'Klicken Sie hier, oder ziehen eine Datei hierher',
ERROR: 'Unerwarteter Fehler, bitter versuchen Sie es erneut', ERROR: 'Unerwarteter Fehler, bitter versuchen Sie es erneut',

View File

@@ -31,7 +31,7 @@ const en: BaseTranslation = {
DEVICE_DETAILS: 'Device Details', DEVICE_DETAILS: 'Device Details',
BRAND: 'Brand', BRAND: 'Brand',
ENTITY_NAME: 'Entity Name', ENTITY_NAME: 'Entity Name',
VALUE: '{{Value}}', VALUE: '{{Value|value}}',
SHOW_FAV: 'only show favorites', SHOW_FAV: 'only show favorites',
DEVICE_SENSOR_DATA: 'Device and Sensor Data', DEVICE_SENSOR_DATA: 'Device and Sensor Data',
DEVICES_SENSORS: 'Devices & Sensors', DEVICES_SENSORS: 'Devices & Sensors',
@@ -203,7 +203,8 @@ const en: BaseTranslation = {
DOWNLOAD_CUSTOMIZATION_TEXT: 'Download the entity customizations', DOWNLOAD_CUSTOMIZATION_TEXT: 'Download the entity customizations',
DOWNLOAD_SETTINGS_TEXT: DOWNLOAD_SETTINGS_TEXT:
'Download the application settings. Be careful when sharing your settings as this file contains passwords and other sensitive system information', 'Download the application settings. Be careful when sharing your settings as this file contains passwords and other sensitive system information',
UPLOAD_TEXT: 'Upload a new firmware (.bin) file, settings or customizations (.json) file below, for optional validation upload (.md5) first', UPLOAD_TEXT:
'Upload a new firmware (.bin) file, settings or customizations (.json) file below, for optional validation upload (.md5) first',
UPLOADING: 'Uploading', UPLOADING: 'Uploading',
UPLOAD_DROP_TEXT: 'Drop file or click here', UPLOAD_DROP_TEXT: 'Drop file or click here',
ERROR: 'Unexpected Error, please try again', ERROR: 'Unexpected Error, please try again',

View File

@@ -31,7 +31,7 @@ const nl: Translation = {
DEVICE_DETAILS: 'Device Gegevens', DEVICE_DETAILS: 'Device Gegevens',
BRAND: 'Merk', BRAND: 'Merk',
ENTITY_NAME: 'Entiteit', ENTITY_NAME: 'Entiteit',
VALUE: 'Waarde', VALUE: '{{Waarde|waarde}}',
SHOW_FAV: 'alleen favorieten weergeven', SHOW_FAV: 'alleen favorieten weergeven',
DEVICE_SENSOR_DATA: 'Apparaat en Sensor data', DEVICE_SENSOR_DATA: 'Apparaat en Sensor data',
DEVICES_SENSORS: 'Apparaten & Sensoren', DEVICES_SENSORS: 'Apparaten & Sensoren',

View File

@@ -31,7 +31,7 @@ const no: Translation = {
DEVICE_DETAILS: 'Enhetsdetaljer', DEVICE_DETAILS: 'Enhetsdetaljer',
BRAND: 'Fabrikat', BRAND: 'Fabrikat',
ENTITY_NAME: 'Objektsnavn', ENTITY_NAME: 'Objektsnavn',
VALUE: 'Verdi', VALUE: '{{Verdi|verdi}}',
SHOW_FAV: ' Vis kun favoritter', SHOW_FAV: ' Vis kun favoritter',
DEVICE_SENSOR_DATA: 'Enheter og Sensordata', DEVICE_SENSOR_DATA: 'Enheter og Sensordata',
DEVICES_SENSORS: 'Enheter og Sensorer', DEVICES_SENSORS: 'Enheter og Sensorer',

View File

@@ -31,7 +31,7 @@ const se: Translation = {
DEVICE_DETAILS: 'Enhetsdetaljer', DEVICE_DETAILS: 'Enhetsdetaljer',
BRAND: 'Fabrikat', BRAND: 'Fabrikat',
ENTITY_NAME: 'Entitetsnamn', ENTITY_NAME: 'Entitetsnamn',
VALUE: 'Värde', VALUE: '{{Värde|värde}}',
SHOW_FAV: 'Visa enbart favoriter', SHOW_FAV: 'Visa enbart favoriter',
DEVICE_SENSOR_DATA: 'Enhets och Sensor-data', DEVICE_SENSOR_DATA: 'Enhets och Sensor-data',
DEVICES_SENSORS: 'Enheter & Sensorer', DEVICES_SENSORS: 'Enheter & Sensorer',

View File

@@ -318,10 +318,10 @@ const SettingsApplication: FC = () => {
<MenuItem value={0x0f}>Time Module (0x0F)</MenuItem> <MenuItem value={0x0f}>Time Module (0x0F)</MenuItem>
<MenuItem value={0x48}>Gateway 1 (0x48)</MenuItem> <MenuItem value={0x48}>Gateway 1 (0x48)</MenuItem>
<MenuItem value={0x49}>Gateway 2 (0x49)</MenuItem> <MenuItem value={0x49}>Gateway 2 (0x49)</MenuItem>
<MenuItem value={0x4A}>Gateway 3 (0x4A)</MenuItem> <MenuItem value={0x4a}>Gateway 3 (0x4A)</MenuItem>
<MenuItem value={0x4B}>Gateway 4 (0x4B)</MenuItem> <MenuItem value={0x4b}>Gateway 4 (0x4B)</MenuItem>
<MenuItem value={0x4C}>Gateway 5 (0x4C)</MenuItem> <MenuItem value={0x4c}>Gateway 5 (0x4C)</MenuItem>
<MenuItem value={0x4D}>Gateway 7 (0x4D)</MenuItem> <MenuItem value={0x4d}>Gateway 7 (0x4D)</MenuItem>
</ValidatedTextField> </ValidatedTextField>
</Grid> </Grid>
</Grid> </Grid>

View File

@@ -511,8 +511,8 @@ const SettingsCustomization: FC = () => {
</ToggleButtonGroup> </ToggleButtonGroup>
</Cell> </Cell>
<Cell>{formatName(de)}</Cell> <Cell>{formatName(de)}</Cell>
<Cell>{!(de.m & DeviceEntityMask.DV_READONLY) && (formatValue(de.mi))}</Cell> <Cell>{!(de.m & DeviceEntityMask.DV_READONLY) && formatValue(de.mi)}</Cell>
<Cell>{!(de.m & DeviceEntityMask.DV_READONLY) && (formatValue(de.ma))}</Cell> <Cell>{!(de.m & DeviceEntityMask.DV_READONLY) && formatValue(de.ma)}</Cell>
<Cell>{formatValue(de.v)}</Cell> <Cell>{formatValue(de.v)}</Cell>
</Row> </Row>
))} ))}

View File

@@ -25,8 +25,8 @@
#define EMSESP_DEFAULT_LOCALE EMSESP_LOCALE_EN // English #define EMSESP_DEFAULT_LOCALE EMSESP_LOCALE_EN // English
#else #else
// this is for debugging different languages in standalone version // this is for debugging different languages in standalone version
#define EMSESP_DEFAULT_LOCALE EMSESP_LOCALE_DE // German // #define EMSESP_DEFAULT_LOCALE EMSESP_LOCALE_DE // German
// #define EMSESP_DEFAULT_LOCALE EMSESP_LOCALE_EN // English #define EMSESP_DEFAULT_LOCALE EMSESP_LOCALE_EN // English
#endif #endif
#ifndef EMSESP_DEFAULT_TX_MODE #ifndef EMSESP_DEFAULT_TX_MODE

View File

@@ -1021,7 +1021,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
JsonObject node; JsonObject node;
// System // System
node = output.createNestedObject("System Status"); node = output.createNestedObject("System Info");
node["version"] = EMSESP_APP_VERSION; node["version"] = EMSESP_APP_VERSION;
node["platform"] = EMSESP_PLATFORM; node["platform"] = EMSESP_PLATFORM;
node["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3); node["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3);
@@ -1034,7 +1034,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
// Network Status // Network Status
node = output.createNestedObject("Network Status"); node = output.createNestedObject("Network Info");
if (WiFi.status() == WL_CONNECTED) { if (WiFi.status() == WL_CONNECTED) {
node["connection"] = "WiFi"; node["connection"] = "WiFi";
node["hostname"] = WiFi.getHostname(); node["hostname"] = WiFi.getHostname();
@@ -1082,9 +1082,9 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
#endif #endif
// NTP status // NTP status
node = output.createNestedObject("NTP Status"); node = output.createNestedObject("NTP Info");
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
node["network time"] = EMSESP::system_.ntp_connected() ? "connected" : "disconnected"; node["NTP status"] = EMSESP::system_.ntp_connected() ? "connected" : "disconnected";
EMSESP::esp8266React.getNTPSettingsService()->read([&](NTPSettings & settings) { EMSESP::esp8266React.getNTPSettingsService()->read([&](NTPSettings & settings) {
node["enabled"] = settings.enabled; node["enabled"] = settings.enabled;
node["server"] = settings.server; node["server"] = settings.server;
@@ -1093,7 +1093,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
}); });
// OTA status // OTA status
node = output.createNestedObject("OTA Status"); node = output.createNestedObject("OTA Info");
EMSESP::esp8266React.getOTASettingsService()->read([&](OTASettings & settings) { EMSESP::esp8266React.getOTASettingsService()->read([&](OTASettings & settings) {
node["enabled"] = settings.enabled; node["enabled"] = settings.enabled;
node["port"] = settings.port; node["port"] = settings.port;
@@ -1101,7 +1101,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
#endif #endif
// MQTT Status // MQTT Status
node = output.createNestedObject("MQTT Status"); node = output.createNestedObject("MQTT Info");
node["MQTT status"] = Mqtt::connected() ? F_(connected) : F_(disconnected); node["MQTT status"] = Mqtt::connected() ? F_(connected) : F_(disconnected);
if (Mqtt::enabled()) { if (Mqtt::enabled()) {
node["MQTT publishes"] = Mqtt::publish_count(); node["MQTT publishes"] = Mqtt::publish_count();
@@ -1132,7 +1132,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
}); });
// Syslog Status // Syslog Status
node = output.createNestedObject("Syslog Status"); node = output.createNestedObject("Syslog Info");
node["enabled"] = EMSESP::system_.syslog_enabled_; node["enabled"] = EMSESP::system_.syslog_enabled_;
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
if (EMSESP::system_.syslog_enabled_) { if (EMSESP::system_.syslog_enabled_) {
@@ -1144,7 +1144,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
#endif #endif
// Sensor Status // Sensor Status
node = output.createNestedObject("Sensor Status"); node = output.createNestedObject("Sensor Info");
if (EMSESP::dallas_enabled()) { if (EMSESP::dallas_enabled()) {
node["temperature sensors"] = EMSESP::dallassensor_.no_sensors(); node["temperature sensors"] = EMSESP::dallassensor_.no_sensors();
node["temperature sensor reads"] = EMSESP::dallassensor_.reads(); node["temperature sensor reads"] = EMSESP::dallassensor_.reads();
@@ -1157,12 +1157,12 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
} }
// API Status // API Status
node = output.createNestedObject("API Status"); node = output.createNestedObject("API Info");
node["API calls"] = WebAPIService::api_count(); node["API calls"] = WebAPIService::api_count();
node["API fails"] = WebAPIService::api_fails(); node["API fails"] = WebAPIService::api_fails();
// EMS Bus Status // EMS Bus Status
node = output.createNestedObject("Bus Status"); node = output.createNestedObject("Bus Info");
switch (EMSESP::bus_status()) { switch (EMSESP::bus_status()) {
case EMSESP::BUS_STATUS_OFFLINE: case EMSESP::BUS_STATUS_OFFLINE:
node["bus status"] = "disconnected"; node["bus status"] = "disconnected";
@@ -1219,7 +1219,8 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
node["telnet enabled"] = settings.telnet_enabled; node["telnet enabled"] = settings.telnet_enabled;
}); });
// Devices - show EMS devices // Devices - show EMS devices if we have any
if (!EMSESP::emsdevices.empty()) {
JsonArray devices = output.createNestedArray("Devices"); JsonArray devices = output.createNestedArray("Devices");
for (const auto & device_class : EMSFactory::device_handlers()) { for (const auto & device_class : EMSFactory::device_handlers()) {
for (const auto & emsdevice : EMSESP::emsdevices) { for (const auto & emsdevice : EMSESP::emsdevices) {
@@ -1251,6 +1252,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
} }
} }
} }
}
return true; return true;
} }

View File

@@ -1339,6 +1339,10 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
uart_telegram({0x90, 0x00, 0xFF, 0x00, 0x00, 0x70, 0x02, 0x01, 0x00, 0xCE, 0x00, 0xE5}); uart_telegram({0x90, 0x00, 0xFF, 0x00, 0x00, 0x70, 0x02, 0x01, 0x00, 0xCE, 0x00, 0xE5});
uart_telegram({0x90, 0x00, 0xFF, 0x00, 0x00, 0x71, 0x01, 0x02, 0x00, 0xCF, 0x00, 0xE6}); uart_telegram({0x90, 0x00, 0xFF, 0x00, 0x00, 0x71, 0x01, 0x02, 0x00, 0xCF, 0x00, 0xE6});
// add room sensor - test for https://github.com/emsesp/EMS-ESP32/issues/699
// use auto
uart_telegram("90 00 FF 00 00 65 01 00 02 19 3D 42 02 01 00 03 FF 28 06 01 02 20 27 29 01 01 00");
shell.invoke_command("help"); shell.invoke_command("help");
shell.invoke_command("call"); shell.invoke_command("call");
shell.invoke_command("call system info"); shell.invoke_command("call system info");

View File

@@ -226,6 +226,7 @@ void WebStatusService::mDNS_start() const {
} }
const char * WebStatusService::disconnectReason(uint8_t code) { const char * WebStatusService::disconnectReason(uint8_t code) {
#ifndef EMSESP_STANDALONE
switch (code) { switch (code) {
case WIFI_REASON_UNSPECIFIED: // = 1, case WIFI_REASON_UNSPECIFIED: // = 1,
return "unspecifiied"; return "unspecifiied";
@@ -286,6 +287,8 @@ const char * WebStatusService::disconnectReason(uint8_t code) {
default: default:
return "unknown"; return "unknown";
} }
#endif
return ""; return "";
} }