diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index b0bcbe7..9380bd7 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -1594,13 +1594,15 @@ Span& Span::resetIID(int newIID){ while(1); } - if(newIID<1){ - LOG0("\nFATAL ERROR! Can't reset the Accessory IID count to a value less than 1 ***\n"); + newIID--; + + if(newIIDiidCount){ + LOG0("\nFATAL ERROR! Can't reset the Accessory IID count to a value less than already used ***\n"); LOG0("\n=== PROGRAM HALTED ==="); while(1); } - Accessories.back()->iidCount=newIID-1; + Accessories.back()->iidCount=newIID; return(*this); }