mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
Polish translation update #1156
This commit is contained in:
@@ -1,21 +1,15 @@
|
|||||||
import { FC } from 'react';
|
import DownloadIcon from '@mui/icons-material/GetApp';
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
|
|
||||||
import { Typography, Button, Box } from '@mui/material';
|
import { Typography, Button, Box } from '@mui/material';
|
||||||
|
import { toast } from 'react-toastify';
|
||||||
import { FileUploadConfig } from 'api/endpoints';
|
import type { FileUploadConfig } from 'api/endpoints';
|
||||||
|
import type { AxiosPromise } from 'axios';
|
||||||
|
import type { FC } from 'react';
|
||||||
|
|
||||||
import { SingleUpload, useFileUpload } from 'components';
|
import { SingleUpload, useFileUpload } from 'components';
|
||||||
|
|
||||||
import DownloadIcon from '@mui/icons-material/GetApp';
|
|
||||||
|
|
||||||
import { toast } from 'react-toastify';
|
|
||||||
|
|
||||||
import { extractErrorMessage } from 'utils';
|
|
||||||
|
|
||||||
import * as EMSESP from 'project/api';
|
|
||||||
|
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
|
import * as EMSESP from 'project/api';
|
||||||
|
import { extractErrorMessage } from 'utils';
|
||||||
|
|
||||||
interface UploadFileProps {
|
interface UploadFileProps {
|
||||||
uploadGeneralFile: (file: File, config?: FileUploadConfig) => AxiosPromise<void>;
|
uploadGeneralFile: (file: File, config?: FileUploadConfig) => AxiosPromise<void>;
|
||||||
@@ -145,7 +139,7 @@ const GeneralFileUpload: FC<UploadFileProps> = ({ uploadGeneralFile }) => {
|
|||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => downloadEntities()}
|
onClick={() => downloadEntities()}
|
||||||
>
|
>
|
||||||
{LL.ENTITIES()}
|
{LL.CUSTOM_ENTITIES(0)}
|
||||||
</Button>
|
</Button>
|
||||||
<Box color="warning.main">
|
<Box color="warning.main">
|
||||||
<Typography mt={2} mb={1} variant="body2">
|
<Typography mt={2} mb={1} variant="body2">
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ const de: Translation = {
|
|||||||
SCHEDULE_TIMER_3: 'jede Stunde',
|
SCHEDULE_TIMER_3: 'jede Stunde',
|
||||||
CUSTOM_ENTITIES: 'Individuelle Entitäten',
|
CUSTOM_ENTITIES: 'Individuelle Entitäten',
|
||||||
ENTITIES_HELP_1: 'Abfrage von Werten auf dem EMS-Bus',
|
ENTITIES_HELP_1: 'Abfrage von Werten auf dem EMS-Bus',
|
||||||
|
ENTITIES_SAVED: 'Entities Saved', // TODO translate
|
||||||
WRITEABLE: 'Schreibbar'
|
WRITEABLE: 'Schreibbar'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ const en: Translation = {
|
|||||||
SCHEDULE_TIMER_3: 'every hour',
|
SCHEDULE_TIMER_3: 'every hour',
|
||||||
CUSTOM_ENTITIES: 'Custom Entities',
|
CUSTOM_ENTITIES: 'Custom Entities',
|
||||||
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus',
|
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus',
|
||||||
|
ENTITIES_SAVED: 'Entities Saved',
|
||||||
WRITEABLE: 'Writeable'
|
WRITEABLE: 'Writeable'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { FormattersInitializer } from 'typesafe-i18n';
|
|
||||||
import type { Locales, Formatters } from './i18n-types';
|
import type { Locales, Formatters } from './i18n-types';
|
||||||
|
import type { FormattersInitializer } from 'typesafe-i18n';
|
||||||
|
|
||||||
export const initFormatters: FormattersInitializer<Locales, Formatters> = (locale: Locales) => {
|
export const initFormatters: FormattersInitializer<Locales, Formatters> = (locale: Locales) => {
|
||||||
const formatters: Formatters = {
|
const formatters: Formatters = {
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ const fr: Translation = {
|
|||||||
SCHEDULE_TIMER_3: 'every hour', // TODO translate
|
SCHEDULE_TIMER_3: 'every hour', // TODO translate
|
||||||
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
||||||
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
||||||
|
ENTITIES_SAVED: 'Entities Saved', // TODO translate
|
||||||
WRITEABLE: 'Writeable' // TODO translate
|
WRITEABLE: 'Writeable' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ const nl: Translation = {
|
|||||||
SCHEDULE_TIMER_3: 'every hour', // TODO translate
|
SCHEDULE_TIMER_3: 'every hour', // TODO translate
|
||||||
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
||||||
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
||||||
|
ENTITIES_SAVED: 'Entities Saved', // TODO translate
|
||||||
WRITEABLE: 'Writeable' // TODO translate
|
WRITEABLE: 'Writeable' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ const no: Translation = {
|
|||||||
SCHEDULE_TIMER_3: 'hver time',
|
SCHEDULE_TIMER_3: 'hver time',
|
||||||
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
||||||
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
||||||
|
ENTITIES_SAVED: 'Entities Saved', // TODO translate
|
||||||
WRITEABLE: 'Writeable' // TODO translate
|
WRITEABLE: 'Writeable' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const pl: BaseTranslation = {
|
|||||||
SECURITY: '{{B|b|}}ezpieczeństw{{o|a|}}',
|
SECURITY: '{{B|b|}}ezpieczeństw{{o|a|}}',
|
||||||
ONOFF_CAP: 'wł./wył.',
|
ONOFF_CAP: 'wł./wył.',
|
||||||
ONOFF: 'włączono/wyłączono',
|
ONOFF: 'włączono/wyłączono',
|
||||||
TYPE: 'Typ',
|
TYPE: '{{T|t|}}yp{{|u|}}',
|
||||||
DESCRIPTION: 'Opis',
|
DESCRIPTION: 'Opis',
|
||||||
ENTITIES: 'Encje',
|
ENTITIES: 'Encje',
|
||||||
REFRESH: 'Odśwież',
|
REFRESH: 'Odśwież',
|
||||||
@@ -240,7 +240,7 @@ const pl: BaseTranslation = {
|
|||||||
MQTT_RESPONSE: 'Rezultat wykonania komendy publikuj w temacie "response"',
|
MQTT_RESPONSE: 'Rezultat wykonania komendy publikuj w temacie "response"',
|
||||||
MQTT_PUBLISH_TEXT_1: 'Tematy z pojedynczą wartością publikuj po jej zmianie',
|
MQTT_PUBLISH_TEXT_1: 'Tematy z pojedynczą wartością publikuj po jej zmianie',
|
||||||
MQTT_PUBLISH_TEXT_2: 'Publikuj w tematach "command" (ioBroker)',
|
MQTT_PUBLISH_TEXT_2: 'Publikuj w tematach "command" (ioBroker)',
|
||||||
MQTT_PUBLISH_TEXT_3: 'Włącz opcję "MQTT discovery',
|
MQTT_PUBLISH_TEXT_3: 'Włącz opcję "MQTT discovery"',
|
||||||
MQTT_PUBLISH_TEXT_4: 'Prefiks dla "MQTT discovery"',
|
MQTT_PUBLISH_TEXT_4: 'Prefiks dla "MQTT discovery"',
|
||||||
MQTT_PUBLISH_TEXT_5: 'Typ "MQTT discovery"',
|
MQTT_PUBLISH_TEXT_5: 'Typ "MQTT discovery"',
|
||||||
MQTT_PUBLISH_INTERVALS: 'Interwały publikowania',
|
MQTT_PUBLISH_INTERVALS: 'Interwały publikowania',
|
||||||
@@ -287,7 +287,7 @@ const pl: BaseTranslation = {
|
|||||||
NETWORK_BLANK_SSID: 'pozostaw puste aby wyłączyć WiFi',
|
NETWORK_BLANK_SSID: 'pozostaw puste aby wyłączyć WiFi',
|
||||||
TX_POWER: 'Moc nadawania',
|
TX_POWER: 'Moc nadawania',
|
||||||
HOSTNAME: 'Nazwa w sieci',
|
HOSTNAME: 'Nazwa w sieci',
|
||||||
NETWORK_DISABLE_SLEEP: 'Wyłącz tryb usypiania WiFi',
|
NETWORK_DISABLE_SLEEP: 'Wyłącz tryb uśpienia WiFi',
|
||||||
NETWORK_LOW_BAND: 'Używaj mniejszej szerokości pasma WiFi (20MHz)',
|
NETWORK_LOW_BAND: 'Używaj mniejszej szerokości pasma WiFi (20MHz)',
|
||||||
NETWORK_USE_DNS: 'Włącz wsparcie dla mDNS',
|
NETWORK_USE_DNS: 'Włącz wsparcie dla mDNS',
|
||||||
NETWORK_ENABLE_CORS: 'Włącz wsparcie dla CORS',
|
NETWORK_ENABLE_CORS: 'Włącz wsparcie dla CORS',
|
||||||
@@ -300,7 +300,7 @@ const pl: BaseTranslation = {
|
|||||||
ADDRESS_OF: 'Adres {0}',
|
ADDRESS_OF: 'Adres {0}',
|
||||||
ADMIN: 'Użytkownik "administrator".',
|
ADMIN: 'Użytkownik "administrator".',
|
||||||
GUEST: 'Użytkownik "gość".',
|
GUEST: 'Użytkownik "gość".',
|
||||||
NEW: 'nowego',
|
NEW: 'nowe{{go|j|}}',
|
||||||
NEW_NAME_OF: 'Nowa nazwa {0}',
|
NEW_NAME_OF: 'Nowa nazwa {0}',
|
||||||
ENTITY: 'encji',
|
ENTITY: 'encji',
|
||||||
MIN: 'Min.',
|
MIN: 'Min.',
|
||||||
@@ -319,8 +319,9 @@ const pl: BaseTranslation = {
|
|||||||
SCHEDULE_TIMER_1: 'przy starcie',
|
SCHEDULE_TIMER_1: 'przy starcie',
|
||||||
SCHEDULE_TIMER_2: 'co minutę',
|
SCHEDULE_TIMER_2: 'co minutę',
|
||||||
SCHEDULE_TIMER_3: 'co godzinę',
|
SCHEDULE_TIMER_3: 'co godzinę',
|
||||||
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
CUSTOM_ENTITIES: '{{N|n|}}iestandardowe{{|j|}} encj{{e|i|}}',
|
||||||
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus',
|
ENTITIES_HELP_1: 'Zdefiniuj niestandardowe encje pobierane z magistrali EMS.',
|
||||||
|
ENTITIES_SAVED: 'Niestandardowe encje zostały uaktualnione.',
|
||||||
WRITEABLE: 'Writeable' // TODO translate
|
WRITEABLE: 'Writeable' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ const sv: Translation = {
|
|||||||
SCHEDULE_TIMER_3: 'every hour', // TODO translate
|
SCHEDULE_TIMER_3: 'every hour', // TODO translate
|
||||||
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
||||||
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
||||||
|
ENTITIES_SAVED: 'Entities Saved', // TODO translate
|
||||||
WRITEABLE: 'Writeable' // TODO translate
|
WRITEABLE: 'Writeable' // TODO translate
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -321,6 +321,7 @@ const tr: Translation = {
|
|||||||
SCHEDULE_TIMER_3: 'every hour', // TODO translate
|
SCHEDULE_TIMER_3: 'every hour', // TODO translate
|
||||||
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
CUSTOM_ENTITIES: 'Custom Entities', // TODO translate
|
||||||
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', // TODO translate
|
||||||
|
ENTITIES_SAVED: 'Entities Saved', // TODO translate
|
||||||
WRITEABLE: 'Writeable' // TODO translate
|
WRITEABLE: 'Writeable' // TODO translate
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
import { FC, useState, useContext, useCallback, useEffect } from 'react';
|
import AddCircleOutlineOutlinedIcon from '@mui/icons-material/AddCircleOutlineOutlined';
|
||||||
|
import CancelIcon from '@mui/icons-material/Cancel';
|
||||||
|
import CommentsDisabledOutlinedIcon from '@mui/icons-material/CommentsDisabledOutlined';
|
||||||
|
import EditIcon from '@mui/icons-material/Edit';
|
||||||
|
import EditOffOutlinedIcon from '@mui/icons-material/EditOffOutlined';
|
||||||
|
import DownloadIcon from '@mui/icons-material/GetApp';
|
||||||
|
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
||||||
|
import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';
|
||||||
|
import KeyboardArrowUpOutlinedIcon from '@mui/icons-material/KeyboardArrowUpOutlined';
|
||||||
|
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
||||||
|
import RefreshIcon from '@mui/icons-material/Refresh';
|
||||||
|
import RemoveIcon from '@mui/icons-material/RemoveCircleOutline';
|
||||||
|
import StarIcon from '@mui/icons-material/Star';
|
||||||
|
import SendIcon from '@mui/icons-material/TrendingFlat';
|
||||||
|
import UnfoldMoreOutlinedIcon from '@mui/icons-material/UnfoldMoreOutlined';
|
||||||
|
import WarningIcon from '@mui/icons-material/Warning';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Typography,
|
Typography,
|
||||||
@@ -19,59 +33,26 @@ import {
|
|||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
Checkbox
|
Checkbox
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
|
import { useRowSelect } from '@table-library/react-table-library/select';
|
||||||
import { toast } from 'react-toastify';
|
|
||||||
|
|
||||||
import { useTheme } from '@table-library/react-table-library/theme';
|
|
||||||
import { useSort, SortToggleType } from '@table-library/react-table-library/sort';
|
import { useSort, SortToggleType } from '@table-library/react-table-library/sort';
|
||||||
import { Table, Header, HeaderRow, HeaderCell, Body, Row, Cell } from '@table-library/react-table-library/table';
|
import { Table, Header, HeaderRow, HeaderCell, Body, Row, Cell } from '@table-library/react-table-library/table';
|
||||||
import { useRowSelect } from '@table-library/react-table-library/select';
|
import { useTheme } from '@table-library/react-table-library/theme';
|
||||||
|
import { useState, useContext, useCallback, useEffect } from 'react';
|
||||||
import DownloadIcon from '@mui/icons-material/GetApp';
|
|
||||||
import RefreshIcon from '@mui/icons-material/Refresh';
|
|
||||||
import EditIcon from '@mui/icons-material/Edit';
|
|
||||||
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
||||||
import AddCircleOutlineOutlinedIcon from '@mui/icons-material/AddCircleOutlineOutlined';
|
|
||||||
import CancelIcon from '@mui/icons-material/Cancel';
|
|
||||||
import SendIcon from '@mui/icons-material/TrendingFlat';
|
|
||||||
import WarningIcon from '@mui/icons-material/Warning';
|
|
||||||
import RemoveIcon from '@mui/icons-material/RemoveCircleOutline';
|
|
||||||
import PlayArrowIcon from '@mui/icons-material/PlayArrow';
|
|
||||||
import EditOffOutlinedIcon from '@mui/icons-material/EditOffOutlined';
|
|
||||||
import CommentsDisabledOutlinedIcon from '@mui/icons-material/CommentsDisabledOutlined';
|
|
||||||
import KeyboardArrowUpOutlinedIcon from '@mui/icons-material/KeyboardArrowUpOutlined';
|
|
||||||
import KeyboardArrowDownOutlinedIcon from '@mui/icons-material/KeyboardArrowDownOutlined';
|
|
||||||
import UnfoldMoreOutlinedIcon from '@mui/icons-material/UnfoldMoreOutlined';
|
|
||||||
import StarIcon from '@mui/icons-material/Star';
|
|
||||||
|
|
||||||
import DeviceIcon from './DeviceIcon';
|
|
||||||
|
|
||||||
import { IconContext } from 'react-icons';
|
import { IconContext } from 'react-icons';
|
||||||
|
import { toast } from 'react-toastify';
|
||||||
import { AuthenticatedContext } from 'contexts/authentication';
|
import DeviceIcon from './DeviceIcon';
|
||||||
|
|
||||||
import { ButtonRow, ValidatedTextField, SectionContent, MessageBox } from 'components';
|
|
||||||
|
|
||||||
import * as EMSESP from './api';
|
import * as EMSESP from './api';
|
||||||
|
|
||||||
import { numberValue, updateValue, extractErrorMessage } from 'utils';
|
import { DeviceValueUOM, DeviceValueUOM_s, AnalogType, AnalogTypeNames, DeviceEntityMask } from './types';
|
||||||
|
import type { SensorData, Device, CoreData, DeviceData, DeviceValue, Sensor, Analog } from './types';
|
||||||
import {
|
import type { FC } from 'react';
|
||||||
SensorData,
|
import { ButtonRow, ValidatedTextField, SectionContent, MessageBox } from 'components';
|
||||||
Device,
|
import { AuthenticatedContext } from 'contexts/authentication';
|
||||||
CoreData,
|
|
||||||
DeviceData,
|
|
||||||
DeviceValue,
|
|
||||||
DeviceValueUOM,
|
|
||||||
DeviceValueUOM_s,
|
|
||||||
AnalogType,
|
|
||||||
AnalogTypeNames,
|
|
||||||
Sensor,
|
|
||||||
Analog,
|
|
||||||
DeviceEntityMask
|
|
||||||
} from './types';
|
|
||||||
|
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
|
import { numberValue, updateValue, extractErrorMessage } from 'utils';
|
||||||
|
|
||||||
const DashboardData: FC = () => {
|
const DashboardData: FC = () => {
|
||||||
const { me } = useContext(AuthenticatedContext);
|
const { me } = useContext(AuthenticatedContext);
|
||||||
@@ -301,20 +282,20 @@ const DashboardData: FC = () => {
|
|||||||
}, [LL]);
|
}, [LL]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchCoreData();
|
void fetchCoreData();
|
||||||
}, [fetchCoreData]);
|
}, [fetchCoreData]);
|
||||||
|
|
||||||
const refreshDataIndex = (selectedDevice: string) => {
|
const refreshDataIndex = (selectedDevice: string) => {
|
||||||
if (selectedDevice === 'sensor') {
|
if (selectedDevice === 'sensor') {
|
||||||
fetchSensorData();
|
void fetchSensorData();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setSensorData({ sensors: [], analogs: [] });
|
setSensorData({ sensors: [], analogs: [] });
|
||||||
if (selectedDevice) {
|
if (selectedDevice) {
|
||||||
fetchDeviceData(selectedDevice);
|
void fetchDeviceData(selectedDevice);
|
||||||
} else {
|
} else {
|
||||||
fetchCoreData();
|
void fetchCoreData();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -344,11 +325,12 @@ const DashboardData: FC = () => {
|
|||||||
return sc;
|
return sc;
|
||||||
};
|
};
|
||||||
|
|
||||||
const makeCsvData = (columns: any, data: any) => {
|
const makeCsvData = (columns: any, data: any) =>
|
||||||
return data.reduce((csvString: any, rowItem: any) => {
|
data.reduce(
|
||||||
return csvString + columns.map(({ accessor }: any) => escapeCsvCell(accessor(rowItem))).join(';') + '\r\n';
|
(csvString: any, rowItem: any) =>
|
||||||
}, columns.map(({ name }: any) => escapeCsvCell(name)).join(';') + '\r\n');
|
csvString + columns.map(({ accessor }: any) => escapeCsvCell(accessor(rowItem))).join(';') + '\r\n',
|
||||||
};
|
columns.map(({ name }: any) => escapeCsvCell(name)).join(';') + '\r\n'
|
||||||
|
);
|
||||||
|
|
||||||
const downloadAsCsv = (columns: any, data: any, filename: string) => {
|
const downloadAsCsv = (columns: any, data: any, filename: string) => {
|
||||||
const csvData = makeCsvData(columns, data);
|
const csvData = makeCsvData(columns, data);
|
||||||
@@ -565,7 +547,7 @@ const DashboardData: FC = () => {
|
|||||||
toast.error(extractErrorMessage(error, LL.PROBLEM_UPDATING()));
|
toast.error(extractErrorMessage(error, LL.PROBLEM_UPDATING()));
|
||||||
} finally {
|
} finally {
|
||||||
setSensor(undefined);
|
setSensor(undefined);
|
||||||
fetchSensorData();
|
void fetchSensorData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -643,7 +625,7 @@ const DashboardData: FC = () => {
|
|||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<List dense={true}>
|
<List dense={true}>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<ListItemText primary={LL.TYPE()} secondary={coreData.devices[deviceDialog].tn} />
|
<ListItemText primary={LL.TYPE(0)} secondary={coreData.devices[deviceDialog].tn} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<ListItemText primary={LL.NAME(0)} secondary={coreData.devices[deviceDialog].n} />
|
<ListItemText primary={LL.NAME(0)} secondary={coreData.devices[deviceDialog].n} />
|
||||||
@@ -688,7 +670,7 @@ const DashboardData: FC = () => {
|
|||||||
<Header>
|
<Header>
|
||||||
<HeaderRow>
|
<HeaderRow>
|
||||||
<HeaderCell stiff />
|
<HeaderCell stiff />
|
||||||
<HeaderCell stiff>{LL.TYPE()}</HeaderCell>
|
<HeaderCell stiff>{LL.TYPE(0)}</HeaderCell>
|
||||||
<HeaderCell resize>{LL.DESCRIPTION()}</HeaderCell>
|
<HeaderCell resize>{LL.DESCRIPTION()}</HeaderCell>
|
||||||
<HeaderCell stiff>{LL.ENTITIES()}</HeaderCell>
|
<HeaderCell stiff>{LL.ENTITIES()}</HeaderCell>
|
||||||
<HeaderCell stiff />
|
<HeaderCell stiff />
|
||||||
@@ -940,7 +922,7 @@ const DashboardData: FC = () => {
|
|||||||
endIcon={getSortIcon(analog_sort.state, 'TYPE')}
|
endIcon={getSortIcon(analog_sort.state, 'TYPE')}
|
||||||
onClick={() => analog_sort.fns.onToggleSort({ sortKey: 'TYPE' })}
|
onClick={() => analog_sort.fns.onToggleSort({ sortKey: 'TYPE' })}
|
||||||
>
|
>
|
||||||
{LL.TYPE()}
|
{LL.TYPE(0)}
|
||||||
</Button>
|
</Button>
|
||||||
</HeaderCell>
|
</HeaderCell>
|
||||||
<HeaderCell stiff>{LL.VALUE(0)}</HeaderCell>
|
<HeaderCell stiff>{LL.VALUE(0)}</HeaderCell>
|
||||||
@@ -993,7 +975,7 @@ const DashboardData: FC = () => {
|
|||||||
toast.error(extractErrorMessage(error, LL.PROBLEM_UPDATING()));
|
toast.error(extractErrorMessage(error, LL.PROBLEM_UPDATING()));
|
||||||
} finally {
|
} finally {
|
||||||
setAnalog(undefined);
|
setAnalog(undefined);
|
||||||
fetchSensorData();
|
void fetchSensorData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1021,7 +1003,7 @@ const DashboardData: FC = () => {
|
|||||||
toast.error(extractErrorMessage(error, LL.PROBLEM_UPDATING()));
|
toast.error(extractErrorMessage(error, LL.PROBLEM_UPDATING()));
|
||||||
} finally {
|
} finally {
|
||||||
setAnalog(undefined);
|
setAnalog(undefined);
|
||||||
fetchSensorData();
|
void fetchSensorData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1060,7 +1042,7 @@ const DashboardData: FC = () => {
|
|||||||
<Grid item xs={8}>
|
<Grid item xs={8}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="t"
|
name="t"
|
||||||
label={LL.TYPE()}
|
label={LL.TYPE(0)}
|
||||||
value={analog.t}
|
value={analog.t}
|
||||||
fullWidth
|
fullWidth
|
||||||
select
|
select
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
import { FC } from 'react';
|
|
||||||
import { Navigate, Route, Routes } from 'react-router-dom';
|
|
||||||
|
|
||||||
import { Tab } from '@mui/material';
|
import { Tab } from '@mui/material';
|
||||||
|
import { Navigate, Route, Routes } from 'react-router-dom';
|
||||||
import { RouterTabs, useRouterTab, useLayoutTitle } from 'components';
|
|
||||||
|
|
||||||
import { useI18nContext } from 'i18n/i18n-react';
|
|
||||||
|
|
||||||
import SettingsApplication from './SettingsApplication';
|
import SettingsApplication from './SettingsApplication';
|
||||||
import SettingsCustomization from './SettingsCustomization';
|
import SettingsCustomization from './SettingsCustomization';
|
||||||
import SettingsScheduler from './SettingsScheduler';
|
|
||||||
import SettingsEntities from './SettingsEntities';
|
import SettingsEntities from './SettingsEntities';
|
||||||
|
import SettingsScheduler from './SettingsScheduler';
|
||||||
|
import type { FC } from 'react';
|
||||||
|
import { RouterTabs, useRouterTab, useLayoutTitle } from 'components';
|
||||||
|
import { useI18nContext } from 'i18n/i18n-react';
|
||||||
|
|
||||||
const Settings: FC = () => {
|
const Settings: FC = () => {
|
||||||
const { LL } = useI18nContext();
|
const { LL } = useI18nContext();
|
||||||
@@ -24,7 +21,7 @@ const Settings: FC = () => {
|
|||||||
<Tab value="application" label={LL.APPLICATION_SETTINGS()} />
|
<Tab value="application" label={LL.APPLICATION_SETTINGS()} />
|
||||||
<Tab value="customization" label={LL.CUSTOMIZATIONS()} />
|
<Tab value="customization" label={LL.CUSTOMIZATIONS()} />
|
||||||
<Tab value="scheduler" label={LL.SCHEDULER()} />
|
<Tab value="scheduler" label={LL.SCHEDULER()} />
|
||||||
<Tab value="customentities" label={LL.CUSTOM_ENTITIES()} />
|
<Tab value="customentities" label={LL.CUSTOM_ENTITIES(0)} />
|
||||||
</RouterTabs>
|
</RouterTabs>
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="application" element={<SettingsApplication />} />
|
<Route path="application" element={<SettingsApplication />} />
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ MAKE_WORD_TRANSLATION(pump_device, "Pump Module", "Pumpenmodul", "Pump Module",
|
|||||||
MAKE_WORD_TRANSLATION(heatsource_device, "Heatsource", "Heizquelle", "Heatsource", "Värmekälla", "Źródło ciepła", "Varmekilde", "", "Isı Kaynağı") // TODO translate
|
MAKE_WORD_TRANSLATION(heatsource_device, "Heatsource", "Heizquelle", "Heatsource", "Värmekälla", "Źródło ciepła", "Varmekilde", "", "Isı Kaynağı") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(sensors_device, "Sensors", "Sensoren", "Sensoren", "Sensorer", "Czujniki", "Sensorer", "Capteurs", "Sensör Cihazı")
|
MAKE_WORD_TRANSLATION(sensors_device, "Sensors", "Sensoren", "Sensoren", "Sensorer", "Czujniki", "Sensorer", "Capteurs", "Sensör Cihazı")
|
||||||
MAKE_WORD_TRANSLATION(unknown_device, "Unknown", "Unbekannt", "Onbekend", "Okänt", "Nieznane urządzenie", "Ukjent", "Inconnu", "") // TODO translate
|
MAKE_WORD_TRANSLATION(unknown_device, "Unknown", "Unbekannt", "Onbekend", "Okänt", "Nieznane urządzenie", "Ukjent", "Inconnu", "") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(custom_device, "User defined entities", "Nutzer deklarierte Entitäten", "", "", "", "", "", "") // TODO translate
|
MAKE_WORD_TRANSLATION(custom_device, "Custom", "", "", "", "Niestandardowe", "", "", "") // TODO translate
|
||||||
|
MAKE_WORD_TRANSLATION(custom_device_name, "User defined entities", "Nutzer deklarierte Entitäten", "", "", "Encje zdefiniowane przez użytkownika", "", "", "") // TODO translate
|
||||||
|
|
||||||
// commands
|
// commands
|
||||||
// TODO translate
|
// TODO translate
|
||||||
@@ -61,11 +62,11 @@ MAKE_WORD_TRANSLATION(setiovalue_cmd, "set io value", "Setze Wertevorgabe", "",
|
|||||||
MAKE_WORD_TRANSLATION(changeloglevel_cmd, "change log level", "Ändere Sysloglevel", "", "", "zmień poziom log-u", "endre loggnivå", "", "Kayıt seviyesini değiştir") // TODO translate
|
MAKE_WORD_TRANSLATION(changeloglevel_cmd, "change log level", "Ändere Sysloglevel", "", "", "zmień poziom log-u", "endre loggnivå", "", "Kayıt seviyesini değiştir") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(fetch_cmd, "refresh all EMS values", "Lese alle EMS-Werte neu", "", "", "odśwież wszystkie wartości EMS", "oppfrisk alle EMS verdier", "", "Bütün EMS değerlerini yenile") // TODO translate
|
MAKE_WORD_TRANSLATION(fetch_cmd, "refresh all EMS values", "Lese alle EMS-Werte neu", "", "", "odśwież wszystkie wartości EMS", "oppfrisk alle EMS verdier", "", "Bütün EMS değerlerini yenile") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(restart_cmd, "restart EMS-ESP", "Neustart", "", "", "uruchom ponownie EMS-ESP", "restart EMS-ESP", "", "EMS-ESPyi yeniden başlat") // TODO translate
|
MAKE_WORD_TRANSLATION(restart_cmd, "restart EMS-ESP", "Neustart", "", "", "uruchom ponownie EMS-ESP", "restart EMS-ESP", "", "EMS-ESPyi yeniden başlat") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(watch_cmd, "watch incoming telegrams", "Watch auf eingehende Telegramme", "", "", "obserwuj przyczodzące telegramy", "se innkommende telegrammer", "", "Gelen telegramları ") // TODO translate
|
MAKE_WORD_TRANSLATION(watch_cmd, "watch incoming telegrams", "Watch auf eingehende Telegramme", "", "", "obserwuj przychodzące telegramy", "se innkommende telegrammer", "", "Gelen telegramları ") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(publish_cmd, "publish all to MQTT", "Publiziere MQTT", "", "", "opublikuj wszystko na MQTT", "Publiser alt til MQTT", "", "Hepsini MQTTye gönder") // TODO translate
|
MAKE_WORD_TRANSLATION(publish_cmd, "publish all to MQTT", "Publiziere MQTT", "", "", "opublikuj wszystko na MQTT", "Publiser alt til MQTT", "", "Hepsini MQTTye gönder") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(system_info_cmd, "show system status", "Zeige System-Status", "", "", "pokaż status systemu", "vis system status", "", "Sistem Durumunu Göster") // TODO translate
|
MAKE_WORD_TRANSLATION(system_info_cmd, "show system status", "Zeige System-Status", "", "", "pokaż status systemu", "vis system status", "", "Sistem Durumunu Göster") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(schedule_cmd, "enable schedule item", "Aktiviere Zeitplan", "", "", "aktywuj wybrany harmonogram", "", "", "") // TODO translate
|
MAKE_WORD_TRANSLATION(schedule_cmd, "enable schedule item", "Aktiviere Zeitplan", "", "", "aktywuj wybrany harmonogram", "", "", "") // TODO translate
|
||||||
MAKE_WORD_TRANSLATION(entity_cmd, "set custom value on ems", "Sende eigene Entitäten zu EMS", "", "", "", "", "", "") // TODO translate
|
MAKE_WORD_TRANSLATION(entity_cmd, "set custom value on ems", "Sende eigene Entitäten zu EMS", "", "", "wyślij własną wartość na EMS", "", "", "") // TODO translate
|
||||||
|
|
||||||
// tags
|
// tags
|
||||||
MAKE_WORD_TRANSLATION(tag_boiler_data_ww, "dhw", "WW", "dhw", "VV", "CWU", "dhw", "ecs", "SKS")
|
MAKE_WORD_TRANSLATION(tag_boiler_data_ww, "dhw", "WW", "dhw", "VV", "CWU", "dhw", "ecs", "SKS")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
* EMS-ESP - https://github.com/emsesp/EMS-ESP
|
||||||
* Copyright 2020-2023 Paul Derbyshire
|
* Copyright 2020-2023 Paul Derbyshire
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
@@ -75,33 +75,32 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
|
|||||||
|
|
||||||
// list is already sorted by device type
|
// list is already sorted by device type
|
||||||
JsonArray devices = root.createNestedArray("devices");
|
JsonArray devices = root.createNestedArray("devices");
|
||||||
char buffer[3];
|
|
||||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||||
// ignore controller
|
// ignore controller
|
||||||
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER || emsdevice->count_entities() > 0)) {
|
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER || emsdevice->count_entities() > 0)) {
|
||||||
JsonObject obj = devices.createNestedObject();
|
JsonObject obj = devices.createNestedObject();
|
||||||
obj["id"] = Helpers::smallitoa(buffer, emsdevice->unique_id()); // a unique id as a string
|
obj["id"] = emsdevice->unique_id(); // a unique id
|
||||||
obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name
|
obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name
|
||||||
obj["t"] = emsdevice->device_type(); // device type number
|
obj["t"] = emsdevice->device_type(); // device type number
|
||||||
obj["b"] = emsdevice->brand_to_char(); // brand
|
obj["b"] = emsdevice->brand_to_char(); // brand
|
||||||
obj["n"] = emsdevice->name(); // name
|
obj["n"] = emsdevice->name(); // name
|
||||||
obj["d"] = emsdevice->device_id(); // deviceid
|
obj["d"] = emsdevice->device_id(); // deviceid
|
||||||
obj["p"] = emsdevice->product_id(); // productid
|
obj["p"] = emsdevice->product_id(); // productid
|
||||||
obj["v"] = emsdevice->version(); // version
|
obj["v"] = emsdevice->version(); // version
|
||||||
obj["e"] = emsdevice->count_entities(); // number of entities (device values)
|
obj["e"] = emsdevice->count_entities(); // number of entities (device values)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (EMSESP::webEntityService.count_entities()) {
|
if (EMSESP::webEntityService.count_entities()) {
|
||||||
JsonObject obj = devices.createNestedObject();
|
JsonObject obj = devices.createNestedObject();
|
||||||
obj["id"] = "99"; // the last unique id as a string
|
obj["id"] = 99; // the last unique id
|
||||||
obj["tn"] = "Custom"; // translated device type name
|
obj["tn"] = Helpers::translated_word(FL_(custom_device)); // translated device type name
|
||||||
obj["t"] = EMSdevice::DeviceType::CUSTOM; // device type number
|
obj["t"] = EMSdevice::DeviceType::CUSTOM; // device type number
|
||||||
obj["b"] = 0; // brand
|
obj["b"] = Helpers::translated_word(FL_(na)); // brand
|
||||||
obj["n"] = Helpers::translated_word(FL_(custom_device)); // name
|
obj["n"] = Helpers::translated_word(FL_(custom_device_name)); // name
|
||||||
obj["d"] = 0; // deviceid
|
obj["d"] = 0; // deviceid
|
||||||
obj["p"] = 0; // productid
|
obj["p"] = 0; // productid
|
||||||
obj["v"] = 0; // version
|
obj["v"] = 0; // version
|
||||||
obj["e"] = EMSESP::webEntityService.count_entities(); // number of entities (device values)
|
obj["e"] = EMSESP::webEntityService.count_entities(); // number of entities (device values)
|
||||||
}
|
}
|
||||||
|
|
||||||
// sensors stuff
|
// sensors stuff
|
||||||
|
|||||||
Reference in New Issue
Block a user