Skip to content

Commit

Permalink
get port from deCONZ discovering service
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane committed Aug 20, 2021
1 parent b28e0ad commit 7a548d9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions octoprint_phom/templates/ophom_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,28 @@ Hue Bridge Status: <span id="ophom_generalstatus" class="badge badge-danger" sty
document.getElementById("ophom_searchbridgestatus").appendChild(select);
data.forEach(element => {
if(element.internalport == undefined)
{
element.internalport = 80;
}
var option = document.createElement("option");
option.value = element.internalipaddress;
option.text = element.internalipaddress;
option.value = element.internalipaddress + ":" + element.internalport;
option.text = element.internalipaddress + ":" + element.internalport;
select.appendChild(option);
})
document.getElementById("ophom_bridgefound").style.display = "";
}
else
{
bridge_ip_address = data[0].internalipaddress;
if(data[0].internalport == undefined)
{
data[0].internalport = 80;
}
bridge_ip_address = data[0].internalipaddress + ":" + data[0].internalport;
search_button.innerHTML = '<i class="fa fa-search"></i> Search my bridge';
search_button.disabled = false;
document.getElementById("ophom_searchbridgestatus").style.display = "";
document.getElementById("ophom_searchbridgestatus").innerHTML = "<font color='green'>Brige found (<i>"+ data[0].internalipaddress+"</i>) !</font>";
document.getElementById("ophom_searchbridgestatus").innerHTML = "<font color='green'>Brige found (<i>"+ data[0].internalipaddress+ ":" + data[0].internalport + "</i>) !</font>";
document.getElementById("ophom_bridgefound").style.display = "";
}
});
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
plugin_name = "Ophom"

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
plugin_version = "1.4.1"
plugin_version = "1.4.2"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit 7a548d9

Please sign in to comment.