mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 16:49:11 +03:00
Merge branch 'dev' of https://github.com/proddy/EMS-ESP32 into dev
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
"react": "^19.2.3",
|
||||
"react-dom": "^19.2.3",
|
||||
"react-icons": "^5.5.0",
|
||||
"react-router": "^7.10.1",
|
||||
"react-router": "^7.11.0",
|
||||
"react-toastify": "^11.0.5",
|
||||
"typesafe-i18n": "^5.26.2",
|
||||
"typescript": "^5.9.3"
|
||||
|
||||
18
interface/pnpm-lock.yaml
generated
18
interface/pnpm-lock.yaml
generated
@@ -63,8 +63,8 @@ importers:
|
||||
specifier: ^5.5.0
|
||||
version: 5.5.0(react@19.2.3)
|
||||
react-router:
|
||||
specifier: ^7.10.1
|
||||
version: 7.10.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
||||
specifier: ^7.11.0
|
||||
version: 7.11.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
||||
react-toastify:
|
||||
specifier: ^11.0.5
|
||||
version: 11.0.5(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
|
||||
@@ -1027,8 +1027,8 @@ packages:
|
||||
base64-js@1.5.1:
|
||||
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||
|
||||
baseline-browser-mapping@2.9.8:
|
||||
resolution: {integrity: sha512-Y1fOuNDowLfgKOypdc9SPABfoWXuZHBOyCS4cD52IeZBhr4Md6CLLs6atcxVrzRmQ06E7hSlm5bHHApPKR/byA==}
|
||||
baseline-browser-mapping@2.9.9:
|
||||
resolution: {integrity: sha512-V8fbOCSeOFvlDj7LLChUcqbZrdKD9RU/VR260piF1790vT0mfLSwGc/Qzxv3IqiTukOpNtItePa0HBpMAj7MDg==}
|
||||
hasBin: true
|
||||
|
||||
bin-build@3.0.0:
|
||||
@@ -2525,8 +2525,8 @@ packages:
|
||||
react-is@19.2.3:
|
||||
resolution: {integrity: sha512-qJNJfu81ByyabuG7hPFEbXqNcWSU3+eVus+KJs+0ncpGfMyYdvSmxiJxbWR65lYi1I+/0HBcliO029gc4F+PnA==}
|
||||
|
||||
react-router@7.10.1:
|
||||
resolution: {integrity: sha512-gHL89dRa3kwlUYtRQ+m8NmxGI6CgqN+k4XyGjwcFoQwwCWF6xXpOCUlDovkXClS0d0XJN/5q7kc5W3kiFEd0Yw==}
|
||||
react-router@7.11.0:
|
||||
resolution: {integrity: sha512-uI4JkMmjbWCZc01WVP2cH7ZfSzH91JAZUDd7/nIprDgWxBV1TkkmLToFh7EbMTcMak8URFRa2YoBL/W8GWnCTQ==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
peerDependencies:
|
||||
react: '>=18'
|
||||
@@ -3958,7 +3958,7 @@ snapshots:
|
||||
|
||||
base64-js@1.5.1: {}
|
||||
|
||||
baseline-browser-mapping@2.9.8: {}
|
||||
baseline-browser-mapping@2.9.9: {}
|
||||
|
||||
bin-build@3.0.0:
|
||||
dependencies:
|
||||
@@ -4015,7 +4015,7 @@ snapshots:
|
||||
|
||||
browserslist@4.28.1:
|
||||
dependencies:
|
||||
baseline-browser-mapping: 2.9.8
|
||||
baseline-browser-mapping: 2.9.9
|
||||
caniuse-lite: 1.0.30001760
|
||||
electron-to-chromium: 1.5.267
|
||||
node-releases: 2.0.27
|
||||
@@ -5525,7 +5525,7 @@ snapshots:
|
||||
|
||||
react-is@19.2.3: {}
|
||||
|
||||
react-router@7.10.1(react-dom@19.2.3(react@19.2.3))(react@19.2.3):
|
||||
react-router@7.11.0(react-dom@19.2.3(react@19.2.3))(react@19.2.3):
|
||||
dependencies:
|
||||
cookie: 1.1.1
|
||||
react: 19.2.3
|
||||
|
||||
@@ -108,16 +108,18 @@ const SensorsAnalogDialog = ({
|
||||
// Memoize menu items to avoid recreation on each render
|
||||
const analogTypeMenuItems = useMemo(
|
||||
() =>
|
||||
AnalogTypeNames.map((val, i) => (
|
||||
<MenuItem
|
||||
key={val}
|
||||
value={i + 1}
|
||||
disabled={disabledTypeList.includes(i + 1)}
|
||||
>
|
||||
{val}
|
||||
</MenuItem>
|
||||
)),
|
||||
[]
|
||||
AnalogTypeNames.map((val, i) => ({ name: val, value: i + 1 }))
|
||||
.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.map(({ name, value }) => (
|
||||
<MenuItem
|
||||
key={name}
|
||||
value={value}
|
||||
disabled={disabledTypeList?.includes(value)}
|
||||
>
|
||||
{name}
|
||||
</MenuItem>
|
||||
)),
|
||||
[disabledTypeList]
|
||||
);
|
||||
|
||||
const uomMenuItems = useMemo(
|
||||
|
||||
@@ -262,7 +262,7 @@ export const AnalogTypeNames = [
|
||||
'PWM 0', // 7
|
||||
'PWM 1', // 8
|
||||
'PWM 2', // 9
|
||||
'NTC Temp.', // 10
|
||||
'NTC Temp', // 10
|
||||
'RGB Led', // 11
|
||||
'Pulse', // 12
|
||||
'Freq 0', // 13
|
||||
@@ -270,7 +270,7 @@ export const AnalogTypeNames = [
|
||||
'Freq 2', // 15
|
||||
'Counter 0', // 16
|
||||
'Counter 1', // 17
|
||||
'Counter2' // 18
|
||||
'Counter 2' // 18
|
||||
] as const;
|
||||
|
||||
export const BOARD_PROFILES = {
|
||||
|
||||
@@ -2,9 +2,7 @@ import { useMemo } from 'react';
|
||||
|
||||
import { MenuItem } from '@mui/material';
|
||||
|
||||
type TimeZones = Record<string, string>;
|
||||
|
||||
export const TIME_ZONES: Readonly<TimeZones> = {
|
||||
export const TIME_ZONES: Record<string, string> = {
|
||||
'Africa/Abidjan': 'GMT0',
|
||||
'Africa/Accra': 'GMT0',
|
||||
'Africa/Addis_Ababa': 'EAT-3',
|
||||
|
||||
@@ -1048,7 +1048,9 @@ const emsesp_sensordata = {
|
||||
}
|
||||
],
|
||||
analog_enabled: true,
|
||||
available_gpios: [] as number[]
|
||||
available_gpios: [] as number[],
|
||||
exclude_types: [] as number[],
|
||||
platform: 'ESP32'
|
||||
};
|
||||
|
||||
const activity = {
|
||||
|
||||
@@ -1451,7 +1451,7 @@ void Mqtt::add_ha_dev_section(JsonObject doc, const char * name, const char * mo
|
||||
// create dev section
|
||||
JsonObject dev_json = doc["dev"].to<JsonObject>();
|
||||
|
||||
// add ids and name - with capitalize first letter
|
||||
// add ids and name - capitalize first letter of the name
|
||||
JsonArray ids = dev_json["ids"].to<JsonArray>(); // ids, it is an array with a single element
|
||||
if (name != nullptr) {
|
||||
// for ids, replace all spaces with -
|
||||
@@ -1464,8 +1464,7 @@ void Mqtt::add_ha_dev_section(JsonObject doc, const char * name, const char * mo
|
||||
dev_json["name"] = Mqtt::basename() + " " + cap_name;
|
||||
free(cap_name);
|
||||
} else {
|
||||
ids.add(Mqtt::basename());
|
||||
dev_json["name"] = Mqtt::basename();
|
||||
ids.add(Mqtt::basename()); // no name, assign it to the main EMS-ESP device in HA
|
||||
}
|
||||
|
||||
// create the model, manufacturer and version
|
||||
|
||||
Reference in New Issue
Block a user