Closed tremby closed 6 years ago
👍
dave - meka linux ~/dev/hueadm (git:master) $ npm publish
+ hueadm@1.1.0
Example runs. Because group names are not guaranteed to be unique I have made it so an error is thrown if more than 1 group with the same name is found.
$ ./bin/hueadm group foo
error: Error: Multiple groups "foo" found
$ ./bin/hueadm group bar
error: Error: No group "bar" found
$ ./bin/hueadm group 'Garage Inside'
name: 'Garage Inside'
lights:
- '20'
- '21'
- '22'
- '23'
type: Room
state:
all_on: false
any_on: false
class: Carport
action:
on: false
bri: 254
alert: none
Excellent. It's working for me. Thanks! This is a major usability enhancement in my eyes.
Rather than having to remember which group is which, or refresh my memory by running
hueadm groups
before changing the state of a group, it would be very nice to be able to specify a group by name. For example:You could check to see if the argument is numeric (
/^\d+$/
would do it) and treat it as an ID if so, otherwise look up the ID of a group with the same name.It might then make sense to offer the same feature for lights too, or other commands, though groups are more valuable to me personally.