Skip to content

Commit

Permalink
Switch to brandnew busylight exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Oct 1, 2022
1 parent f568920 commit a02d81d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions chroma_feedback/consumer/agile_innovative_blinkstick/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def get_api() -> Any:

def api_factory() -> Any:
try:
from busylight.lights import USBLightIOError, USBLightNotFound
from busylight.lights import LightUnavailable, LightNotFound
from busylight.lights.agile_innovative import BlinkStick as api

try:
api.first_light().release()
except (USBLightIOError, USBLightNotFound):
api.first_light().is_pluggedin()
except (LightUnavailable, LightNotFound):
logger.error(wording.get('connection_not_found').format('agile_innovative_blinkstick') + wording.get('exclamation_mark'))
sys.exit()
return api
Expand Down
6 changes: 3 additions & 3 deletions chroma_feedback/consumer/compulab_fit_statusb/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def get_api() -> Any:

def api_factory() -> Any:
try:
from busylight.lights import USBLightIOError, USBLightNotFound
from busylight.lights import LightUnavailable, LightNotFound
from busylight.lights.compulap import Fit_StatUSB as api

try:
api.first_light().release()
except (USBLightIOError, USBLightNotFound):
api.first_light().is_pluggedin()
except (LightUnavailable, LightNotFound):
logger.error(wording.get('connection_not_found').format('compulab_fit_statusb') + wording.get('exclamation_mark'))
sys.exit()
return api
Expand Down
6 changes: 3 additions & 3 deletions chroma_feedback/consumer/embrava_blynclight/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def get_api() -> Any:

def api_factory() -> Any:
try:
from busylight.lights import USBLightIOError, USBLightNotFound
from busylight.lights import LightUnavailable, LightNotFound
from busylight.lights.embrava import Blynclight as api

try:
api.first_light().release()
except (USBLightIOError, USBLightNotFound):
api.first_light().is_pluggedin()
except (LightUnavailable, LightNotFound):
logger.error(wording.get('connection_not_found').format('embrava_blynclight') + wording.get('exclamation_mark'))
sys.exit()
return api
Expand Down
6 changes: 3 additions & 3 deletions chroma_feedback/consumer/kuando_busylight/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def get_api() -> Any:

def api_factory() -> Any:
try:
from busylight.lights import USBLightIOError, USBLightNotFound
from busylight.lights import LightUnavailable, LightNotFound
from busylight.lights.kuando import Busylight as api

try:
api.first_light().release()
except (USBLightIOError, USBLightNotFound):
api.first_light().is_pluggedin()
except (LightUnavailable, LightNotFound):
logger.error(wording.get('connection_not_found').format('kuando_busylight') + wording.get('exclamation_mark'))
sys.exit()
return api
Expand Down
6 changes: 3 additions & 3 deletions chroma_feedback/consumer/luxafor_flag/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def get_api() -> Any:

def api_factory() -> Any:
try:
from busylight.lights import USBLightIOError, USBLightNotFound
from busylight.lights import LightUnavailable, LightNotFound
from busylight.lights.luxafor import Flag as api

try:
api.first_light().release()
except (USBLightIOError, USBLightNotFound):
api.first_light().is_pluggedin()
except (LightUnavailable, LightNotFound):
logger.error(wording.get('connection_not_found').format('luxafor_flag') + wording.get('exclamation_mark'))
sys.exit()
return api
Expand Down
6 changes: 3 additions & 3 deletions chroma_feedback/consumer/thingm_blink1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def get_api() -> Any:

def api_factory() -> Any:
try:
from busylight.lights import USBLightIOError, USBLightNotFound
from busylight.lights import LightUnavailable, LightNotFound
from busylight.lights.thingm import Blink1 as api

try:
api.first_light().release()
except (USBLightIOError, USBLightNotFound):
api.first_light().is_pluggedin()
except (LightUnavailable, LightNotFound):
logger.error(wording.get('connection_not_found').format('thingm_blink1') + wording.get('exclamation_mark'))
sys.exit()
return api
Expand Down

0 comments on commit a02d81d

Please sign in to comment.