Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Jan 5, 2023
2 parents 78ae4d7 + 74acf2f commit ad680de
Show file tree
Hide file tree
Showing 26 changed files with 11,277 additions and 3,390 deletions.
14,370 changes: 11,090 additions & 3,280 deletions interface/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@emotion/styled": "^11.10.5",
"@msgpack/msgpack": "^2.8.0",
"@mui/icons-material": "^5.11.0",
"@mui/material": "^5.11.2",
"@mui/material": "^5.11.3",
"@table-library/react-table-library": "4.0.23",
"@types/lodash": "^4.14.191",
"@types/node": "^18.11.18",
Expand All @@ -29,7 +29,7 @@
"react-router-dom": "^6.6.1",
"react-scripts": "5.0.1",
"sockette": "^2.0.6",
"typesafe-i18n": "^5.18.0",
"typesafe-i18n": "^5.18.1",
"typescript": "^4.9.4"
},
"scripts": {
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 @@ -70,7 +70,7 @@ const de: Translation = {
TEMP_SENSOR: 'Temperatursensor',
TEMP_SENSORS: 'Temperatursensoren',
WRITE_CMD_SENT: 'Befehl schreiben wurde gesendet',
WRITE_CMD_FAILED: 'Befehl schreiben failed', // TODO
WRITE_CMD_FAILED: 'Befehl schreiben failed', // TODO translate
EMS_BUS_WARNING: 'EMS-Bus getrennt. Wenn diese Warnung nach einigen Sekunden immer noch besteht, überprüfen Sie bitte die Einstellungen und das Board-Profil',
EMS_BUS_SCANNING: 'Suche nach EMS Geräten...',
CONNECTED: 'Verbunden',
Expand Down
12 changes: 6 additions & 6 deletions interface/src/i18n/fr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const fr: Translation = {
SENSOR: 'Capteur',
TEMP_SENSOR: 'Capteur de température',
TEMP_SENSORS: 'Capteurs de température',
WRITE_CMD_SENT: 'Envoyer la commande sent', // TODO
WRITE_CMD_FAILED: 'Envoyer la commande failed', // TODO
WRITE_CMD_SENT: 'Envoyer la commande sent', // TODO translate
WRITE_CMD_FAILED: 'Envoyer la commande failed', // TODO translate
EMS_BUS_WARNING: 'Bus EMS déconnecté. Si ce message persiste après quelques secondes, vérifiez les paramètres et la configuration de la carte.',
EMS_BUS_SCANNING: 'Scan des appareils EMS...',
CONNECTED: 'Connecté',
Expand Down Expand Up @@ -249,10 +249,10 @@ const fr: Translation = {
MQTT_INT_HEARTBEAT: 'Battements',
MQTT_QUEUE: 'Queue MQTT',
DEFAULT: 'Défaut',
MQTT_ENTITY_FORMAT: 'Entity ID format', // TODO
MQTT_ENTITY_FORMAT_0: 'Single instance, long name (v3.4)',// TODO
MQTT_ENTITY_FORMAT_1: 'Single instance, short name', // TODO
MQTT_ENTITY_FORMAT_2: 'Multiple instances, short name', // TODO
MQTT_ENTITY_FORMAT: 'Entity ID format', // TODO translate
MQTT_ENTITY_FORMAT_0: 'Single instance, long name (v3.4)',// TODO translate
MQTT_ENTITY_FORMAT_1: 'Single instance, short name', // TODO translate
MQTT_ENTITY_FORMAT_2: 'Multiple instances, short name', // TODO translate
MQTT_CLEAN_SESSION: 'Flag Clean Session',
MQTT_RETAIN_FLAG: 'Toujours activer le Retain Flag',
INACTIVE: 'Inactif',
Expand Down
12 changes: 6 additions & 6 deletions interface/src/i18n/nl/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const nl: Translation = {
SENSOR: 'Sensor',
TEMP_SENSOR: 'Temperatuur sensor',
TEMP_SENSORS: 'Temperatuur Sensoren',
WRITE_CMD_SENT: 'Schrijf commando sent', // TODO
WRITE_CMD_FAILED: 'Schrijf commando failed', // TODO
WRITE_CMD_SENT: 'Schrijf commando sent', // TODO translate
WRITE_CMD_FAILED: 'Schrijf commando failed', // TODO translate
EMS_BUS_WARNING: 'EMS bus niet gevonden. Als deze waarschuwing blijft staan na een paar seconden dan loop de instellingen na en in het bijzonder het apparaat type profiel na.',
EMS_BUS_SCANNING: 'Scannen naar EMS apparaten...',
CONNECTED: 'Verbonden',
Expand Down Expand Up @@ -249,10 +249,10 @@ const nl: Translation = {
MQTT_INT_HEARTBEAT: 'Heartbeat',
MQTT_QUEUE: 'MQTT Queue',
DEFAULT: 'Default',
MQTT_ENTITY_FORMAT: 'Entity ID format', // TODO
MQTT_ENTITY_FORMAT_0: 'Single instance, long name (v3.4)', // TODO
MQTT_ENTITY_FORMAT_1: 'Single instance, short name', // TODO
MQTT_ENTITY_FORMAT_2: 'Multiple instances, short name', // TODO
MQTT_ENTITY_FORMAT: 'Entity ID format', // TODO translate
MQTT_ENTITY_FORMAT_0: 'Single instance, long name (v3.4)', // TODO translate
MQTT_ENTITY_FORMAT_1: 'Single instance, short name', // TODO translate
MQTT_ENTITY_FORMAT_2: 'Multiple instances, short name', // TODO translate
MQTT_CLEAN_SESSION: 'Clean Session aan',
MQTT_RETAIN_FLAG: 'Retain flag aan',
INACTIVE: 'Inactief',
Expand Down
12 changes: 6 additions & 6 deletions interface/src/i18n/no/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const no: Translation = {
SENSOR: 'Sensor',
TEMP_SENSOR: 'Temperatursensor',
TEMP_SENSORS: 'Temperaturesensorer',
WRITE_CMD_SENT: 'Skriv kommando sent', // TODO
WRITE_CMD_FAILED: 'Skriv kommando failed', // TODO
WRITE_CMD_SENT: 'Skriv kommando sent', // TODO translate
WRITE_CMD_FAILED: 'Skriv kommando failed', // TODO translate
EMS_BUS_WARNING: 'EMS bussen koblet ned. Hvis denne advarselen fortsetter etter noen f¨sekunder sjekk instillinger og prosessorkort',
EMS_BUS_SCANNING: 'Søker etter EMS enheter...',
CONNECTED: 'Tilkoblet',
Expand Down Expand Up @@ -249,10 +249,10 @@ const no: Translation = {
MQTT_INT_HEARTBEAT: 'Heartbeat',
MQTT_QUEUE: 'MQTT Queue',
DEFAULT: 'Standard',
MQTT_ENTITY_FORMAT: 'Entity ID format', // TODO
MQTT_ENTITY_FORMAT_0: 'Single instance, long name (v3.4)', // TODO
MQTT_ENTITY_FORMAT_1: 'Single instance, short name', // TODO
MQTT_ENTITY_FORMAT_2: 'Multiple instances, short name', // TODO
MQTT_ENTITY_FORMAT: 'Entity ID format', // TODO translate
MQTT_ENTITY_FORMAT_0: 'Single instance, long name (v3.4)', // TODO translate
MQTT_ENTITY_FORMAT_1: 'Single instance, short name', // TODO translate
MQTT_ENTITY_FORMAT_2: 'Multiple instances, short name', // TODO translate
MQTT_CLEAN_SESSION: 'Benytt Clean Session',
MQTT_RETAIN_FLAG: 'Alltid sett Retain flag',
INACTIVE: 'Innaktiv',
Expand Down
8 changes: 4 additions & 4 deletions interface/src/project/DashboardData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const DashboardData: FC = () => {
common_theme,
{
Table: `
--data-table-library_grid-template-columns: 40px 100px repeat(1, minmax(0, 1fr)) 100px 40px;
--data-table-library_grid-template-columns: 40px 160px repeat(1, minmax(0, 1fr)) 100px 40px;
`,
BaseRow: `
.td {
Expand Down Expand Up @@ -704,9 +704,9 @@ const DashboardData: FC = () => {
{tableList.map((device: Device, index: number) => (
<Row key={device.id} item={device}>
<Cell stiff>
<DeviceIcon type={device.t} />
<DeviceIcon type_id={device.t} />
</Cell>
<Cell stiff>{device.t}</Cell>
<Cell stiff>{device.tn}</Cell>
<Cell>{device.n}</Cell>
<Cell stiff>{device.e}</Cell>
<Cell stiff>
Expand All @@ -719,7 +719,7 @@ const DashboardData: FC = () => {
{(coreData.active_sensors > 0 || coreData.analog_enabled) && (
<Row key="sensor" item={{ id: 'sensor' }}>
<Cell>
<DeviceIcon type="Sensor" />
<DeviceIcon type_id={1} />
</Cell>
<Cell>Sensors</Cell>
<Cell>{LL.ATTACHED_SENSORS()}</Cell>
Expand Down
59 changes: 41 additions & 18 deletions interface/src/project/DeviceIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,56 @@ import { AiOutlineAlert } from 'react-icons/ai';
import { AiOutlineChrome } from 'react-icons/ai';

interface DeviceIconProps {
type: string;
type_id: number;
}

const DeviceIcon: FC<DeviceIconProps> = ({ type }) => {
switch (type) {
case 'Boiler':
case 'Heatsource':
return <CgSmartHomeBoiler />;
case 'Sensor':
// matches emsdevice.h DeviceType
const enum DeviceType {
SYSTEM = 0,
DALLASSENSOR,
ANALOGSENSOR,
BOILER,
THERMOSTAT,
MIXER,
SOLAR,
HEATPUMP,
GATEWAY,
SWITCH,
CONTROLLER,
CONNECT,
ALERT,
PUMP,
GENERIC,
HEATSOURCE,
UNKNOWN
}

const DeviceIcon: FC<DeviceIconProps> = ({ type_id }) => {
switch (type_id) {
case DeviceType.DALLASSENSOR:
case DeviceType.ANALOGSENSOR:
return <MdOutlineSensors />;
case 'Solar':
return <FaSolarPanel />;
case 'Thermostat':
case DeviceType.BOILER:
case DeviceType.HEATSOURCE:
return <CgSmartHomeBoiler />;
case DeviceType.THERMOSTAT:
return <MdThermostatAuto />;
case 'Mixer':
case DeviceType.MIXER:
return <AiOutlineControl />;
case 'Heatpump':
case DeviceType.SOLAR:
return <FaSolarPanel />;
case DeviceType.HEATPUMP:
return <GiHeatHaze />;
case 'Switch':
case DeviceType.GATEWAY:
return <AiOutlineGateway />;
case DeviceType.SWITCH:
return <TiFlowSwitch />;
case 'Connect':
case DeviceType.CONTROLLER:
case DeviceType.CONNECT:
return <VscVmConnect />;
case 'Gateway':
return <AiOutlineGateway />;
case 'Alert':
case DeviceType.ALERT:
return <AiOutlineAlert />;
case 'Pump':
case DeviceType.PUMP:
return <AiOutlineChrome />;
default:
return null;
Expand Down
2 changes: 1 addition & 1 deletion interface/src/project/SettingsCustomization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const SettingsCustomization: FC = () => {
return (
<>
{de.n && (de.n[0] === '!' ? LL.COMMAND() + ': ' + de.n.slice(1) : de.cn && de.cn !== '' ? de.cn : de.n) + ' '}(
<Link target="_blank" href={APIURL + devices?.devices[selectedDevice].t + '/' + de.id}>
<Link target="_blank" href={APIURL + devices?.devices[selectedDevice].tn + '/' + de.id}>
{de.id}
</Link>
)
Expand Down
6 changes: 4 additions & 2 deletions interface/src/project/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export interface Status {
}
export interface Device {
id: string; // id index
t: string; // type
tn: string; // device type translated name
t: number; // device type id
b: string; // brand
n: string; // name
d: number; // deviceid
Expand Down Expand Up @@ -110,7 +111,8 @@ export interface DeviceShort {
d?: number; // deviceid
p?: number; // productid
s: string; // shortname
t?: string; // device type name
t?: number; // device type id
tn?: string; // device type internal name
}

export interface Devices {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class MsgPackDeserializer {
NestingLimit nestingLimit) {
DeserializationError::Code err;

uint8_t code = 0; // TODO: why do we need to initialize this variable?
uint8_t code = 0;
err = readByte(code);
if (err)
return err;
Expand Down
2 changes: 1 addition & 1 deletion lib/ArduinoJson/src/ArduinoJson/Variant/VariantCompare.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct Comparer;
template <typename T>
struct Comparer<T, typename enable_if<IsString<T>::value>::type>
: ComparerBase {
T rhs; // TODO: store adapted string?
T rhs;

explicit Comparer(T value) : rhs(value) {}

Expand Down
18 changes: 12 additions & 6 deletions mock-api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,17 +355,20 @@ const emsesp_devices = {
{
i: 1,
s: 'Thermostat (RC20/Moduline 300)',
t: 'thermostat',
t: 4,
tn: 'thermostat',
},
{
i: 2,
s: 'Boiler (Nefit GBx72/Trendline/Cerapur/Greenstar Si/27i)',
t: 'boiler',
t: 3,
tn: 'boiler',
},
{
i: 4,
s: 'Thermostat (RC100/Moduline 1000/1010)',
t: 'thermostat',
t: 4,
tn: 'thermostat',
},
],
}
Expand All @@ -376,7 +379,8 @@ const emsesp_coredata = {
devices: [
{
id: '2',
t: 'Boiler',
t: 3,
tn: 'Boiler',
b: 'Nefit',
n: 'GBx72/Trendline/Cerapur/Greenstar Si/27i',
d: 8,
Expand All @@ -386,7 +390,8 @@ const emsesp_coredata = {
},
{
id: '1',
t: 'Thermostat',
t: 4,
tn: 'Thermostat',
b: '',
n: 'RC20/Moduline 300',
d: 23,
Expand All @@ -396,7 +401,8 @@ const emsesp_coredata = {
},
{
id: '4',
t: 'Thermostat',
t: 4,
tn: 'Thermostat',
b: 'Buderus',
n: 'RC100/Moduline 1000/1010',
d: 16,
Expand Down
Loading

0 comments on commit ad680de

Please sign in to comment.