Skip to content

Commit

Permalink
Prevent reset of lights and devices on single run
Browse files Browse the repository at this point in the history
  • Loading branch information
henryruhs committed Mar 2, 2023
1 parent fe975b8 commit 84396ce
Show file tree
Hide file tree
Showing 28 changed files with 58 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/terminal-session.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'agile_innovative.blinkstick',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/compulab/fit_statusb/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'compulab.fit_statusb',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/elgato/streamdeck/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def process_devices(devices : Any, producer_report : List[ProducerReport]) -> Li

for device in devices:
if set_device(device, producer_report):
register_reset_device(device)
if helper.has_argument('--background-run'):
register_reset_device(device)
result.append(
{
'name': 'elgato.streamdeck',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/embrava/blynclight/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'embrava.blynclight',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/embrava/blynclight_mini/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'embrava.blynclight_mini',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/embrava/blynclight_plus/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'embrava.blynclight_plus',
Expand Down
5 changes: 3 additions & 2 deletions chroma_feedback/consumer/gigabyte/rgb_fusion2/device.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import atexit
from typing import Any, List

from chroma_feedback import color, reporter
from chroma_feedback import color, helper, reporter
from chroma_feedback.typing import Color, Consumer, ProducerReport, Status
from .api import get_api

Expand All @@ -22,7 +22,8 @@ def process_devices(devices : Any, producer_report : List[ProducerReport]) -> Li

for device in devices:
set_device(device, color.get_by_status(status))
register_reset_device(device)
if helper.has_argument('--background-run'):
register_reset_device(device)
result.append(
{
'name': 'gigabyte.rgb_fusion2',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/kuando/busylight_alpha/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'kuando.busylight_alpha',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/kuando/busylight_omega/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'kuando.busylight_omega',
Expand Down
5 changes: 3 additions & 2 deletions chroma_feedback/consumer/lifx/lifx/group.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import atexit
from typing import Any, List

from chroma_feedback import color, reporter
from chroma_feedback import color, helper, reporter
from chroma_feedback.typing import Color, Consumer, ProducerReport, Status
from .api import get_api

Expand Down Expand Up @@ -32,7 +32,8 @@ def process_groups(groups : Any, producer_report : List[ProducerReport]) -> List

for group in groups:
set_group(group, color.get_by_status(status))
register_reset_group(group)
if helper.has_argument('--background-run'):
register_reset_group(group)
result.append(
{
'name': 'lifx',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/lifx/lifx/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
set_light(light, color.get_by_status(status))
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'lifx',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/luxafor/flag/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'luxafor.flag',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/luxafor/mute/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'luxafor.mute',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/luxafor/orb/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'luxafor.orb',
Expand Down
5 changes: 3 additions & 2 deletions chroma_feedback/consumer/magic/hue/light.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import atexit
from typing import Any, List

from chroma_feedback import color, reporter
from chroma_feedback import color, helper, reporter
from chroma_feedback.typing import Color, Consumer, ProducerReport, Status
from .api import get_api, get_modes

Expand All @@ -23,7 +23,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
set_light(light, color.get_by_status(status))
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'magic.hue',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/muteme/muteme/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'muteme',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/muteme/muteme_mini/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'muteme.muteme_mini',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/mutesync/mutesync/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'mutesync',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/nanoleaf/nanoleaf/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'nanoleaf',
Expand Down
5 changes: 3 additions & 2 deletions chroma_feedback/consumer/philips/hue/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import copy
from typing import Any, List

from chroma_feedback import color, reporter
from chroma_feedback import color, helper, reporter
from chroma_feedback.typing import Color, Consumer, ProducerReport, Status
from .api import get_api

Expand Down Expand Up @@ -31,7 +31,8 @@ def process_groups(groups : Any, producer_report : List[ProducerReport]) -> List

for index in groups:
set_group(groups[index], color.get_by_status(status))
register_reset_group(groups[index])
if helper.has_argument('--background-run'):
register_reset_group(groups[index])
result.append(
{
'name': 'philips.hue',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/philips/hue/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
set_light(light, color.get_by_status(status))
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'philips.hue',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'plantronics.status_indicator',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/razer/chroma/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_devices(devices : Any, producer_report : List[ProducerReport]) -> Li

for device in devices:
if set_device(device, color.get_by_status(status)):
register_reset_device(device)
if helper.has_argument('--background-run'):
register_reset_device(device)
result.append(
{
'name': 'razer.chroma',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/signify/wiz/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
set_light(light, color.get_by_status(status))
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'signify.wiz',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/thingm/blink1/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'thingm.blink1',
Expand Down
3 changes: 2 additions & 1 deletion chroma_feedback/consumer/xiaomi/yeelight/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def process_lights(lights : Any, producer_report : List[ProducerReport]) -> List

for light in lights:
if set_light(light, color.get_by_status(status)):
register_reset_light(light)
if helper.has_argument('--background-run'):
register_reset_light(light)
result.append(
{
'name': 'xiaomi.yeelight',
Expand Down
2 changes: 1 addition & 1 deletion chroma_feedback/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
'name': 'chroma-feedback',
'description': 'Turn your RGB powered hardware into a status indicator for continuous integration, continuous deployment and infrastructure monitoring',
'version': '13.0.2',
'version': '13.0.3',
'license': 'MIT',
'keywords': ' '.join(producer.ALL),
'author': 'Henry Ruhs',
Expand Down

0 comments on commit 84396ce

Please sign in to comment.