homebridge-androidtv
Version:
Homebridge plugin to control your AndroidTV / Freebox Player Pop / Freemox Mini 4k
75 lines (70 loc) • 4.52 kB
HTML
<html>
<head>
<title>Homebridge AndroidTV Plugin</title>
<script src="https://unpkg.com/vue@3.2.6"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</head>
<body>
<div style="text-align: center"><h1 class="display-6 text-white" style="background-color: #421367">AndroidTV Homebridge Plugin</h1></div>
<div id="devices_list" class="container-fluid" >
<div class="alert alert-warning m-auto" role="alert" style="width: 30rem; text-align: center" v-if="devices_length === 0">
<h1>Oops !</h1>
<hr>
<h6>It seems that no AndroidTV is connected and powered on this network</h6>
<i class="bi bi-power text-warning" style="font-size: 3rem;"></i>
</div>
<table class="table table-striped" v-if="devices_length > 0">
<thead>
<tr>
<th v-for="column in columns" scope="col" style="text-align: center"> {{ column }}</th>
<th style="text-align: center">actions</th>
</tr>
</thead>
<tbody>
<tr v-for="device in devices">
<td v-for="key in columns">
<div v-if="key === 'host' || key === 'name' || key === 'app_package_current'">
{{device[key]}}
</div>
<div v-if="key === 'online' || key === 'paired' || key === 'started' || key === 'powered'" style="text-align: center;">
<i class="bi bi-check-circle text-success" style="font-size: 1.5rem;" v-if="device[key] === true"></i>
<i class="bi bi-x-circle text-danger" style="font-size: 1.5rem;" v-if="device[key] === false"></i>
</div>
<div v-if="key === 'type'" style="text-align: center">
<select v-model="device.type" v-on:change="set_type(device)">
<option v-for="type in types" v-bind:value="type.value">
{{ type.text }}
</option>
</select>
</div>
</td>
<td style="text-align: center">
<button class="btn btn-primary btn-sm" v-on:click="pair(device)" v-if="device.online && !device.paired && !device.pairing">Pair</button>
<button class="btn btn-danger btn-sm" v-on:click="unpair(device)" v-if="!device.online && device.paired">Unpair</button>
<button class="btn btn-warning btn-sm" v-on:click="power(device)" v-if="device.started">Power</button>
<div class="row" v-if="device.pairing">
<div class="col-sm-4">
<input class="form-control form-control-xs" id="floatingInput" v-model="code" v-on:keyup.enter="send_code(device)" placeholder="Code"/>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-primary btn-sm" v-on:click="send_code(device)">Send</button>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<div id="info" class="alert alert-primary m-auto" role="alert" style="width: 30rem; text-align: center" v-if="devices_length > 0">
<!--<span class="badge bg-primary rounded-pill" style="font-size: 1.2em;">Info</span> -->
<h4 class="alert-heading">Information</h4>
<hr>
<p>Please note that after restarting Homebridge while your devices are turned off, your devices will remain unavailable until you turn them on manually.</p>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.24.0/axios.js"></script>
<script src="index.js" charset="utf-8" ></script>
</body>
</html>