Allow set_warmth to accept minutes, making for a more gradual change in temperature.

This commit is contained in:
Mid Favila 2022-03-08 21:28:07 -04:00
parent 9b3d85b3ba
commit 52a92af54e
1 changed files with 9 additions and 6 deletions

View File

@ -1,11 +1,14 @@
#!/bin/sh -e #!/bin/sh -e
# Get current hour.
x=$(date|cut -f5 -d' '|cut -f1 -d:) x=$(date|cut -f5 -d' '|cut -f1 -d:)
brownout $(bc -e "define redlevel(x) { # Get current minute.
if((x-12) <= 0) y=$(date|cut -f5 -d' '|cut -f2 -d:)
return((83*(12-x)))
else
return((83*(x-12)))
} redlevel($x)")
brownout $(bc -e "define redlevel(x,y) {
if((x-12) <= 0)
return((83*(12-x)+(y*(83/60))))
else
return((83*(x-12)+(y*(83/60))))
} redlevel($x, $y)")