From deafa827fa9a7b9c5445a1ac6a2f601fc7170179 Mon Sep 17 00:00:00 2001 From: Ben Varick Date: Mon, 6 Nov 2023 17:42:51 -0600 Subject: [PATCH] made script loop every 1 minutes --- laundry_status.R | 4 ++-- laundry_status.Rmd | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/laundry_status.R b/laundry_status.R index 8aebb4e..6314139 100644 --- a/laundry_status.R +++ b/laundry_status.R @@ -13,7 +13,7 @@ bucket = "home_assistant" home_assistant <- InfluxDBClient$new(url = "https://influxdb.dendroalsia.net", token = token, org = org) - +update_interval <- 5 # ---- set variables entities <- data.frame(name = c("washing machine", "dryer"), entity_id = c("lamp_a_power", "lamp_b_power")) @@ -62,5 +62,5 @@ update_data <- function(){ for(i in 1:8640){ update_data() - Sys.sleep(60) + Sys.sleep(60*update_interval) } \ No newline at end of file diff --git a/laundry_status.Rmd b/laundry_status.Rmd index d161bef..f3da547 100644 --- a/laundry_status.Rmd +++ b/laundry_status.Rmd @@ -4,6 +4,7 @@ output: html_document --- updated: `r format(Sys.time(), format = "%A %I:%M %p", tz = "America/Chicago")` +this site updates every `r update_interval` minutes ## The washing machine is currently: `r current_status[["lamp_a_power"]]`