Skip to content

Commit

Permalink
fix: improved error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jasper-seinhorst committed Mar 6, 2024
1 parent b54ae2e commit 6d9baff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
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.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Homebridge Homewizard Power Consumption",
"name": "homebridge-homewizard-power-consumption",
"version": "1.2.0",
"version": "1.3.0",
"description": "See current power consumption or power return in Homekit",
"license": "Apache-2.0",
"author": "Jasper Seinhorst",
Expand All @@ -25,6 +25,7 @@
},
"keywords": [
"homebridge-plugin",
"homebridge",
"Homewizard",
"Eco",
"Power consumtion",
Expand Down
7 changes: 4 additions & 3 deletions src/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class HomewizardPowerConsumption implements DynamicPlatformPlugin {

private async initialise() {
if (!this.validateConfig()) {
this.log.warn('Please provide P1\'s IP address');
this.log.error('Configuration error. Please provide your Wi-Fi P1 meter\'s IP address');
return;
}

Expand Down Expand Up @@ -86,9 +86,10 @@ export class HomewizardPowerConsumption implements DynamicPlatformPlugin {
this.devices.forEach((device: HomewizardPowerConsumptionAccessory) => {
device.beat(consumption);
});
this.log.debug('heartbeat', consumption);
} catch(error) {
this.log.error('Something went wrong');
this.log.error(error);
this.log.error('Something went wrong, please double check the Wi-Fi P1 meter\'s IP address');
this.log.debug(error);
}
}
}

0 comments on commit 6d9baff

Please sign in to comment.