My first idea was to get the surface type of the material. If this is an emission shader it should be a light source, but I can't find something in the python documentation to get the surface input.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
You can do this by getting the material and checking if there is a node called Emission in the node tree, like this:
import bpy obj = bpy.context.object nodes = obj.data.materials.node_tree.nodes if "Emission" in nodes: print("yes")
Likewise, you could also check for a EMISSION node by using this instead:
for node in nodes: if node.type == "EMISSION": print("yes")
That way if the user had changed the name it would still catch it.