Skip to content

Commit 243aec3

Browse files
authored
Merge pull request #1277 from proddy/dev
minor changes
2 parents f60197e + fb44e02 commit 243aec3

34 files changed

+198
-176
lines changed

CHANGELOG_LATEST.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Changelog
22

3-
# [3.7.0]
3+
# [3.6.1]
44

55
## **IMPORTANT! BREAKING CHANGES**
66

7+
- shower_data MQTT topic shows duration is seconds (was previously an English string)
8+
79
## Added
810

911
- rssi in Network Status Page
@@ -15,3 +17,4 @@
1517
## Changed
1618

1719
- mqtt free mem check 60k
20+
- small cosmetic changes to Searching in Customization web page

interface/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@prefresh/vite": "^2.4.1",
2929
"@table-library/react-table-library": "4.1.7",
3030
"@types/lodash-es": "^4.17.9",
31-
"@types/node": "^20.5.7",
31+
"@types/node": "^20.5.8",
3232
"@types/react": "^18.2.21",
3333
"@types/react-dom": "^18.2.7",
3434
"@types/react-router-dom": "^5.3.3",

interface/src/project/SettingsCustomization.tsx

+17-18
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const SettingsCustomization: FC = () => {
8686

8787
const entities_theme = useTheme({
8888
Table: `
89-
--data-table-library_grid-template-columns: 150px repeat(1, minmax(80px, 1fr)) 45px minmax(45px, auto) minmax(120px, auto);
89+
--data-table-library_grid-template-columns: 156px repeat(1, minmax(80px, 1fr)) 45px minmax(45px, auto) minmax(120px, auto);
9090
`,
9191
BaseRow: `
9292
font-size: 14px;
@@ -192,17 +192,9 @@ const SettingsCustomization: FC = () => {
192192
return value;
193193
}
194194

195-
function formatName(de: DeviceEntity) {
196-
return (
197-
<>
198-
{de.n && (de.n[0] === '!' ? LL.COMMAND(1) + ': ' + de.n.slice(1) : de.cn && de.cn !== '' ? de.cn : de.n) + ' '}(
199-
<Link target="_blank" href={APIURL + devices?.devices[selectedDevice].tn + '/' + de.id}>
200-
{de.id}
201-
</Link>
202-
)
203-
</>
204-
);
205-
}
195+
const formatName = (de: DeviceEntity, withShortname: boolean) =>
196+
(de.n && de.n[0] === '!' ? LL.COMMAND(1) + ': ' + de.n.slice(1) : de.cn && de.cn !== '' ? de.cn : de.n) +
197+
(withShortname ? ' ' + de.id : '');
206198

207199
const getMaskNumber = (newMask: string[]) => {
208200
let new_mask = 0;
@@ -232,10 +224,13 @@ const SettingsCustomization: FC = () => {
232224
return new_masks;
233225
};
234226

227+
const filter_entity = (de: DeviceEntity) =>
228+
(de.m & selectedFilters || !selectedFilters) && formatName(de, true).includes(search.toLocaleLowerCase());
229+
235230
const maskDisabled = (set: boolean) => {
236231
setDeviceEntities(
237232
deviceEntities.map(function (de) {
238-
if ((de.m & selectedFilters || !selectedFilters) && de.id.toLowerCase().includes(search.toLowerCase())) {
233+
if (filter_entity(de)) {
239234
return {
240235
...de,
241236
m: set
@@ -353,7 +348,7 @@ const SettingsCustomization: FC = () => {
353348
margin="normal"
354349
select
355350
>
356-
<MenuItem disabled key={0} value={-1}>
351+
<MenuItem disabled key={-1} value={-1}>
357352
{LL.SELECT_DEVICE()}...
358353
</MenuItem>
359354
{devices.devices.map((device: DeviceShort, index) => (
@@ -370,9 +365,7 @@ const SettingsCustomization: FC = () => {
370365
return;
371366
}
372367

373-
const shown_data = deviceEntities.filter(
374-
(de) => (de.m & selectedFilters || !selectedFilters) && de.id.toLowerCase().includes(search.toLowerCase())
375-
);
368+
const shown_data = deviceEntities.filter((de) => filter_entity(de));
376369

377370
return (
378371
<>
@@ -470,7 +463,13 @@ const SettingsCustomization: FC = () => {
470463
<Cell stiff>
471464
<EntityMaskToggle onUpdate={updateDeviceEntity} de={de} />
472465
</Cell>
473-
<Cell>{formatName(de)}</Cell>
466+
<Cell>
467+
{formatName(de, false)}&nbsp;(
468+
<Link target="_blank" href={APIURL + devices?.devices[selectedDevice].tn + '/' + de.id}>
469+
{de.id}
470+
</Link>
471+
)
472+
</Cell>
474473
<Cell>{!(de.m & DeviceEntityMask.DV_READONLY) && formatValue(de.mi)}</Cell>
475474
<Cell>{!(de.m & DeviceEntityMask.DV_READONLY) && formatValue(de.ma)}</Cell>
476475
<Cell>{formatValue(de.v)}</Cell>

interface/src/project/SettingsCustomizationDialog.tsx

+26-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import CancelIcon from '@mui/icons-material/Cancel';
2+
import CloseIcon from '@mui/icons-material/Close';
23
import DoneIcon from '@mui/icons-material/Done';
34

45
import {
@@ -67,15 +68,34 @@ const SettingsCustomizationDialog = ({ open, onClose, onSave, selectedItem }: Se
6768
<Dialog sx={dialogStyle} open={open} onClose={close}>
6869
<DialogTitle>{LL.EDIT() + ' ' + LL.ENTITY()}</DialogTitle>
6970
<DialogContent dividers>
70-
<Box color="warning.main">
71+
<Grid container direction="row">
72+
<Typography variant="body2" color="warning.main">
73+
{LL.ENTITY() + ' ID'}:&nbsp;
74+
</Typography>
7175
<Typography variant="body2">{editItem.id}</Typography>
72-
</Box>
73-
<Box color="warning.main" mt={1} mb={2}>
76+
</Grid>
77+
78+
<Grid container direction="row">
79+
<Typography variant="body2" color="warning.main">
80+
{LL.DEFAULT(1) + ' ' + LL.ENTITY_NAME(1)}:&nbsp;
81+
</Typography>
82+
<Typography variant="body2">{editItem.n}</Typography>
83+
</Grid>
84+
85+
<Grid container direction="row">
86+
<Typography variant="body2" color="warning.main">
87+
{LL.WRITEABLE()}:&nbsp;
88+
</Typography>
7489
<Typography variant="body2">
75-
{LL.DEFAULT(1) + ' ' + LL.ENTITY_NAME(1)}:&nbsp;{editItem.n}
90+
{editItem.w ? (
91+
<DoneIcon color="success" sx={{ fontSize: 16 }} />
92+
) : (
93+
<CloseIcon color="error" sx={{ fontSize: 16 }} />
94+
)}
7695
</Typography>
77-
</Box>
78-
<Box mb={3}>
96+
</Grid>
97+
98+
<Box mt={1} mb={2}>
7999
<EntityMaskToggle onUpdate={updateDeviceEntity} de={editItem} />
80100
</Box>
81101
<Grid container spacing={1}>

interface/src/project/SettingsScheduler.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import AddIcon from '@mui/icons-material/Add';
22
import CancelIcon from '@mui/icons-material/Cancel';
3-
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
3+
import CircleIcon from '@mui/icons-material/Circle';
44
import WarningIcon from '@mui/icons-material/Warning';
55

66
import { Box, Typography, Divider, Stack, Button } from '@mui/material';
@@ -216,7 +216,11 @@ const SettingsScheduler: FC = () => {
216216
{tableList.map((si: ScheduleItem) => (
217217
<Row key={si.id} item={si} onClick={() => editScheduleItem(si)}>
218218
<Cell stiff>
219-
{si.active && <CheckCircleIcon sx={{ color: '#79D200', fontSize: 16, verticalAlign: 'middle' }} />}
219+
{si.active ? (
220+
<CircleIcon color="success" sx={{ fontSize: 16, verticalAlign: 'middle' }} />
221+
) : (
222+
<CircleIcon color="error" sx={{ fontSize: 16, verticalAlign: 'middle' }} />
223+
)}
220224
</Cell>
221225
<Cell stiff>
222226
<Stack spacing={1} direction="row">

interface/src/project/SettingsSchedulerDialog.tsx

-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import AddIcon from '@mui/icons-material/Add';
22
import CancelIcon from '@mui/icons-material/Cancel';
3-
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
43
import DoneIcon from '@mui/icons-material/Done';
54
import RemoveIcon from '@mui/icons-material/RemoveCircleOutline';
65

@@ -184,11 +183,6 @@ const SettingsSchedulerDialog = ({
184183
control={<Checkbox checked={editItem.active} onChange={updateFormValue} name="active" />}
185184
label={LL.ACTIVE()}
186185
/>
187-
{editItem.active && (
188-
<Grid item sx={{ mt: 1 }}>
189-
<CheckCircleIcon sx={{ color: '#79D200', fontSize: 16, verticalAlign: 'middle' }} />
190-
</Grid>
191-
)}
192186
</Grid>
193187
<Grid container>
194188
<TextField

interface/yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -1355,10 +1355,10 @@ __metadata:
13551355
languageName: node
13561356
linkType: hard
13571357

1358-
"@types/node@npm:^20.5.7":
1359-
version: 20.5.7
1360-
resolution: "@types/node@npm:20.5.7"
1361-
checksum: e5bce3d38478f2a135e254e910f40f844d379dbc8d5576ec6532122297c435f9c05e01f585c38fb9a83e21bde2652cc266b6aa98e45c8b5e51cc5b11a4f64cf0
1358+
"@types/node@npm:^20.5.8":
1359+
version: 20.5.8
1360+
resolution: "@types/node@npm:20.5.8"
1361+
checksum: 5d4af299b4499c4658d5fed3475ad1039828c5a8a44cd15494d45d8d1097965b59246f140af43a9e94277007082e8d04bc4f7771a4b97a8292ffd7442240cffd
13621362
languageName: node
13631363
linkType: hard
13641364

@@ -1587,7 +1587,7 @@ __metadata:
15871587
"@table-library/react-table-library": 4.1.7
15881588
"@types/babel__core": ^7
15891589
"@types/lodash-es": ^4.17.9
1590-
"@types/node": ^20.5.7
1590+
"@types/node": ^20.5.8
15911591
"@types/react": ^18.2.21
15921592
"@types/react-dom": ^18.2.7
15931593
"@types/react-router-dom": ^5.3.3

src/analogsensor.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void AnalogSensor::measure() {
260260
for (auto & sensor : sensors_) {
261261
if (sensor.type() == AnalogType::DIGITAL_IN || sensor.type() == AnalogType::COUNTER || sensor.type() == AnalogType::TIMER
262262
|| sensor.type() == AnalogType::RATE) {
263-
auto old_value = sensor.value(); // remember current value before reading
263+
auto old_value = sensor.value(); // remember current value before reading
264264
auto current_reading = digitalRead(sensor.gpio());
265265
if (sensor.poll_ != current_reading) { // check for pinchange
266266
sensor.polltime_ = uuid::get_uptime(); // remember time of pinchange
@@ -274,7 +274,7 @@ void AnalogSensor::measure() {
274274
} else if (!sensor.poll_) { // falling edge
275275
if (sensor.type() == AnalogType::COUNTER) {
276276
sensor.set_value(old_value + sensor.factor());
277-
} else if (sensor.type() == AnalogType::RATE) { // dafault uom: Hz (1/sec) with factor 1
277+
} else if (sensor.type() == AnalogType::RATE) { // dafault uom: Hz (1/sec) with factor 1
278278
sensor.set_value(sensor.factor() * 1000 / (sensor.polltime_ - sensor.last_polltime_));
279279
} else if (sensor.type() == AnalogType::TIMER) { // default seconds with factor 1
280280
sensor.set_value(sensor.factor() * (sensor.polltime_ - sensor.last_polltime_) / 1000);
@@ -685,7 +685,7 @@ bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject
685685
dataSensor["value"] = sensor.value();
686686
} else if (id == 0) { // output values command
687687
output[sensor.name()] = sensor.value();
688-
} else { // if someone wants gpio numbers
688+
} else { // if someone wants gpio numbers
689689
char gpio_str[9];
690690
snprintf(gpio_str, sizeof(gpio_str), "gpio_%02d", sensor.gpio());
691691
output[gpio_str] = sensor.value();

src/command.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Command {
5656
struct CmdFunction {
5757
uint8_t device_type_; // DeviceType::
5858
uint8_t device_id_;
59-
uint8_t flags_; // mqtt flags for command subscriptions
59+
uint8_t flags_; // mqtt flags for command subscriptions
6060
const char * cmd_;
6161
cmd_function_p cmdfunction_;
6262
cmd_json_function_p cmdfunction_json_;

src/devices/boiler.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ class Boiler : public EMSdevice {
8787
uint32_t wwWorkM_; // DHW minutes
8888
int8_t wwHystOn_;
8989
int8_t wwHystOff_;
90-
uint8_t wwTapActivated_; // maintenance-mode to switch DHW off
91-
uint16_t wwMixerTemp_; // mixing temperature
92-
uint16_t wwCylMiddleTemp_; // Cyl middle temperature (TS3)
90+
uint8_t wwTapActivated_; // maintenance-mode to switch DHW off
91+
uint16_t wwMixerTemp_; // mixing temperature
92+
uint16_t wwCylMiddleTemp_; // Cyl middle temperature (TS3)
9393
uint16_t wwSolarTemp_;
9494
uint8_t wwAlternatingOper_; // alternating operation on/off
9595
uint8_t wwAltOpPrioHeat_; // alternating operation, prioritize heat time

src/devices/mixer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void Mixer::process_MMPLUSStatusMessage_HC(std::shared_ptr<const Telegram> teleg
170170
void Mixer::process_MMPLUSStatusMessage_WWC(std::shared_ptr<const Telegram> telegram) {
171171
has_update(telegram, flowTempHc_, 0); // is * 10
172172
has_bitupdate(telegram, pumpStatus_, 2, 0);
173-
has_update(telegram, status_, 11); // temp status
173+
has_update(telegram, status_, 11); // temp status
174174
}
175175

176176
// Mixer IPM - 0x010C
@@ -220,7 +220,7 @@ void Mixer::process_MMStatusMessage(std::shared_ptr<const Telegram> telegram) {
220220
has_update(telegram, flowTempHc_, 1); // is * 10
221221
has_bitupdate(telegram, pumpStatus_, 3, 2); // is 0 or 0x64 (100%), check only bit 2
222222
has_update(telegram, flowSetTemp_, 0);
223-
has_update(telegram, status_, 4); // valve status -100 to 100
223+
has_update(telegram, status_, 4); // valve status -100 to 100
224224
}
225225

226226
/*

src/devices/solar.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,9 @@ void Solar::process_SM100Monitor(std::shared_ptr<const Telegram> telegram) {
685685
has_update(telegram, cylBottomTemp2_, 16); // is *10 - TS5: Temperature sensor 2 cylinder, bottom, or swimming pool
686686
has_update(telegram, heatExchangerTemp_, 20); // is *10 - TS6: Heat exchanger temperature sensor
687687

688-
has_update(telegram, collector2Temp_, 6); // is *10 - TS7: Temperature sensor for collector array 2
689-
has_update(telegram, cylMiddleTemp_, 8); // is *10 - TS14: cylinder middle temperature
690-
has_update(telegram, retHeatAssist_, 10); // is *10 - TS15: return temperature heating assistance
688+
has_update(telegram, collector2Temp_, 6); // is *10 - TS7: Temperature sensor for collector array 2
689+
has_update(telegram, cylMiddleTemp_, 8); // is *10 - TS14: cylinder middle temperature
690+
has_update(telegram, retHeatAssist_, 10); // is *10 - TS15: return temperature heating assistance
691691
}
692692

693693
// SM100wwTemperature - 0x07D6
@@ -749,8 +749,8 @@ void Solar::process_SM100Monitor2(std::shared_ptr<const Telegram> telegram) {
749749
has_update(telegram->read_value(heatCntFlowTemp_, 0)); // is *10
750750
has_update(telegram->read_value(heatCntRetTemp_, 2)); // is *10
751751
has_update(telegram->read_value(heatCnt_, 12));
752-
has_update(telegram->read_value(swapRetTemp_, 6)); // is *10
753-
has_update(telegram->read_value(swapFlowTemp_, 8)); // is *10
752+
has_update(telegram->read_value(swapRetTemp_, 6)); // is *10
753+
has_update(telegram->read_value(swapFlowTemp_, 8)); // is *10
754754
}
755755

756756
#pragma GCC diagnostic push
@@ -879,7 +879,7 @@ void Solar::process_ISM1StatusMessage(std::shared_ptr<const Telegram> telegram)
879879
has_update(telegram, collectorTemp_, 4); // Collector Temperature
880880
has_update(telegram, cylBottomTemp_, 6); // Temperature Bottom of Solar Boiler cyl
881881
uint16_t Wh = energyLastHour_ / 10;
882-
telegram->read_value(Wh, 2); // Solar Energy produced in last hour only ushort, is not * 10
882+
telegram->read_value(Wh, 2); // Solar Energy produced in last hour only ushort, is not * 10
883883
if (energyLastHour_ != Wh * 10) {
884884
energyLastHour_ = Wh * 10;
885885
has_update(&energyLastHour_);

src/devices/solar.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ class Solar : public EMSdevice {
5858
uint32_t energyLastHour_;
5959
uint32_t energyToday_;
6060
uint32_t energyTotal_;
61-
uint32_t pumpWorkTime_; // Total solar pump operating time
62-
uint32_t pump2WorkTime_; // Total solar pump 2 operating time
63-
uint32_t m1WorkTime_; // differential control work time
61+
uint32_t pumpWorkTime_; // Total solar pump operating time
62+
uint32_t pump2WorkTime_; // Total solar pump 2 operating time
63+
uint32_t m1WorkTime_; // differential control work time
6464
uint8_t cylHeated_;
6565
uint8_t collectorShutdown_; // Collector shutdown on/off
6666

0 commit comments

Comments
 (0)