Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Commit

Permalink
Housekeeping.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdhjd committed Sep 15, 2023
1 parent 1b6d949 commit 081dbbd
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions homebridge-ui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,25 @@ class PluginUiServer extends HomebridgePluginUiServer {
error: (message, parameters = []) => {

// Save the error to inform the user in the webUI.
this.errorInfo = util.format(message, ...parameters);
console.log(this.errorInfo);
if(!!parameters?.[Symbol.iterator]) {

this.errorInfo = util.format(message, ...parameters);
} else {

this.errorInfo = util.format(message, parameters);
}

console.error(this.errorInfo);
},
info: (message, parameters) => {},
warn: (message, parameters = []) => console.log(util.format(message, ...parameters))
warn: (message, parameters = []) => {}
};

// Connect to the myQ API.
const myQ = new myQApi(myQCredentials.email, myQCredentials.password, log, myQCredentials.myQRegion);
const myQ = new myQApi(log);

// Retrieve the list of myQ devices.
if(!(await myQ.refreshDevices())) {
if(!(await myQ.login(myQCredentials.email, myQCredentials.password))) {

// Either invalid login credentials or an API issue has occurred.
return [ -1 ];
Expand Down

0 comments on commit 081dbbd

Please sign in to comment.