Skip to content

Commit e5438a7

Browse files
quick fix
1 parent 1cec79c commit e5438a7

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

controller/tea_poor/lib/Arduino/RemoteControl.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,14 @@ void RemoteControl::reconnect() {
9696
}
9797

9898
void RemoteControl::process() {
99-
if(WL_CONNECTED != WiFi.status()) {
99+
const auto status = WiFi.status();
100+
// TODO: verify if this is the correct way to detect if we need to reconnect
101+
const bool needsReconnect = (
102+
(WL_CONNECT_FAILED == status) ||
103+
(WL_CONNECTION_LOST == status) ||
104+
(WL_DISCONNECTED == status)
105+
);
106+
if(needsReconnect) {
100107
reconnect();
101108
return; // wait for next tick, just to be sure that all is ok
102109
}

ui/src/components/SystemControls.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import { useWaterPumpAPI } from '../contexts/WaterPumpAPIContext';
66
import { startPump, stopPump } from '../store/slices/SystemStatus.js';
77

88
export function SystemControlsComponent({
9-
pouringTime, systemStatus, startPump, stopPump
9+
pouringTime, powerLevel, systemStatus, startPump, stopPump
1010
}) {
1111
const api = useWaterPumpAPI().API;
1212
const handleStart = async () => {
13-
await startPump({ api , pouringTime });
13+
await startPump({ api, pouringTime, powerLevel });
1414
};
1515

1616
const handleStop = async () => {
@@ -33,6 +33,7 @@ export function SystemControlsComponent({
3333
export default connect(
3434
state => ({
3535
pouringTime: state.UI.pouringTime,
36+
powerLevel: state.UI.powerLevelInPercents,
3637
systemStatus: state.systemStatus,
3738
}), { startPump, stopPump }
3839
)(SystemControlsComponent);

0 commit comments

Comments
 (0)