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

Use hostname instead of IP with -d flag #68

Open
agc93 opened this issue Jan 7, 2018 · 4 comments
Open

Use hostname instead of IP with -d flag #68

agc93 opened this issue Jan 7, 2018 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@agc93
Copy link

agc93 commented Jan 7, 2018

When connecting to a specific PS4 using the -d flag, it would be helpful to support using a hostname rather than only an IP address. Is this something you'd consider?

@dhleong dhleong added the help wanted Extra attention is needed label Jan 7, 2018
@dhleong
Copy link
Owner

dhleong commented Jan 7, 2018

The -d flag is used here: https://github.com/dhleong/ps4-waker/blob/master/bin/cmd.js#L156

It looks like we do get some info about the device in addition to the IP address from which it broadcasted its response to our query, so it's probably possible to filter on that. In fact it may even be as simple as adding another "or" there with something like || device['host-name'] === argv.device. However this may not be the network hostname, but rather just the device's label. I'm not sure what all would be involved in resolving a network hostname, if that's what you're wanting.

I only have one device myself so I probably won't get to this anytime soon, but I would welcome a PR ;)

@agc93
Copy link
Author

agc93 commented Jan 8, 2018

I unfortunately also only have the one, and I'm none too swift with the JS unfortunately :P

I was using the home-assistant component that leverages this tool and it requires a static IP because reasons I guess. I've modified that component as a workaround for now.

@jcconnell
Copy link

@agc93, how did you modify the component to use a hostname? Was your issue related to having ps4-waker and home-assistant in different subnets? This is the problem I'm trying to solve at the moment.

@agc93
Copy link
Author

agc93 commented Jan 10, 2018

@jcconnell I've only got the one PS4 so I just removed the -d flag entirely from the _run method (around line 310) and put a fake value in to fool the config validation.

I have my PS4 and HA in the same subnet, just it's on DHCP so the IP would change.

@dhleong dhleong added the enhancement New feature or request label Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants