adjust time zone and labels

This commit is contained in:
Ben Varick 2023-11-06 18:21:26 -06:00
parent 181568487a
commit c1f85fc524
Signed by: ben
SSH Key Fingerprint: SHA256:jWnpFDAcacYM5aPFpYRqlsamlDyKNpSj3jj+k4ojtUo
2 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,8 @@ update_data <- function(){
status = ifelse(value > 1, "on", "off")) %>%
mutate(end_time = time + minutes(1))
washer_last_on <- values %>% filter(entity_id == entities$entity_id[1], value > 5) %>% tail(1) %>% pull(time)
washer_last_off <- values %>% filter(entity_id == entities$entity_id[1], value < 5) %>% tail(1) %>% pull(time)
# ---- generate html
current_status <- as.list(NULL)
for (entity in entities$entity_id){

View File

@ -8,7 +8,7 @@ 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"]]`
The washing machine `r ifelse(current_status$lamp_a_power=="on", "started", "ended")` its most recent cycle at `r format(ifelse(current_status$lamp_a_power=="on", washer_last_on, washer_last_off), format = "%A %I:%M %p", tz = "America/Chicago")`
## The dryer is currently: `r current_status[["lamp_b_power"]]`
--------