Skip to content

Commit

Permalink
Fix no connection on new installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jey-Cee committed Oct 4, 2024
1 parent ec5da8f commit 9b6886d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 14 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2256,13 +2256,24 @@ function nameFilter(name) {
*/
async function getDeviceByID(deviceID, type) {}

/**
* Retrieves gateway parameters including IP address, port, and user.
* Fetches the information from an adapter object named "Gateway_info".
* If any parameter is missing, it defaults to "none".
*
* @return {Promise<Object>} A promise that resolves to an object containing the gateway parameters.
* The object includes the properties:
* - ip: {string} The IP address of the gateway.
* - port: {string} The port of the gateway.
* - user: {string} The user of the gateway.
*/
async function getGatewayParam() {
const results = await adapter.getObjectAsync("Gateway_info");
if (results) {
return {
ip: results.native.ipaddress ? results.native.ipaddress : "none",
port: results.native.port ? results.native.port : "none",
user: results.native.user ? results.native.user : "none",
ip: adapter.config.bridge ? adapter.config.bridge : "none",
port: adapter.config.port ? adapter.config.port : "none",
user: adapter.config.user ? adapter.config.user : "none",
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b6886d

Please sign in to comment.