-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlr_sp2.php
More file actions
executable file
·51 lines (40 loc) · 1.49 KB
/
lr_sp2.php
File metadata and controls
executable file
·51 lines (40 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Lights</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<link rel="apple-touch-icon" href="msc_icon.png" />
<style type="text/css" media="screen">@import "iui/iui.css";</style>
<script type="application/x-javascript" src="iui/iui.js"></script>
</head>
<body>
<?php
// Sleep Protocol 2. For only the living room, dim orange (like sunset) to be a visual reminder of what time it is
// I'm a clever monkey. Let's make sure the lights are already on. If not, NOOP.
// For reference, id 14 is one of the bulbs in the big dragonfly floor lamp.
include 'functions.php';
$force = FALSE;
if(isset($_GET['force'])) $force = TRUE;
$lightlist = array(11,12,13,14,15,28,29,39);
$bri = 16;
if (isOn(14) || $force){
foreach($lightlist as $id){
sp2_on($id);
}
setLevel(28,$bri);
setLevel(29,$bri);
setLevel(39,$bri);
oneOff(17);
oneOff(20);
oneOff(35);
$output = `/usr/bin/env curl -s http://max.kenkl.org/lights/lrdloff.php`;
}
// 20-Oct-2019: A thought... If I'm in my office gaming, I won't get the visual cue in the LR. So, let's check the office too...
if (isOn(21)){
$output = `/usr/bin/env curl -s http://max.kenkl.org/lights/hosp2.php`;
}
if(strpos($_SERVER['HTTP_USER_AGENT'], 'WebKit')) header('Location: ' . $_SERVER['lr_sp2.php']);
?>
</body>
</html>