mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-09-20 16:42:11 +02:00
Fix off-by-one in shade/group ID allocation
getNextShadeId() and getNextGroupId() capped usable IDs at SOMFY_MAX_SHADES-1/SOMFY_MAX_GROUPS-1, so the top 2 shade IDs (31, 32) and top 2 group IDs (15, 16) could never be allocated even though the backing arrays support the full range.
This commit is contained in:
parent
c7592162ec
commit
db22c16bb3
1 changed files with 2 additions and 2 deletions
|
|
@ -4548,7 +4548,7 @@ uint8_t SomfyShadeController::getNextShadeId()
|
||||||
{
|
{
|
||||||
// There is no shortcut for this since the deletion of
|
// There is no shortcut for this since the deletion of
|
||||||
// a shade in the middle makes all of this very difficult.
|
// a shade in the middle makes all of this very difficult.
|
||||||
for (uint8_t i = 1; i < SOMFY_MAX_SHADES - 1; i++)
|
for (uint8_t i = 1; i <= SOMFY_MAX_SHADES; i++)
|
||||||
{
|
{
|
||||||
bool id_exists = false;
|
bool id_exists = false;
|
||||||
for (uint8_t j = 0; j < SOMFY_MAX_SHADES; j++)
|
for (uint8_t j = 0; j < SOMFY_MAX_SHADES; j++)
|
||||||
|
|
@ -4599,7 +4599,7 @@ uint8_t SomfyShadeController::getNextGroupId()
|
||||||
{
|
{
|
||||||
// There is no shortcut for this since the deletion of
|
// There is no shortcut for this since the deletion of
|
||||||
// a group in the middle makes all of this very difficult.
|
// a group in the middle makes all of this very difficult.
|
||||||
for (uint8_t i = 1; i < SOMFY_MAX_GROUPS - 1; i++)
|
for (uint8_t i = 1; i <= SOMFY_MAX_GROUPS; i++)
|
||||||
{
|
{
|
||||||
bool id_exists = false;
|
bool id_exists = false;
|
||||||
for (uint8_t j = 0; j < SOMFY_MAX_GROUPS; j++)
|
for (uint8_t j = 0; j < SOMFY_MAX_GROUPS; j++)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue