Skip to content

Instantly share code, notes, and snippets.

View shauneccles's full-sized avatar

Shaun Eccles-Smith shauneccles

  • Melbourne, Victoria
View GitHub Profile
@shauneccles
shauneccles / utils.py
Created February 21, 2024 04:19
Vol healer
def create(self, type, id=None, *args, **kwargs):
"""Loads and creates a object from the registry by type"""
if type not in self._cls.registry():
raise AttributeError(
("Couldn't find '{}' in the {} registry").format(
type, self._cls.__name__.lower()
)
)
@shauneccles
shauneccles / hmm.log
Created January 27, 2024 23:47
Passing OS X runner - why is Energy deactivating...
2024-01-27 23:43:53,894 ledfx.api DEBUG LedFx API Request 58de: POST /api/virtuals/ci-test-jig/effects
2024-01-27 23:43:53,895 ledfx.api DEBUG LedFx API Request 58de payload: {'type': 'energy'}
2024-01-27 23:43:53,896 ledfx.effects DEBUG Effect Energy config updated to {'color_high': '#0000ff', 'blur': 4.0, 'color_cycler': False, 'brightness': 1.0, 'mirror': True, 'background_brightness': 1.0, 'background_color': '#000000', 'color_lows': '#ff0000', 'color_mids': '#00ff00', 'sensitivity': 0.6, 'flip': False, 'mixing_mode': 'additive'}.
2024-01-27 23:43:53,976 ledfx.effects INFO Effect Rainbow deactivated.
2024-01-27 23:43:53,976 ledfx.effects.audio INFO Activating AudioReactiveEffect.
2024-01-27 23:43:53,976 ledfx.effects INFO Effect Energy activated.
2024-01-27 23:43:54,077 ledfx.effects.audio INFO Audio source opened: Core Audio: BlackHole 2ch
2024-01-27 23:43:54,129 led
import logging
import timeit
import voluptuous as vol
from ledfx.effects.gradient import GradientEffect
from ledfx.effects.twod import Twod
import seagull as sg
import seagull.lifeforms as lf
import numpy as np
import logging
from json import JSONDecodeError
from aiohttp import web
from ledfx.api import RestEndpoint
_LOGGER = logging.getLogger(__name__)
def _gaussian_kernel1d(sigma, order, radius):
'''
Produces a 1D Gaussian or Gaussian-derivative filter kernel as a numpy array.
Args:
sigma (float): The standard deviation of the filter.
order (int): The derivative-order to use. 0 indicates a Gaussian function, 1 a 1st order derivative, etc.
radius (int): The kernel produced will be of length (2*radius+1)
Returns:
@shauneccles
shauneccles / Pyupdater 4 with Python 3.9.5.py
Created November 14, 2021 01:51
Pyupdater 4 with python 3.9.5
(ledfx_venv_3.9) PS C:\Users\shaun\ledfx_venv_3.9\LedFx> ledfx -vv
[DEBUG ] urllib3.util.retry : Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=0, status=None)
[DEBUG ] urllib3.connectionpool : Starting new HTTPS connection (1): ledfx.app:443
[DEBUG ] urllib3.connectionpool : https://ledfx.app:443 "GET /downloads/keys.gz HTTP/1.1" 301 247
[DEBUG ] urllib3.util.retry : Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None, status=None)
[DEBUG ] urllib3.util.retry : Incremented Retry for (url='https://ledfx.app/downloads/keys.gz'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
[INFO ] urllib3.poolmanager : Redirecting https://ledfx.app/downloads/keys.gz -> https://www.ledfx.app/downloads/keys.gz
[DEBUG ] urllib3.connectionpool : Starting new HTTPS connection (1): www.ledfx.app:443
[DEBUG ] urllib3.connectionpool : https://www.ledfx.ap
@shauneccles
shauneccles / pyupdater 3.10 error.py
Created November 14, 2021 01:49
Pyupdater 4 with Python 3.10
(ledfx_venv_3.10) PS C:\Users\shaun\ledfx_venv_3.10\LedFx> ledfx -vv
[DEBUG ] urllib3.util.retry : Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=0, status=None)
[DEBUG ] urllib3.connectionpool : Starting new HTTPS connection (1): ledfx.app:443
[DEBUG ] urllib3.connectionpool : https://ledfx.app:443 "GET /downloads/keys.gz HTTP/1.1" 301 247
[DEBUG ] urllib3.util.retry : Converted retries value: 2 -> Retry(total=2, connect=None, read=None, redirect=None, status=None)
[DEBUG ] urllib3.util.retry : Incremented Retry for (url='https://ledfx.app/downloads/keys.gz'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
[INFO ] urllib3.poolmanager : Redirecting https://ledfx.app/downloads/keys.gz -> https://www.ledfx.app/downloads/keys.gz
[DEBUG ] urllib3.connectionpool : Starting new HTTPS connection (1): www.ledfx.app:443
[DEBUG ] urllib3.connectionpool : https://www.ledfx.
import logging
from aiohttp import web
from ledfx.api import RestEndpoint
_LOGGER = logging.getLogger(__name__)
class DeviceStatusEndpoint(RestEndpoint):
[ERROR ] ledfx.core : Exception in core event loop: Exception in callback Display.thread_function()
Traceback (most recent call last):
File "C:\Users\shaun\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "c:\users\shaun\ledfx_venv_3.9\ledfx\ledfx\displays.py", line 312, in thread_function
self.process_active_effect()
File "c:\users\shaun\ledfx_venv_3.9\ledfx\ledfx\displays.py", line 293, in process_active_effect
self.assembled_frame = self.assemble_frame()
File "c:\users\shaun\ledfx_venv_3.9\ledfx\ledfx\displays.py", line 355, in assemble_frame
self.frame_transitions(
_mDNS_IP = None
class mDNSResolver:
## mDNS Based Resolver
def remove_service(self, zeroconf_obj, type, name):
_LOGGER.info(f"Service {name} removed")
def add_service(self, zeroconf, type, name):
mdnsdata = zeroconf.get_service_info(type, name)