Skip to content

Commit

Permalink
Merge pull request #1537 from proddy/dev
Browse files Browse the repository at this point in the history
fixes #1360 (domoticz) and #1528 (HA dev name)
  • Loading branch information
proddy committed Jan 4, 2024
2 parents 0fce450 + df33a24 commit 13a915e
Show file tree
Hide file tree
Showing 28 changed files with 467 additions and 309 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG_LATEST.md
Expand Up @@ -10,14 +10,17 @@
- heatpump energy meters [#1463](https://github.com/emsesp/EMS-ESP32/issues/1463)
- heatpump max power [#1475](https://github.com/emsesp/EMS-ESP32/issues/1475)
- checkbox for MQTT-TLS enable [#1474](https://github.com/emsesp/EMS-ESP32/issues/1474)
- added SK (Slovencina) language. Thanks @misa1515
- added SK (Slovenian) language. Thanks @misa1515
- CPU info [#1497](https://github.com/emsesp/EMS-ESP32/pull/1497)
- Show network hostname in Web UI under Network Status

## Fixed

- exhaust temperature for some boilers
- add back boil2hyst [#1477](https://github.com/emsesp/EMS-ESP32/issues/1477)
- subscribed MQTT topics not detecting changes by EMS-ESP [#1494](https://github.com/emsesp/EMS-ESP32/issues/1494)
- changed HA name and grouping to be consistent [#1528](https://github.com/emsesp/EMS-ESP32/issues/1528)
- MQTT autodiscovery in Domoticz not working [#1360](https://github.com/emsesp/EMS-ESP32/issues/1528)

## Changed

Expand Down
18 changes: 9 additions & 9 deletions interface/package.json
Expand Up @@ -21,16 +21,16 @@
},
"dependencies": {
"@alova/adapter-xhr": "^1.0.2",
"@babel/core": "^7.23.6",
"@babel/core": "^7.23.7",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.2",
"@mui/material": "^5.15.2",
"@mui/icons-material": "^5.15.3",
"@mui/material": "^5.15.3",
"@table-library/react-table-library": "4.1.7",
"@types/imagemin": "^8.0.5",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.10.5",
"@types/react": "^18.2.45",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react-dom": "^18.2.18",
"@types/react-router-dom": "^5.3.3",
"alova": "^2.16.2",
Expand All @@ -51,9 +51,9 @@
},
"devDependencies": {
"@preact/compat": "^17.1.2",
"@preact/preset-vite": "^2.7.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"@preact/preset-vite": "^2.8.1",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"concurrently": "^8.2.2",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
Expand All @@ -72,7 +72,7 @@
"terser": "^5.26.0",
"vite": "^5.0.10",
"vite-plugin-imagemin": "^0.6.1",
"vite-tsconfig-paths": "^4.2.2"
"vite-tsconfig-paths": "^4.2.3"
},
"packageManager": "yarn@4.0.2"
}
1 change: 1 addition & 0 deletions interface/src/framework/mqtt/MqttSettingsForm.tsx
Expand Up @@ -273,6 +273,7 @@ const MqttSettingsForm: FC = () => {
>
<MenuItem value={0}>Home Assistant</MenuItem>
<MenuItem value={1}>Domoticz</MenuItem>
<MenuItem value={2}>Domoticz (latest)</MenuItem>
</TextField>
</Grid>
<Grid item xs={12} sm={6} md={4}>
Expand Down
10 changes: 10 additions & 0 deletions interface/src/framework/network/NetworkStatusForm.tsx
@@ -1,5 +1,6 @@
import DeviceHubIcon from '@mui/icons-material/DeviceHub';
import DnsIcon from '@mui/icons-material/Dns';
import GiteIcon from '@mui/icons-material/Gite';
import RefreshIcon from '@mui/icons-material/Refresh';
import RouterIcon from '@mui/icons-material/Router';
import SettingsInputAntennaIcon from '@mui/icons-material/SettingsInputAntenna';
Expand Down Expand Up @@ -115,6 +116,15 @@ const NetworkStatusForm: FC = () => {
<ListItemText primary="Status" secondary={networkStatus(data)} />
</ListItem>
<Divider variant="inset" component="li" />
<ListItem>
<ListItemAvatar>
<Avatar sx={{ bgcolor: networkStatusHighlight(data, theme) }}>
<GiteIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary="Hostname" secondary={data.hostname} />
</ListItem>
<Divider variant="inset" component="li" />
{isWiFi(data) && (
<>
<ListItem>
Expand Down
1 change: 1 addition & 0 deletions interface/src/framework/system/UploadFileForm.tsx
Expand Up @@ -136,6 +136,7 @@ const UploadFileForm: FC = () => {
<Typography variant="body2">
{LL.UPLOAD_TEXT()}
<br />
<br />
{LL.RESTART_TEXT(1)}.
</Typography>
</Box>
Expand Down
2 changes: 1 addition & 1 deletion interface/src/project/DashboardDevices.tsx
Expand Up @@ -420,7 +420,7 @@ const DashboardDevices: FC = () => {
<MessageBox my={2} level="warning" message={LL.EMS_BUS_SCANNING()} />
)}

{coreData.connected && (
{coreData.devices.length !== 0 && (
<Table data={{ nodes: coreData.devices }} select={device_select} theme={device_theme} layout={{ custom: true }}>
{(tableList: any) => (
<>
Expand Down
4 changes: 2 additions & 2 deletions interface/src/project/api.ts
Expand Up @@ -20,7 +20,7 @@ export const readCoreData = () => alovaInstance.Get<CoreData>(`/rest/coreData`);
export const readDeviceData = (id: number) =>
alovaInstance.Get<DeviceData>('/rest/deviceData', {
// alovaInstance.Get<DeviceData>(`/rest/deviceData/${id}`, {
params: { id }, // TODO remove later
params: { id }, // TODO replace later
responseType: 'arraybuffer' // uses msgpack
});
export const writeDeviceValue = (data: any) => alovaInstance.Post('/rest/writeDeviceValue', data);
Expand Down Expand Up @@ -56,7 +56,7 @@ export const getSchedule = () => alovaInstance.Get('/rest/getSchedule');
export const readDeviceEntities = (id: number) =>
// alovaInstance.Get<DeviceEntity[]>(`/rest/deviceEntities/${id}`, {
alovaInstance.Get<DeviceEntity[]>(`/rest/deviceEntities`, {
params: { id }, // TODO remove later
params: { id }, // TODO replace later
responseType: 'arraybuffer',
transformData(data: any) {
return data.map((de: DeviceEntity) => ({ ...de, o_m: de.m, o_cn: de.cn, o_mi: de.mi, o_ma: de.ma }));
Expand Down
1 change: 1 addition & 0 deletions interface/src/types/network.ts
Expand Up @@ -33,6 +33,7 @@ export interface NetworkStatus {
gateway_ip: string;
dns_ip_1: string;
dns_ip_2: string;
hostname: string;
}

export interface NetworkSettings {
Expand Down
17 changes: 16 additions & 1 deletion interface/vite.config.ts
@@ -1,4 +1,4 @@
import { defineConfig } from 'vite';
import { defineConfig, splitVendorChunkPlugin } from 'vite';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import preact from '@preact/preset-vite';
import viteImagemin from 'vite-plugin-imagemin';
Expand Down Expand Up @@ -44,6 +44,7 @@ export default defineConfig(({ command, mode }) => {
plugins: [
preact(),
viteTsconfigPaths(),
splitVendorChunkPlugin(),
{
...viteImagemin({
verbose: false,
Expand Down Expand Up @@ -112,6 +113,20 @@ export default defineConfig(({ command, mode }) => {
nameCache: null,
safari10: false,
toplevel: false
},

rollupOptions: {
output: {
manualChunks(id: string) {
if (id.includes('node_modules')) {
// creating a chunk to react routes deps. Reducing the vendor chunk size
if (id.includes('react-router-dom') || id.includes('@remix-run') || id.includes('react-router')) {
return '@react-router';
}
return 'vendor';
}
}
}
}
}
};
Expand Down

0 comments on commit 13a915e

Please sign in to comment.