Git Product home page Git Product logo

Comments (6)

AlexGustafsson avatar AlexGustafsson commented on May 14, 2024

You’re absolute correct. I’m a at fault for not documenting the regression better. This is actually one of the main reason that I’ve not yet pushed 3.3.

The wake command is intended to execute after the wake grace time and it should be done so in any published version.

I’m sorry for any inconvenience this might have caused. I’ll add a note on the current state of the master branch in the README.

If you’ve got the time, you’re free to post a PR and I’ll accept it. Make sure that this.config.wakeGraceTime has a sane default (set in the constructor).

from homebridge-wol.

BTPankow avatar BTPankow commented on May 14, 2024

No problem, thanks for the quick response! I initially noticed it on the npm version, and it seems to be in the 3.2.4 tagged version, so it made me question if I was misinterpreting things. (https://github.com/AlexGustafsson/homebridge-wol/blob/ver-3.2.4/lib/network-device.js#L156 looks like the wakeCommand is executed right after wol)

I'd be happy to get a PR together for this soon.

One question about wakeCommand I have: is it something we'd want to execute after the system has been seen as "on"? In my case, I'd prefer not to wait for the entire wakeGraceTime if the host computer is already on, but I'm not sure if that is the same for other use cases.

For example, I was thinking that the wakeGraceTime would be useful as a grace time after the machine has first been booted to give it time to set things up (like ssh). If the machine is already on then I'd prefer to not wait for a long wakeGraceTime that incorporates the entire boot time. Plus, I'd have a better chance of timing the wakeCommand correctly in case the machine takes extra long to boot up.

Basically, this is the logic I would be interested in:

  1. Try to wake up machine (if mac specified)
  2. Wait for computer to be "online" (if pingCommand or ip specified)
  3. Wait for wakeGraceTime
  4. Execute wakeCommand

Of course, this would kind of change the definition of the wakeGraceTime, so I could see leaving it be. However, this would be a useful program flow for my purposes and possibly other use cases.

from homebridge-wol.

AlexGustafsson avatar AlexGustafsson commented on May 14, 2024

Hi! Sorry for missing your comment / responding so late.

You're still welcome to open a PR. Implement it the way you'd like, but try to make it additive so that the previous behavior still works. Perhaps a helloCommand or something similar would be in order?

from homebridge-wol.

AlexGustafsson avatar AlexGustafsson commented on May 14, 2024

There's now an untested update to the code where the wake command should be called after the wait grace time.

from homebridge-wol.

AlexGustafsson avatar AlexGustafsson commented on May 14, 2024

I've gone ahead and published 3.2.5 which should contain a fix for this issue.

from homebridge-wol.

AlexGustafsson avatar AlexGustafsson commented on May 14, 2024

Closing as this should work now.

from homebridge-wol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.