first commit

This commit is contained in:
M.Nizar Fahrurrozi 2026-05-10 22:45:54 +07:00
parent 1908432345
commit 3c1e9de4bf
2 changed files with 8 additions and 3 deletions

View File

@ -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);
}

View File

@ -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