AlexGustafsson / homebridge-wol

A Wake on Lan plugin for Homebridge
MIT License
301 stars 30 forks source link

Refactor ping callback function to allow Shutting Down to complete #33

Closed cr3ative closed 6 years ago

cr3ative commented 6 years ago

Hi, as noted in https://github.com/AlexGustafsson/homebridge-wol/issues/31 the current master can't transition a device from Shutting Down to Offline.

I've refactored the logic in pingerCallback to be maybe slightly too verbose, but you can follow the logic flow hopefully a little easier now. The debounce logic is preserved with simple returns.

And as a bonus, my computer can successfully go offline now! 🎉

cr3ative commented 6 years ago

Sorry, didn't spot the conventions file. Updated to pass tests.

AlexGustafsson commented 6 years ago

Hey!

Update on the merge taking too long. I’ve been unable to thoroughly test your changes and I made the (in hindsight faulty) decision to wait until I hade the time.

I’ve not had any intention to stop supporting this project. I understand your decision in fixing the issues in your own repository - however, would you like to be a contributor to this repository and merge the changes yourself?

I’ve had another user help the repository earlier and I think your support would be just as welcome to me and existing users.

cr3ative commented 6 years ago

Sure, can do! Nothing here should rock the boat too much and it'd be nice to get back on your master branch :)

AlexGustafsson commented 6 years ago

Great!

Before you merge, I usually prefer squashing merges on github.

cr3ative commented 6 years ago

Can do, I'll revert/re-version package.json too. I've not published to npm before - is that automatic or do you press a button?

AlexGustafsson commented 6 years ago

So far I've bumped the semantic version number before pushing it to NPM manually. I can push when you've merged. If you have a NPM username I can add you as a collaborator there as well.

cr3ative commented 6 years ago

Great, I've bumped a minor version and squashed/rebased. I don't have an npm username so no worries there! <3