check every 2 seconds instead

This commit is contained in:
Emil Lerch 2025-12-16 13:40:08 -08:00
parent 4661ce2354
commit 707998df47
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -529,8 +529,9 @@ pub fn main() !void {
try stdout.print("⏳ Waiting up to 20 seconds for device to respond...\n", .{});
try stdout.flush();
for (0..4) |i| {
std.Thread.sleep(5 * std.time.ns_per_s);
const max = 10;
for (0..10) |i| {
std.Thread.sleep((20 / max) * std.time.ns_per_s);
var post_command_state = try getRecirculationStatus(
allocator,
@ -539,7 +540,7 @@ pub fn main() !void {
);
defer post_command_state.deinit();
const enabled = post_command_state.recirculation_enabled != null and post_command_state.recirculation_enabled.?;
if (i == 4 or enabled) {
if (i == 10 or enabled) {
try stdout.print("\n{f}", .{post_command_state});
if (enabled)
try stdout.writeAll("\n👍 Recirculation enabled!\n");