Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for custom port #264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
@@ -76,6 +76,12 @@
"type": "string",
"required": false
},
"port": {
"title": "Port",
"description": "The target port to send packet to. Defaults to 9",
"type": "number",
"required": false
},
"broadcastAddress": {
"title": "Broadcast address",
"description": "The broadcast address to use when sending the Wake on LAN packet, such as 172.16.1.255.",
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ export class NetworkDeviceConfig {
pingCommandTimeout = 0;

mac: string | null = null;
port = 9;
broadcastAddress: string | null = null;
startCommand: string | null = null;
startCommandTimeout = 0;
@@ -75,6 +76,7 @@ export class NetworkDeviceConfig {
1000;

this.mac = this.getString(config, "mac", this.mac);
this.port = this.getNumber(config, "port", this.port);
this.broadcastAddress = this.getString(
config,
"broadcastAddress",
1 change: 1 addition & 0 deletions src/network-device.ts
Original file line number Diff line number Diff line change
@@ -176,6 +176,7 @@ export default class NetworkDevice {
try {
await wake(this.config.mac, {
address: this.config.broadcastAddress as string | undefined,
port: this.config.port
});
} catch (error) {
this.log.error(