Skip to content

Commit

Permalink
Improve device discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
rvetere committed Feb 11, 2024
1 parent 9b0971e commit 6013829
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions homebridge-ui/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,23 @@
document.getElementById('pageAdvanced').style.display = 'none'
document.getElementById('pageDevices').style.display = 'block'

const pluginConfig = await homebridge.getPluginConfig();
const config = pluginConfig.length ? pluginConfig[0] : {};
if (
!config.loxoneMiniServerId ||
!config.loxoneUser ||
!config.loxonePassword
) {
const innerHTML = `
<li style="display: flex; align-items: center;">
<div style="width: 100%; background: rgba(255, 0, 0, 0.35); color: white; text-align: center; padding: 9px;">
<strong>Setup must be completed to unlock device discovery</strong>
</div>
</li>`;
document.querySelector('#discoveredDevices').innerHTML = innerHTML;
return;
}

const response = await fetch(`${urlPrefix}/discoverDevices`);
const discoverDevices = await response.json();
await renderDevices(discoverDevices);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Homebridge Loxone Control",
"name": "homebridge-loxone-control",
"version": "1.1.0",
"version": "1.2.0",
"description": "Homebridge plugin to control a loxone system trough the web-interface - useful if you have zero access to the Miniserver",
"license": "Apache-2.0",
"repository": {
Expand Down

0 comments on commit 6013829

Please sign in to comment.