first commit
This commit is contained in:
parent
1908432345
commit
3c1e9de4bf
|
|
@ -85,10 +85,10 @@ class _RecordingScreenState extends State<RecordingScreen> {
|
|||
await SupabaseService().updateIntervalSetting(intervalVal);
|
||||
// Kirim interval ke ESP32 via MQTT
|
||||
mqtt.setIntervalFoto(intervalVal);
|
||||
// Trigger foto pertama langsung
|
||||
mqtt.triggerFoto();
|
||||
setState(() => _isRecording = true);
|
||||
} else {
|
||||
// Kirim stop ke ESP32 Dev via MQTT
|
||||
mqtt.setIntervalFoto(0);
|
||||
setState(() => _isRecording = false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -139,8 +139,13 @@ class MqttService extends ChangeNotifier {
|
|||
}
|
||||
|
||||
// Kirim interval foto dalam menit
|
||||
// Kirim 0 untuk stop
|
||||
void setIntervalFoto(int menit) {
|
||||
_publish("kopi/setting/interval", menit.toString());
|
||||
if (menit == 0) {
|
||||
_publish("kopi/setting/interval", "0");
|
||||
} else {
|
||||
_publish("kopi/setting/interval", menit.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger foto manual
|
||||
|
|
|
|||
Loading…
Reference in New Issue