Status Logic fixed...
This commit is contained in:
parent
48bff4adba
commit
44dbd78e1a
@ -30,8 +30,8 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<script>
|
<script>
|
||||||
$.getJSON("https://status.chaospott.de/status.json").done(function(data) {
|
$.getJSON("https://newstatus.chaospott.de/api").done(function(data) {
|
||||||
if(data.state.open) {
|
if(!data.sensors.door_locked[0].value || !data.sensors.door_locked[1].value ) {
|
||||||
$( "#status_open" ).css( "display", "block" );
|
$( "#status_open" ).css( "display", "block" );
|
||||||
$( "#status_bar" ).css( "borderColor", "#5CB85C" );
|
$( "#status_bar" ).css( "borderColor", "#5CB85C" );
|
||||||
} else {
|
} else {
|
||||||
|
@ -256,7 +256,7 @@ layout: default
|
|||||||
|
|
||||||
var currentStreak = Math.floor(Date.now() / 1000) - data.state.lastchange;
|
var currentStreak = Math.floor(Date.now() / 1000) - data.state.lastchange;
|
||||||
|
|
||||||
if(data.state.open) {
|
if(!data.sensors.door_locked[0].value || !data.sensors.door_locked[1].value ) {
|
||||||
$( "#status td:last" ).html("open");
|
$( "#status td:last" ).html("open");
|
||||||
$( "#status" ).addClass( 'success' );
|
$( "#status" ).addClass( 'success' );
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user