-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
executable file
·93 lines (63 loc) · 2.74 KB
/
demo.html
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<!--Import Google Icon Font-->
<link href="css/icon.css" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script>
</script>
</head>
<body>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
<script type="text/javascript">
var apiEndPoint="https://192.168.0.101";
if(window.location.origin !== apiEndPoint && window.location.origin !== "http://127.0.0.1:8080") {
apiEndPoint = window.location.origin;
};
$(function() {
$.get(apiEndPoint+"/json.htm?type=command¶m=getuservariables", function( data ) {
$( "#consigneConfortZoneJour" ).html( data.result[0].Value+'°C' );
$( "#consigneEcoZoneJour" ).html( data.result[1].Value+'°C' );
$( "#consigneZoneJour" ).html( data.result[2].Value+'°C' );
$("#consigneConfortZoneJour").removeClass("new green");
$("#consigneEcoZoneJour").removeClass("new green");
if(data.result[0].Value === data.result[2].Value) {
$("#consigneConfortZoneJour").addClass("new green");
$("#consigneEcoZoneJour").addClass("badge");
} else {
$("#consigneEcoZoneJour").addClass("new green");
$("#consigneConfortZoneJour").addClass("badge");
}
});
$.get(apiEndPoint+"/json.htm?type=devices&filter=temp&used=true&order=Name&plan=0", function(data){
$( "#temperatureZoneJour" ).html( data.result[0].Temp+'°C' );
$( "#hygrometrieZoneJour" ).html( data.result[0].Humidity+'% ' + data.result[0].HumidityStatus);
});
});
</script>
<div class="container">
<div class="row">
<div class="col s12 m6 l6 z-depth-1" style="margin-top:1em">
<div class="center"><span style="font-size:2em">Zone Jour</span>
<div class="row">
<div class="col s9">
<div id="temperatureZoneJour" style="font-weight:lighter; font-size:3em; color:#f9a825"></div>
<div id="hygrometrieZoneJour" style="font-weight:lighter; color:#64B5F6"></div>
</div>
<div class="col s3">
<span data-badge-caption="" class="badge" style="position:relative" id="consigneConfortZoneJour"></span>
<span data-badge-caption="" class="badge" style="position:relative" id="consigneEcoZoneJour"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>