lwsrbrts / PoSHue

Windows PowerShell 5/PowerShell Core 6 Classes for controlling Philips Hue Bridge and Hue Lights, Groups, Sensors.
GNU Lesser General Public License v3.0
51 stars 7 forks source link

Control light groups #4

Closed ghost closed 7 years ago

ghost commented 8 years ago

How to control groups of lights with your script?

e.g this is the line for getting a single light. What is the equivalent for a group

$Office = [HueLight]::new("Living", $Endpoint, $UserID)

lwsrbrts commented 8 years ago

@davebanthorpe that'll have to be the recalling of a scene for now I'm afraid. Unfortunately I haven't implemented the groups API yet. I'm sure it will come as I have acquired a lot more lights in recent months.

lwsrbrts commented 7 years ago

Now in progress.

lwsrbrts commented 7 years ago

I've created the basic control features of the Group class now and it's usable.

There are two constructors for HueGroup. You may only want to create a group rather than control an existing one. This first example is to just get a blank HueGroup object, allowing you to create or delete an existing group.

$Group = [HueGroup]::new('192.168.1.12', 'myapikey')

This example create a HueGroup object and obtains some information about a group or room called "Living room"

$Group = [HueGroup]::new('Living room', '192.168.1.12', 'myapikey')

You can now:

lwsrbrts commented 7 years ago

I've updated the PowerShell Gallery module as 1.1.1 and the documentation for the above. Additional tinkering will complete Groups API support with changing brightness, colour, saturation, xy etc. in the next couple of weeks - that will be version 1.1.2.

If you installed from the gallery, running: Update-Module -Name PoSHue will get you 1.1.1 now and 1.1.2 when that's released. I'll hold off doing a release in GitHub for now until 1.1.2 is ready to go.

1.1.1 Gives you create, edit, delete and state (on/off) control of groups. Rooms and LightGroups are supported.

Lewis

lwsrbrts commented 7 years ago

Now complete and 1.1.2 has been released to the PowerShell Gallery.