2018-08-02 17:18:12 +00:00
|
|
|
<?php
|
|
|
|
$options = array(
|
|
|
|
'http' => array(
|
|
|
|
'method' => 'GET',
|
|
|
|
'header' => 'x-ha-access: nXa7LiR1PG'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$context = stream_context_create($options);
|
|
|
|
$data = json_decode(file_get_contents("http://192.168.0.25:8123/api/states", false, $context), true);
|
|
|
|
|
|
|
|
foreach($data as $item) {
|
|
|
|
$output[$item["entity_id"]] = $item;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8" />
|
2018-08-06 21:25:31 +00:00
|
|
|
<link href="//fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
|
2018-08-02 17:18:12 +00:00
|
|
|
<style type="text/css">
|
2018-08-06 21:25:31 +00:00
|
|
|
* {box-sizing: border-box; margin: 0; border: 0; padding: 0; font-family: 'Open Sans', sans-serif; font-weight: 400; text-align: center;}
|
2018-08-02 17:18:12 +00:00
|
|
|
html, body {height: 100%; min-height: 100%;}
|
|
|
|
body {background-color: #333333;}
|
2018-08-06 21:25:31 +00:00
|
|
|
p {font-size: 5vh; color: #FFFFFF; opacity: 0.5;}
|
|
|
|
h1 {font-size: 14vh; color: #FFFFFF;}
|
|
|
|
#container {width: 100%; height: 100%; border: 1.5vw solid #333333; background: linear-gradient(135deg, #a25cbf 0%,#009cde 100%);}
|
2018-08-02 23:17:40 +00:00
|
|
|
#centered {position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);}
|
2018-08-02 17:18:12 +00:00
|
|
|
</style>
|
|
|
|
<body>
|
2018-08-02 23:17:40 +00:00
|
|
|
<div id="container">
|
|
|
|
<div id="centered">
|
|
|
|
<p>Where tf is Jason?</p>
|
2018-08-06 21:25:31 +00:00
|
|
|
<h1><? echo ($output['device_tracker.jasonsphone_jason']['state'] == 'away') ? 'Nobody Knows' : 'At '.ucwords($output['device_tracker.jasonsphone_jason']['state']); ?></h1>
|
2018-08-02 23:17:40 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-08-02 17:18:12 +00:00
|
|
|
</body>
|
|
|
|
</html>
|