Skip to content

Conversation

@Mactar1233
Copy link

@Mactar1233 Mactar1233 commented Jun 5, 2025

This change allows users to get a name for the limelights discovered vs just a list of ip's which helps users using multiple cameras.

here is an example snippet of the new behavior of utilizing the discovered limelights function which is different from the example

discovered_limelights = limelight.discover_limelights(debug=True, return_names=True)

print("discovered limelights:", discovered_limelights)

limelight_address = discovered_limelights[0]['ip']

limelight_name = discovered_limelights[0]['name']

#alternate method

limelight_name = limelight.get_name_by_ip(discovered_limelights, limelight_address)

You now need to specify you are looking for the IP of the limelight of the index of 0. I added another robust method to getting ip's however with the get_ip_by_name function this code snippet now looks like this.

discovered_limelights = limelight.discover_limelights(debug=True, return_names=True)

print("discovered limelights:", discovered_limelights)

limelight_address = limelight.get_ip_by_name(discovered_limelights, "limelight")

if return_names is false

discovered_limelights = limelight.discover_limelights(debug=True, return_names=False)

print("discovered limelights:", discovered_limelights) #this line will only print IP's vs names aswell

limelight_address = discovered_limelights[0]['ip']

limelight_name = discovered_limelights[0]['name']#this line will return none unless you set return names to true

This allows users that use multiple limelights to not have to worry about order of discovery or if they disconnect a camera before startup the ip will be found if it's automatic vs static.

Setting the return_names parameter to false results in identical behavior to the previous release of LimelightLib-Python just you still need to add the ['ip] specification if looking for an ip on discovered limelights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant