-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement "group 0" as a regular zigbee group #1555
Conversation
…t and use that for group 0/All. - a group address of 0 actually works for Ikea and Osram lights, but not for Philips - finds a free group-address from 65520 downwards, 65535 does not work for Osram - add all lights when found after database load or after light search - remove all special cases and use "regular" groupcast
group.setAddress(0); | ||
group.setName("All"); | ||
groups.push_back(group); | ||
if (gwGroup0 == 0) { // get new id and replace old group0 and get new id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please always use braces on the next line for if, for. So that the code base just has one code style.
if (gwGroup0)
{
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, missed this one, it's no my usual code style.
if (!val.isEmpty()) | ||
{ | ||
uint group0 = val.toUInt(&ok); | ||
if (ok && (group0 <= 65535)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't 65535 be 0xFFF0 to align with the later code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch,
Thanks, I think this should work. For a later refactor we should consider to switch to a SQL table to map an REST-API group id and unqiueid to a Zigbee group id.
|
Thanks @manup for reviewing. I'll update the PR tomorrow or the day after, or feel free to make those changes yourself. |
0 and larger than 0xfff7 is not valid for Osram Lightify. Related PR #1555
Done :) |
This is mostly the first commit from #1471 so it can be reviewed and merged in stages. This:
-- just using Zigbee group id 0 did not work for all lights nor 65535, so it finds a free group from 65520 going downwards
-- removes all "group0" special cases
This should cause not change in behavior. On the Zigbee side each light will now have an extra group, and turning off or on all lights via group 0 on the api side is now achieved on the Zigbee side with a groupcast to this zigbee group instead of a broadcast.