You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you run the example it fails in the line below. it actually found the pancontroller (with mac address and everything) but showing 0 bulbs under it.
if (panController.Count == 0)
{
MessageBox.Show("Could not find any bulbs");
mPowerGB.Enabled = false;
mLabelsGB.Enabled = false;
mLightStatusGB.Enabled = false;
return;
}
**mBulb = panController[0].Bulbs[0];**
**mBulb = panController[0].Bulbs[0];**
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
The text was updated successfully, but these errors were encountered:
Wow, I did this a few years ago so pardon me for not being up to date here... I don't have any tools to check this now so I'm unable to do much myself but let me try assist you.
Are you getting the exception at this row: if (panController.Count == 0)
Or at this row?: mBulb = panController[0].Bulbs[0];
If it is at the second one I would advice you to check if there are any bulbs in the Bulb list as in below code:
if (panController.panController[0].Count == 0)
{
MessageBox.Show("Could not find any bulbs despite the pan-controller");
mPowerGB.Enabled = false;
mLabelsGB.Enabled = false;
mLightStatusGB.Enabled = false;
return;
}
Hi Robin,
Thank you for getting back to me so quickly and I appreciate you for that! :)
your snippet gives me this error:
Error 1 'System.Collections.Generic.List<LifxLib.LifxPanController>' does not contain a definition for 'panController' and no extension method 'panController' accepting a first argument of type 'System.Collections.Generic.List<LifxLib.LifxPanController>' could be found (are you missing a using directive or an assembly reference?)
But if your intention is to understand if there are any bulbs in the pancontroller the answer is no.
there are no bulbs in the pancontroller but there are two pancontrollers with macid in them. here is couple of screens from visual studio: http://imgur.com/a/rVlO0
When you run the example it fails in the line below. it actually found the pancontroller (with mac address and everything) but showing 0 bulbs under it.
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
The text was updated successfully, but these errors were encountered: