Closed henryruhs closed 4 years ago
There seems to be some confusion here about two different uses of the term "Group."
LIFX group: The lights themselves have a group that is assigned to them through the LIFX app, such as "Office" or "Bedroom." Devices can only belong to one group. device.get_group_label()
returns the group name according to the LIFX app.
lifxlan Group
: lifxlan provides a generic Group
class that allows you to collect an arbitrary set of LIFX devices together and operate on them in parallel.
The problem with group.get_label()
: The devices in a lifxlan Group
may belong to different LIFX app groups. For example, if you make a lifxlan Group
out of all of your multizone lights, device.get_group_label()
might return "Bedroom" for one and "Kitchen" for the other...so what should group.get_label()
return?
The semantics of the two groups are different, and it does not make sense for a lifxlan Group
to derive its name from the LIFX group label of member devices. How to name a lifxlan Group
is application-dependent and should be left to the user.
The devices in a lifxlan Group may belong to different LIFX app groups
Thank you for the explanation. What about returning a List with the names, so group.get_labels()
returns ["Bedroom", "Kitchen"]`.
Hello,
it would be great to have a similar API for
Group
object like we have in theLight
object. I need to get the current group label while iterating over a list but there is no way to get this accept this dirty hack:Something like that would be great: