File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1111 get_blinkstick_package_version ,
1212 BlinkStickVariant ,
1313)
14+ from blinkstick .exceptions import UnsupportedOperation
1415
1516logging .basicConfig ()
1617
@@ -87,14 +88,18 @@ def format_usage(self, usage):
8788
8889
8990def print_info (stick ):
91+ variant = stick .get_variant ()
9092 print ("Found backend:" )
9193 print (" Manufacturer: {0}" .format (stick .get_manufacturer ()))
9294 print (" Description: {0}" .format (stick .get_description ()))
9395 print (" Variant: {0}" .format (stick .get_variant_string ()))
9496 print (" Serial: {0}" .format (stick .get_serial ()))
9597 print (" Current Color: {0}" .format (stick .get_color (color_format = "hex" )))
96- print (" Mode: {0}" .format (stick .get_mode ()))
97- if stick .get_variant () == BlinkStickVariant .BLINKSTICK_FLEX :
98+ try :
99+ print (" Mode: {0}" .format (stick .get_mode ()))
100+ except UnsupportedOperation :
101+ print (" Mode: Not supported" )
102+ if variant == BlinkStickVariant .BLINKSTICK_FLEX :
98103 try :
99104 count = stick .get_led_count ()
100105 except :
You can’t perform that action at this time.
0 commit comments