Skip to content

Commit

Permalink
Merge 392119c into db44d88
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Oct 5, 2022
2 parents db44d88 + 392119c commit 035d87b
Show file tree
Hide file tree
Showing 48 changed files with 0 additions and 125 deletions.
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/agile_innovative/blinkstick/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/compulab/fit_statusb/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
8 changes: 0 additions & 8 deletions chroma_feedback/consumer/elgato/streamdeck/device.py
Expand Up @@ -34,8 +34,6 @@ def process_devices(devices : Any, producer_report : List[ProducerReport]) -> Li
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process devices

for device in devices:
if set_device(device, producer_report):
result.append(
Expand All @@ -51,21 +49,15 @@ def process_devices(devices : Any, producer_report : List[ProducerReport]) -> Li
def set_device(device : Any, producer_report : List[ProducerReport]) -> bool:
device.open()

# process report

for index, report in enumerate(producer_report):
if index < device.key_count():
device.set_key_image(index, create_image(device, report))
if 'url' in report and report['url']:
device.set_key_callback(lambda __, key, state : state is True and webbrowser.open(producer_report[key]['url']))

# smooth reset

for index in range(len(producer_report), device.key_count()):
device.set_key_image(index, None)

# close on destroy

atexit.register(lambda : device.close())
return device.is_open() is True

Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/embrava/blynclight/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/embrava/blynclight_mini/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/embrava/blynclight_plus/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/kuando/busylight_alpha/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/kuando/busylight_omega/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/lifx/lifx/core.py
Expand Up @@ -32,8 +32,6 @@ def run(producer_report : List[ProducerReport]) -> List[Consumer]:
sys.exit()
return process_groups(groups, producer_report)

# fallback as needed

lights = filter_lights(get_lights(), ARGS.lifx_light_ip)

if not lights:
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/lifx/lifx/group.py
Expand Up @@ -29,8 +29,6 @@ def process_groups(groups : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process groups

for group in groups:
set_group(group, color.get_by_status(status))
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/lifx/lifx/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
set_light(light, color.get_by_status(status))
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/luxafor/flag/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/luxafor/mute/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/luxafor/orb/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/magic/hue/light.py
Expand Up @@ -20,8 +20,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
set_light(light, color.get_by_status(status))
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/muteme/muteme/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/muteme/muteme_mini/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/mutesync/mutesync/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/nanoleaf/nanoleaf/light.py
Expand Up @@ -20,8 +20,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/philips/hue/core.py
Expand Up @@ -40,8 +40,6 @@ def run(producer_report : List[ProducerReport]) -> List[Consumer]:
sys.exit()
return process_groups(groups, producer_report)

# fallback as needed

lights = filter_lights(get_lights(ARGS.philips_hue_bridge_ip), ARGS.philips_hue_light_id)

if not lights:
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/philips/hue/group.py
Expand Up @@ -28,8 +28,6 @@ def process_groups(groups : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process groups

for index in groups:
set_group(groups[index]['name'], color.get_by_status(status))
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/philips/hue/light.py
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
set_light(light.name, color.get_by_status(status))
result.append(
Expand Down
Expand Up @@ -28,8 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
result.append(
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/consumer/razer/chroma/device.py
Expand Up @@ -28,8 +28,6 @@ def process_devices(devices : Any, producer_report : List[ProducerReport]) -> Li
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process devices

for device in devices:
if set_device(device, color.get_by_status(status)):
result.append(
Expand Down
1 change: 0 additions & 1 deletion chroma_feedback/consumer/signify/wiz/light.py
Expand Up @@ -20,7 +20,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
set_light(light, color.get_by_status(status))
Expand Down
1 change: 0 additions & 1 deletion chroma_feedback/consumer/thingm/blink1/light.py
Expand Up @@ -28,7 +28,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
Expand Down
1 change: 0 additions & 1 deletion chroma_feedback/consumer/xiaomi/yeelight/light.py
Expand Up @@ -20,7 +20,6 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List
result : List[Consumer] = []
status : Status = reporter.resolve_report_status(producer_report)

# process lights

for light in lights:
if set_light(light, color.get_by_status(status)):
Expand Down
29 changes: 0 additions & 29 deletions chroma_feedback/core.py
Expand Up @@ -22,23 +22,13 @@ def cli() -> None:

def init(program : ArgumentParser) -> None:
args = helper.get_first(program.parse_known_args())

# init logger

logger.init(args.log_level)

# validate version

if sys.version_info < (3, 8):
logger.error(wording.get('version_not_supported').format(sys.version_info.major, sys.version_info.minor) + wording.get('exclamation_mark'))
sys.exit()

# report header

reporter.print_header()

# handle loop

application = loop.get_application()
timer = loop.get_timer()
timer.setInterval(100)
Expand All @@ -57,8 +47,6 @@ def background_run(program : ArgumentParser) -> None:
args = helper.get_first(program.parse_known_args())
timer = loop.get_timer()

# handle interval

if INTERVAL == args.background_interval * 1000:
run(program)
INTERVAL = 0
Expand All @@ -68,41 +56,24 @@ def background_run(program : ArgumentParser) -> None:

def run(program : ArgumentParser) -> None:
args = helper.get_first(program.parse_known_args())

# process producer

producer_result = producer.process(program)

# handle exit

if not producer_result:
logger.error(wording.get('result_not_found') + wording.get('exclamation_mark'))
sys.exit()

# report producer

producer_report = reporter.create_producer_report(producer_result)

if producer_report:
reporter.print_report(producer_report)

# handle dry run

if args.dry_run is False:

# process consumer

consumer_result = consumer.process(program, producer_report)

# report consumer

consumer_report = reporter.create_consumer_report(consumer_result)

if consumer_report:
reporter.print_report(consumer_report)

# handle systray

if args.background_run is True and loop.is_created() is True:
if systray.is_created() is True:
systray.update(producer_report)
Expand Down
1 change: 0 additions & 1 deletion chroma_feedback/producer/appveyor/appveyor/core.py
Expand Up @@ -38,7 +38,6 @@ def fetch(host : str, slug : str, token : str) -> List[Producer]:
elif host and token:
response = request.get(host + '/api/projects', headers = request.create_bearer_auth_headers(token))

# process response

if response and response.status_code == 200:
data = request.parse_json(response)
Expand Down
1 change: 0 additions & 1 deletion chroma_feedback/producer/atlassian/bamboo/core.py
Expand Up @@ -34,7 +34,6 @@ def fetch(host : str, slug : str, token : str) -> List[Producer]:
slug = normalize_slug(slug)
response = request.get(host + '/rest/api/latest/result/' + slug, headers = request.create_bearer_auth_headers(token))

# process response

if response and response.status_code == 200:
data = request.parse_json(response)
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/producer/atlassian/bitbucket/core.py
Expand Up @@ -36,7 +36,6 @@ def fetch(host : str, slug : str, token : str) -> List[Producer]:
if host and slug and token:
response = request.get(host + '/2.0/repositories/' + slug + '/pipelines/', headers = request.create_bearer_auth_headers(token))

# process response

if response and response.status_code == 200:
data = request.parse_json(response)
Expand All @@ -62,7 +61,6 @@ def fetch_auth(host : str, username : str, password : str) -> Any:
'grant_type': 'client_credentials'
}, headers = request.create_basic_auth_headers(username, password))

# process response

if response and response.status_code == 200:
data = request.parse_json(response)
Expand Down
2 changes: 0 additions & 2 deletions chroma_feedback/producer/buddy/buddy/core.py
Expand Up @@ -43,7 +43,6 @@ def fetch(host: str, workspace: str, project : str, token: str) -> List[Producer
if host and workspace and project and token:
response = request.get(host + '/workspaces/' + workspace + '/projects/' + project + '/pipelines/', headers = request.create_bearer_auth_headers(token))

# process response

if response and response.status_code == 200:
data = request.parse_json(response)
Expand All @@ -63,7 +62,6 @@ def fetch_project_names(host : str, workspace : str, token : str) -> List[str]:
if host and workspace and token:
response = request.get(host + '/workspaces/' + workspace + '/projects', headers = request.create_bearer_auth_headers(token))

# process response

if response and response.status_code == 200:
data = request.parse_json(response)
Expand Down

0 comments on commit 035d87b

Please sign in to comment.