Skip to content

Commit

Permalink
Merge pull request emsesp#2398 from proddy/dev
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
proddy authored Feb 8, 2025
2 parents 799076d + be23422 commit ba29aa6
Show file tree
Hide file tree
Showing 22 changed files with 375 additions and 331 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ C = $(words $N)$(eval N := x $N)
ECHO = python3 $(I)/echo_progress.py --stepno=$C --nsteps=$T
endif

# number of parallel compiles
# determine number of parallel compiles based on OS
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CFLAGS += -D LINUX
EXTRA_CPPFLAGS = -D LINUX
JOBS ?= $(shell nproc)
endif
ifeq ($(UNAME_S),Darwin)
CFLAGS += -D OSX
EXTRA_CPPFLAGS = -D OSX -Wno-tautological-constant-out-of-range-compare
JOBS ?= $(shell sysctl -n hw.ncpu)
endif
MAKEFLAGS += -j $(JOBS) -l $(JOBS)

# $(info Number of jobs: $(JOBS))

#----------------------------------------------------------------------
# Project Structure
#----------------------------------------------------------------------
Expand Down Expand Up @@ -103,7 +105,8 @@ CPPFLAGS += -Wall -Wextra -Werror
CPPFLAGS += -Wswitch-enum
CPPFLAGS += -Wno-unused-parameter
CPPFLAGS += -Wno-missing-braces
# CPPFLAGS += -Wno-tautological-constant-out-of-range-compare

CPPFLAGS += $(EXTRA_CPPFLAGS)

CFLAGS += $(CPPFLAGS)
CXXFLAGS += $(CPPFLAGS)
Expand Down
4 changes: 3 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"Makefile",
"**/*.ini",
"**/*.json",
"src/core/modbus_entity_parameters.hpp"
"src/core/modbus_entity_parameters.hpp",
"sdkconfig.*",
"managed_components/**"
]
}
10 changes: 5 additions & 5 deletions docs/dump_telegrams.csv
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ telegram_type_id,name,is_fetched
0x3B,Energy,
0x3D,RC35Set,
0x3E,RC35Monitor,
0x3F,RC35Timer,
0x3F,RC30Timer,
0x40,RC30Temp,
0x41,RC30Monitor,
0x42,RC35Timer2,
Expand Down Expand Up @@ -101,18 +101,18 @@ telegram_type_id,name,is_fetched
0x0292,HPMode,fetched
0x0293,HPMode,fetched
0x0294,HPMode,fetched
0x029B,RC300Curves,
0x029B,RC300Curves,fetched
0x029C,RC300Curves,
0x029D,RC300Curves,
0x029E,RC300Curves,
0x029F,RC300Curves,
0x02A0,RC300Curves,
0x02A1,RC300Curves,
0x02A2,RC300Curves,
0x02A5,RC300Monitor,
0x02A5,RC300Monitor,fetched
0x02A6,RC300Monitor,
0x02A7,RC300Monitor,
0x02A8,CRFMonitor,
0x02A7,CRFMonitor,
0x02A8,RC300Monitor,
0x02A9,RC300Monitor,
0x02AA,RC300Monitor,
0x02AB,RC300Monitor,
Expand Down
16 changes: 8 additions & 8 deletions interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"@alova/adapter-xhr": "2.1.1",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@mui/icons-material": "^6.4.2",
"@mui/material": "^6.4.2",
"@mui/icons-material": "^6.4.3",
"@mui/material": "^6.4.3",
"@table-library/react-table-library": "4.1.7",
"alova": "3.2.8",
"async-validator": "^4.2.5",
Expand All @@ -41,24 +41,24 @@
"typescript": "^5.7.3"
},
"devDependencies": {
"@babel/core": "^7.26.7",
"@eslint/js": "^9.19.0",
"@babel/core": "^7.26.8",
"@eslint/js": "^9.20.0",
"@preact/compat": "^18.3.1",
"@preact/preset-vite": "^2.10.1",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/formidable": "^3",
"@types/node": "^22.13.0",
"@types/node": "^22.13.1",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"concurrently": "^9.1.2",
"eslint": "^9.19.0",
"eslint": "^9.20.0",
"eslint-config-prettier": "^10.0.1",
"formidable": "^3.5.2",
"prettier": "^3.4.2",
"rollup-plugin-visualizer": "^5.14.0",
"terser": "^5.37.0",
"terser": "^5.38.1",
"typescript-eslint": "8.23.0",
"vite": "^6.0.11",
"vite": "^6.1.0",
"vite-plugin-imagemin": "^0.6.1",
"vite-tsconfig-paths": "^5.1.4"
},
Expand Down
14 changes: 10 additions & 4 deletions interface/src/api/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ export const fetchLogES = () => alovaInstance.Get('/es/log');
// Get versions from GitHub
export const getStableVersion = () =>
alovaInstanceGH.Get('latest', {
transform(response: { data: { name: string } }) {
return response.data.name.substring(1);
transform(response: { data: { name: string; published_at: string } }) {
return {
name: response.data.name.substring(1),
published_at: response.data.published_at
};
}
});
export const getDevVersion = () =>
alovaInstanceGH.Get('tags/latest', {
transform(response: { data: { name: string } }) {
return response.data.name.split(/\s+/).splice(-1)[0].substring(1);
transform(response: { data: { name: string; published_at: string } }) {
return {
name: response.data.name.split(/\s+/).splice(-1)[0].substring(1),
published_at: response.data.published_at
};
}
});

Expand Down
98 changes: 56 additions & 42 deletions interface/src/app/settings/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const Version = () => {

useEffect(() => {
if (latestVersion && latestDevVersion) {
sendCheckUpgrade(latestDevVersion + ',' + latestVersion)
sendCheckUpgrade(latestDevVersion.name + ',' + latestVersion.name)
.catch((error: Error) => {
toast.error('Failed to check for upgrades: ' + error.message);
})
Expand All @@ -96,13 +96,16 @@ const Version = () => {
}
const filename =
'EMS-ESP-' +
(usingDevVersion ? latestDevVersion : latestVersion).replaceAll('.', '_') +
(usingDevVersion ? latestDevVersion.name : latestVersion.name).replaceAll(
'.',
'_'
) +
'-' +
getPlatform() +
'.bin';
return usingDevVersion
? DEV_URL + filename
: STABLE_URL + 'v' + latestVersion + '/' + filename;
: STABLE_URL + 'v' + latestVersion.name + '/' + filename;
};

const getPlatform = () => {
Expand Down Expand Up @@ -224,7 +227,7 @@ const Version = () => {
<>
<Box p={2} border="1px solid grey" borderRadius={2}>
<Typography mb={2} variant="h6" color="primary">
{LL.FIRMWARE_VERSION()}
{LL.THIS_VERSION()}
</Typography>

<Grid
Expand Down Expand Up @@ -274,46 +277,58 @@ const Version = () => {
</Grid>
</Grid>

<Typography mt={2} mb={2} variant="h6" color="primary">
{LL.AVAILABLE_VERSION()}
</Typography>

<Grid
container
direction="row"
rowSpacing={1}
sx={{
justifyContent: 'flex-start',
alignItems: 'baseline'
}}
>
<Grid size={{ xs: 4, md: 2 }}>
<Typography color="secondary">{LL.STABLE()}</Typography>
</Grid>
<Grid size={{ xs: 8, md: 10 }}>
<Typography>
<Link target="_blank" href={STABLE_RELNOTES_URL} color="primary">
{latestVersion}
</Link>
&nbsp;&nbsp;{!usingDevVersion && showButtons()}
{internetLive ? (
<>
<Typography mt={2} mb={2} variant="h6" color="primary">
{LL.AVAILABLE_VERSION()}
</Typography>
</Grid>

<Grid size={{ xs: 4, md: 2 }}>
<Typography color="secondary">{LL.DEVELOPMENT()}</Typography>
</Grid>
<Grid size={{ xs: 8, md: 10 }}>
<Typography>
<Link target="_blank" href={DEV_RELNOTES_URL} color="primary">
{latestDevVersion}
</Link>
&nbsp;&nbsp;{usingDevVersion && showButtons()}
</Typography>
</Grid>
</Grid>
<Grid
container
direction="row"
rowSpacing={1}
sx={{
justifyContent: 'flex-start',
alignItems: 'baseline'
}}
>
<Grid size={{ xs: 4, md: 2 }}>
<Typography color="secondary">{LL.STABLE()}</Typography>
</Grid>
<Grid size={{ xs: 8, md: 10 }}>
<Typography>
<Link target="_blank" href={STABLE_RELNOTES_URL} color="primary">
{latestVersion.name}
</Link>
{latestVersion.published_at && (
<Typography component="span" variant="caption">
&nbsp;(
{Math.floor((Date.now() - new Date(latestVersion.published_at).getTime()) / (1000 * 60 * 60 * 24))} days ago)
</Typography>
)}
&nbsp;&nbsp;{!usingDevVersion && showButtons()}
</Typography>
</Grid>

<Grid size={{ xs: 4, md: 2 }}>
<Typography color="secondary">{LL.DEVELOPMENT()}</Typography>
</Grid>
<Grid size={{ xs: 8, md: 10 }}>
<Typography>
<Link target="_blank" href={DEV_RELNOTES_URL} color="primary">
{latestDevVersion.name}
</Link>
{latestDevVersion.published_at && (
<Typography component="span" variant="caption">
&nbsp;(
{Math.floor((Date.now() - new Date(latestDevVersion.published_at).getTime()) / (1000 * 60 * 60 * 24))} days ago)
</Typography>
)}
&nbsp;&nbsp;{usingDevVersion && showButtons()}
</Typography>
</Grid>
</Grid>

{internetLive ? (
<>
{upgradeAvailable ? (
<Typography mt={2} color="warning">
<InfoOutlinedIcon
Expand Down Expand Up @@ -352,7 +367,6 @@ const Version = () => {
no access to download site
</Typography>
)}

{renderInstallDialog()}
</Box>
</>
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/cz/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const cz: Translation = {
NO_DATA_1: 'No favourite EMS entities found yet. Use the', // TODO translate
NO_DATA_2: 'module to mark them.', // TODO translate
NO_DATA_3: 'To see all available entities go to', // TODO translate
FIRMWARE_VERSION: 'Firmware Version', // TODO translate
THIS_VERSION: 'This Version', // TODO translate
PLATFORM: 'Platform', // TODO translate
RELEASE_TYPE: 'Release Type', // TODO translate
REINSTALL: 'Re-install' // TODO translate
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/de/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const de: Translation = {
NO_DATA_1: 'Keine favorisierten EMS-Entitäten gefunden! Verwenden Sie das Modul',
NO_DATA_2: ', um sie zu markieren.',
NO_DATA_3: 'Um alle verfügbaren Entitäten anzuzeigen, gehen Sie zu',
FIRMWARE_VERSION: 'Firmware Version',
THIS_VERSION: 'This Version',
PLATFORM: 'Plattform',
RELEASE_TYPE: 'Release Typ',
REINSTALL: 'Neu installieren'
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const en: Translation = {
NO_DATA_1: 'No favourite EMS entities found yet. Use the',
NO_DATA_2: 'module to mark them.',
NO_DATA_3: 'To see all available entities go to',
FIRMWARE_VERSION: 'Firmware Version',
THIS_VERSION: 'This Version',
PLATFORM: 'Platform',
RELEASE_TYPE: 'Release Type',
REINSTALL: 'Re-install'
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const fr: Translation = {
NO_DATA_1: 'No favourite EMS entities found yet. Use the', // TODO translate
NO_DATA_2: 'module to mark them.', // TODO translate
NO_DATA_3: 'To see all available entities go to', // TODO translate
FIRMWARE_VERSION: 'Firmaware Version', // TODO translate
THIS_VERSION: 'This Version', // TODO translate
PLATFORM: 'Platform', // TODO translate
RELEASE_TYPE: 'Release Type', // TODO translate
REINSTALL: 'Re-install' // TODO translate
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/it/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const it: Translation = {
NO_DATA_1: 'No favourite EMS entities found yet. Use the', // TODO translate
NO_DATA_2: 'module to mark them.', // TODO translate
NO_DATA_3: 'To see all available entities go to', // TODO translate
FIRMWARE_VERSION: 'Firmware Version', // TODO translate
THIS_VERSION: 'This Version', // TODO translate
PLATFORM: 'Platform', // TODO translate
RELEASE_TYPE: 'Release Type', // TODO translate
REINSTALL: 'Re-install' // TODO translate
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/nl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const nl: Translation = {
NO_DATA_1: 'Er zijn nog geen favoriete EMS-entiteiten gevonden. Gebruik de',
NO_DATA_2: 'module om ze te markeren.',
NO_DATA_3: 'Om alle beschikbare entiteiten te zien, ga naar',
FIRMWARE_VERSION: 'Firmware Versie',
THIS_VERSION: 'Deze Versie',
PLATFORM: 'Platform',
RELEASE_TYPE: 'Release Typ',
REINSTALL: 'Opnieuw Installeren'
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/no/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const no: Translation = {
NO_DATA_1: 'No favourite EMS entities found yet. Use the', // TODO translate
NO_DATA_2: 'module to mark them.', // TODO translate
NO_DATA_3: 'To see all available entities go to', // TODO translate
FIRMWARE_VERSION: 'Firmware Version', // TODO translate
THIS_VERSION: 'This Version', // TODO translate
PLATFORM: 'Platform', // TODO translate
RELEASE_TYPE: 'Release Type', // TODO translate
REINSTALL: 'Re-install' // TODO translate
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/pl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const pl: BaseTranslation = {
NO_DATA_1: 'No favourite EMS entities found yet. Use the', // TODO translate
NO_DATA_2: 'module to mark them.', // TODO translate
NO_DATA_3: 'To see all available entities go to', // TODO translate
FIRMWARE_VERSION: 'Firmware Version', // TODO translate
THIS_VERSION: 'This Version', // TODO translate
PLATFORM: 'Platform', // TODO translate
RELEASE_TYPE: 'Release Type', // TODO translate
REINSTALL: 'Re-install' // TODO translate
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/sk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const sk: Translation = {
NO_DATA_1: 'Nenašli sa žiadne obľúbené entity EMS. Použite',
NO_DATA_2: 'modul na ich označenie.',
NO_DATA_3: 'Ak chcete zobraziť všetky dostupné entity, prejdite na',
FIRMWARE_VERSION: 'Verzia firmware',
THIS_VERSION: 'This Version', // TODO translate
PLATFORM: 'Platforma',
RELEASE_TYPE: 'Typ vydania',
REINSTALL: 'Preinštalovať'
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/sv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const sv: Translation = {
NO_DATA_1: 'No favourite EMS entities found yet. Use the', // TODO translate
NO_DATA_2: 'module to mark them.', // TODO translate
NO_DATA_3: 'To see all available entities go to', // TODO translate
FIRMWARE_VERSION: 'Firmware Version', // TODO translate
THIS_VERSION: 'This Version', // TODO translate
PLATFORM: 'Platform', // TODO translate
RELEASE_TYPE: 'Release Type', // TODO translate
REINSTALL: 'Re-install' // TODO translate
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/tr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ const tr: Translation = {
NO_DATA_1: 'No favourite EMS entities found yet. Use the', // TODO translate
NO_DATA_2: 'module to mark them.', // TODO translate
NO_DATA_3: 'To see all available entities go to', // TODO translate
FIRMWARE_VERSION: 'Firmware Version', // TODO translate
THIS_VERSION: 'This Version', // TODO translate
PLATFORM: 'Platform', // TODO translate
RELEASE_TYPE: 'Release Type', // TODO translate
REINSTALL: 'Re-install' // TODO translate
Expand Down
Loading

0 comments on commit ba29aa6

Please sign in to comment.