Skip to content

Commit

Permalink
fix alerts from LGTM, use Exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
k0rventen committed Jan 6, 2021
1 parent f4027be commit e970d36
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions avea/avea.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Creator : k0rventen
License : MIT
Source : https://github.com/k0rventen/avea
Version : 1.4
Version : 1.5.2
"""

# Standard imports
Expand Down Expand Up @@ -166,7 +166,7 @@ def set_smooth_transition(self, target_red, target_green, target_blue, duration=
"""
try:
init_r, init_g, init_b = self.get_rgb()
except:
except Exception:
print("Could not connect to bulb")
return
if self.connect():
Expand All @@ -190,7 +190,7 @@ def set_smooth_transition(self, target_red, target_green, target_blue, duration=
val = compute_color(check_bounds(0),check_bounds(transition_table_red[i]*16),check_bounds(transition_table_green[i]*16),check_bounds(transition_table_blue[i]*16))
try:
self.bulb.writeCharacteristic(40,val)
except:
except Exception:
self.disconnect()
self.connect()
time.sleep(interval)
Expand Down

0 comments on commit e970d36

Please sign in to comment.