check if devices are supported

This commit is contained in:
Denis Lehmann 2021-04-28 23:37:51 +02:00
parent 38469ed70b
commit a155eea399

View file

@ -71,6 +71,8 @@ def apply_device_profile(device_profile):
) )
if not device: if not device:
error("device '{}' not available".format(device_profile["name"])) error("device '{}' not available".format(device_profile["name"]))
elif not device.has("lighting_led_matrix"):
error("device '{}' not supported".format(device_profile["name"]))
# Open lightmap # Open lightmap
try: try:
@ -174,9 +176,10 @@ def iterate_lights():
def list_devices(): def list_devices():
"""Print a list of all available devices.""" """Print a list of all available and supported devices."""
print("The following devices are available:") print("The following devices are available and supported:")
for device in device_manager.devices: for device in device_manager.devices:
if device.has("lighting_led_matrix"):
print(" - {}".format(device.name)) print(" - {}".format(device.name))