iobroker.homeconnect
Version:
Adapter for Homeconnect devices
229 lines (201 loc) • 9.59 kB
HTML
<html>
<head>
<!-- these 4 files always have to be included -->
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
<!-- these files always have to be included -->
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
<script type="text/javascript" src="words.js"></script>
<style>
.m .col .select-wrapper+label {
top: -26px;
}
.m span {
font-size: 0.9em;
}
.m .page {
height: calc(100% - 50px);
}
/* Only for Firefox */
@supports (-moz-appearance: none) {
.m .page {
height: calc(100vh - 50px);
}
}
/* Style for small Screens */
@media screen and (max-width: 600px) {
.m .page {
height: calc(100% - 10px);
}
.breaks {
overflow-wrap: break-word;
}
/* Only for Firefox */
@supports (-moz-appearance: none) {
.m .page {
height: calc(100vh - 20px);
}
}
}
</style>
<!-- you have to define 2 functions in the global scope: -->
<script type="text/javascript">
// the function loadSettings has to exist ...
function load(settings, onChange) {
// example: select elements with id=key and class=value and insert value
if (!settings) return;
if (settings.scope === undefined) settings.scope =
"IdentifyAppliance%20Monitor%20Settings%20Dishwasher-Control%20Washer-Control%20Dryer-Control%20CoffeeMaker-Control%20Hood-Control%20CleaningRobot-Control";
$('.value').each(function () {
var $key = $(this);
var id = $key.attr('id');
if ($key.attr('type') === 'checkbox') {
// do not call onChange direct, because onChange could expect some arguments
$key.prop('checked', settings[id]).on('change', function () {
onChange();
});
} else {
// do not call onChange direct, because onChange could expect some arguments
$key.val(settings[id]).on('change', function () {
onChange();
}).on('keyup', function () {
onChange();
});
}
});
onChange(false);
M
.updateTextFields(); // function Materialize.updateTextFields(); to reinitialize all the Materialize labels on the page if you are dynamically adding inputs.
}
// ... and the function save has to exist.
// you have to make sure the callback is called with the settings object as first param!
function save(callback) {
// example: select elements with class=value and build settings object
var obj = {};
$('.value').each(function () {
var $this = $(this);
if ($this.attr('type') === 'checkbox') {
obj[$this.attr('id')] = $this.prop('checked');
} else {
obj[$this.attr('id')] = $this.val();
}
});
callback(obj);
}
</script>
</head>
<body>
<!-- you have to put your config page in a div with id adapter-container -->
<div class="m adapter-container">
<div class="row">
<div class="col s12">
<ul class="tabs">
<li class="tab col s2"><a href="#tab-main" class="translate active">Main settings</a></li>
</ul>
</div>
<!-- Forms are the standard way to receive user inputted data.
Learn more http://materializecss.com/forms.html-->
<div id="tab-main" class="col s12 page">
<div class="row">
<div class="input-field col s6">
<img src="homeconnect.png" class="logo">
</div>
</div>
<div class="row">
<div class="col s12">Schritt #1: Anmelden für Client ID.<br> Default Home Connect User Account for
Testing = Deine E-Mail in der HomeConnect App. <br>Account Type = Individual</div>
</div>
<div class="row">
<div class="col s4">
<a type="button" id="getClintIDButton" class="btn float-buttons"
href="https://developer.home-connect.com/user/register" target="_blank">Schritt #1
Registrieren</a>
</div>
</div>
<div class="row">
<div class="col s12">Schritt #2: Registrieren der ioBroker App. <br>Application ID = ioBroker.
<br>OAuth
Flow = Device Flow. <br>Default Home Connect User Account for Testing = Deine E-Mail in der
HomeConnect App.
</div>
</div>
<div class="row">
<div class="col s4">
<a type="button" id="getClintIDButton" class="btn float-buttons"
href="https://developer.home-connect.com/applications" target="_blank">Schritt #2 Erzeuge
App für Client ID</a>
</div>
</div>
<div class="row">
<div class="col s12">Schritt #3: App aktiviern<br>Hier Client ID einfügen. <br>Homeconnect App Email
und Password eingeben <br>Speichern und
schließen drücken</div>
</div>
<div class="row">
<div class="col s12">
<input class="value" id="username" type="text" />
<label for="username" class="translate">App Email</label>
</div>
</div>
<div class="row">
<div class="col s12">
<input class="value" id="password" type="password" />
<label for="password" class="translate">App Password</label>
</div>
</div>
<div class="row">
<div class="col s12">
<input class="value" id="clientID" size="60" maxlength="96" />
<label for="clientID" class="translate">Client ID</label>
</div>
</div>
<div class="row">
<div class="col s2">
<input class="value" id="resetAccess" type="checkbox" />
<label class="translate" for="resetAccess">Zugang/Token zurücksetzen </label>
</div>
</div>
<div class="row">
<div class="col s6">
<input class="value" id="disableFetchConnect" type="checkbox" />
<label class="translate" for="disableFetchConnect">Deaktiviere Programme holen bei bei
Verbindungsaufbau (reduziert rate limit)</label>
</div>
</div>
<div class="row">
<div class="col s12 breaks">
<p>
<h5>Benutzung:</h5>
<br> Mit den states in commands kannst du das Programm stoppen, pausiren oder fortführen.
<br> Mit den states in settings kannst du das Gerät ein oder ausschalten.
<br> Ändern des States programs.active.BSH_Common_Root_ActiveProgram führt zum starten eines
Programms
<br> Ändern des States programs.selected.BSH_Common_Root_SelectedProgram führt zum auswählen
des
Programms oder Optionen
</p>
<p>
<h5>Usage:</h5>
<br> With the states in commands you can stop, pause and resume a program.
<br> With the states in settings you can turn off or turn on the device
<br> Change the value of programs.active.BSH_Common_Root_ActiveProgram leads to starting a
program
<br> Change the value of programs.selected.BSH_Common_Root_SelectedProgram leads to
selecting a
program or options
</p>
</div>
</div>
<div class="row">
<div class="col s12">
<p class="translate">on save adapter restarts with new config immediately</p>
</div>
</div>
</div>
</div>
</body>
</html>