konsumer / tplink-lightbulb

Control TP-Link smart lightbulbs from nodejs
MIT License
190 stars 32 forks source link

bright, status, .editorconfig #14

Closed Gregory-K closed 6 years ago

Gregory-K commented 6 years ago

"bright" command -- set only brightness without setting the bulb on "status" command -- return the bulb's light state .editorconfig coding style -- misc additions to .gitignore

konsumer commented 6 years ago

Hi, Thanks for the contribution.

A few things:

Gregory-K commented 6 years ago

Hi, nice to talk to.

First, I am admitting that this pull request was a late hours mistake.

Thanks for listening to me ... now we can close this pull request :)

forgot to mention: transitions are actually in milliseconds and not seconds (talking about the command examples)

konsumer commented 6 years ago

Totally understand , I have made many late-night PRs myself. 😄

Maybe we should include something about standard in readme/scripts to help people follow the style. As I said, I just configure my editor, but it should probly be documented somewhere, in the very least. I made an issue for myself: #15

For details, I see your point, but I might recommend jq It does nice syntax-highlighting, let's you pull out just the parts of JSON you want, and lets you do -r (raw) to pull out a value and use it in other things (I use this for bash scripts, etc.) Lately, I have been using it for all kinds of things (it's rad with aws cli tools, for example,) it's really handy.

I see your use-case for bright, but the bulb only changes state with on/off message, so maybe we could just give off all the same params, so you can set them either way. I made an issue for myself: #16

Thanks again for your contribution. Happy to work on these things, I think they are good suggestions.

Gregory-K commented 6 years ago

Thanks for the follow up.

I most certainly will try jq. As for the off params, i have a slight intuition that the bulb doesn't accept more status changes while turning-off. We'll see. I hope it does.

p.s. I have made a minor correction from .example('$0 on -t 10 10.0.0.200', 'Take 10 seconds to turn on a light') to .example('$0 on -t 10000 10.0.0.200', 'Take 10 seconds to turn on a light') but I don't to bother you with a pull request for something like that.

konsumer commented 6 years ago

Ah, yeah, good catch. I will update the code. Maybe I'll wait till I have time for the other changes for a proper version release.