Skip to content

Commit

Permalink
Project name
Browse files Browse the repository at this point in the history
Switching to from a quite boring working title to the final project
name.
  • Loading branch information
lnqs committed Feb 22, 2022
1 parent 4418d5a commit 871c751
Show file tree
Hide file tree
Showing 37 changed files with 140 additions and 144 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# deckconnect
# knoepfe

Connect and control Elgato Stream Decks
33 changes: 0 additions & 33 deletions deckconnect/default.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions deckconnect/widgets/__init__.py

This file was deleted.

7 changes: 0 additions & 7 deletions deckconnect/widgets/obs/__init__.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions deckconnect/__main__.py → knoepfe/__main__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""deckconnect
"""knoepfe
Connect and control Elgato Stream Decks
Usage:
deckconnect [(-v | --verbose)] [--config=<path>]
deckconnect (-h | --help)
deckconnect --version
knoepfe [(-v | --verbose)] [--config=<path>]
knoepfe (-h | --help)
knoepfe --version
Options:
-h --help Show this screen.
Expand All @@ -24,10 +24,10 @@
from StreamDeck.Devices import StreamDeck
from StreamDeck.Transport.Transport import TransportError

from deckconnect import __version__, log
from deckconnect.config import process_config
from deckconnect.deckmanager import DeckManager
from deckconnect.log import debug, error, info
from knoepfe import __version__, log
from knoepfe.config import process_config
from knoepfe.deckmanager import DeckManager
from knoepfe.log import debug, error, info


async def connect_device() -> StreamDeck:
Expand Down
4 changes: 2 additions & 2 deletions deckconnect/config.py → knoepfe/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import appdirs
from schema import And, Optional, Schema

from deckconnect.deck import Deck
from deckconnect.widgets.base import Widget
from knoepfe.deck import Deck
from knoepfe.widgets.base import Widget

DeckConfig = TypedDict("DeckConfig", {"id": str, "widgets": List[Widget | None]})

Expand Down
8 changes: 4 additions & 4 deletions deckconnect/deck.py → knoepfe/deck.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

from StreamDeck.Devices import StreamDeck

from deckconnect.key import Key
from deckconnect.log import debug
from deckconnect.wakelock import WakeLock
from knoepfe.key import Key
from knoepfe.log import debug
from knoepfe.wakelock import WakeLock

if TYPE_CHECKING: # pragma: no cover
from deckconnect.widgets.base import Widget
from knoepfe.widgets.base import Widget


class SwitchDeckException(BaseException):
Expand Down
8 changes: 4 additions & 4 deletions deckconnect/deckmanager.py → knoepfe/deckmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from StreamDeck.Devices import StreamDeck

from deckconnect.deck import Deck, SwitchDeckException
from deckconnect.log import debug, error
from deckconnect.wakelock import WakeLock
from knoepfe.deck import Deck, SwitchDeckException
from knoepfe.log import debug, error
from knoepfe.wakelock import WakeLock


class DeckManager:
Expand All @@ -19,7 +19,7 @@ def __init__(
) -> None:
self.active_deck = active_deck
self.decks = decks
device_config = global_config.get("deckconnect.config.device", {})
device_config = global_config.get("knoepfe.config.device", {})
self.brightness = device_config.get("brightness", 100)
self.device_poll_frequency = device_config.get("device_poll_frequency", 5)
self.sleep_timeout = device_config.get("sleep_timeout", None)
Expand Down
33 changes: 33 additions & 0 deletions knoepfe/default.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
config({
'type': 'knoepfe.config.device',
'brightness': 100,
'sleep_timeout': 10.0,
'device_poll_frequency': 5,
})

config({
'type': 'knoepfe.widgets.obs.config',
'host': 'localhost',
'port': 4444,
'password': 'supersecret',
})

default_deck({
'id': 'main',
'widgets': [
widget({'type': 'knoepfe.widgets.MicMute'}),
widget({'type': 'knoepfe.widgets.Timer'}),
widget({'type': 'knoepfe.widgets.Clock', 'format': '%H:%M'}),
widget({'type': 'knoepfe.widgets.obs.Recording'}),
widget({'type': 'knoepfe.widgets.obs.Streaming'}),
widget({'type': 'knoepfe.widgets.obs.CurrentScene', 'switch_deck': 'scenes'}),
],
})

deck({
'id': 'scenes',
'widgets': [
widget({'type': 'knoepfe.widgets.obs.SwitchScene', 'scene': 'Scene', 'switch_deck': 'main'}),
widget({'type': 'knoepfe.widgets.obs.SwitchScene', 'scene': 'Other Scene', 'switch_deck': 'main'}),
],
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions knoepfe/widgets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from knoepfe.widgets.clock import Clock
from knoepfe.widgets.mic_mute import MicMute
from knoepfe.widgets.text import Text
from knoepfe.widgets.timer import Timer

__all__ = ["Text", "MicMute", "Clock", "Timer"]
6 changes: 3 additions & 3 deletions deckconnect/widgets/base.py → knoepfe/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

from schema import Optional, Schema

from deckconnect.deck import SwitchDeckException
from deckconnect.key import Key
from deckconnect.wakelock import WakeLock
from knoepfe.deck import SwitchDeckException
from knoepfe.key import Key
from knoepfe.wakelock import WakeLock


class Widget:
Expand Down
4 changes: 2 additions & 2 deletions deckconnect/widgets/clock.py → knoepfe/widgets/clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from schema import Schema

from deckconnect.key import Key
from deckconnect.widgets.base import Widget
from knoepfe.key import Key
from knoepfe.widgets.base import Widget


class Clock(Widget):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from pulsectl_asyncio import PulseAsync
from schema import Optional, Schema

from deckconnect.key import Key
from deckconnect.log import error
from deckconnect.widgets.base import Widget
from knoepfe.key import Key
from knoepfe.log import error
from knoepfe.widgets.base import Widget


class MicMute(Widget):
Expand Down
7 changes: 7 additions & 0 deletions knoepfe/widgets/obs/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from knoepfe.widgets.obs.connector import config
from knoepfe.widgets.obs.current_scene import CurrentScene
from knoepfe.widgets.obs.recording import Recording
from knoepfe.widgets.obs.streaming import Streaming
from knoepfe.widgets.obs.switch_scene import SwitchScene

__all__ = ["config", "Recording", "Streaming", "CurrentScene", "SwitchScene"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from asyncio import Task, get_event_loop
from typing import Any, Dict, List

from deckconnect.widgets.base import Widget
from deckconnect.widgets.obs.connector import obs
from knoepfe.widgets.base import Widget
from knoepfe.widgets.obs.connector import obs


class OBSWidget(Widget):
Expand All @@ -15,7 +15,7 @@ def __init__(
self.listening_task: Task[None] | None = None

async def activate(self) -> None:
await obs.connect(self.global_config.get("deckconnect.widgets.obs.config", {}))
await obs.connect(self.global_config.get("knoepfe.widgets.obs.config", {}))

if not self.listening_task:
self.listening_task = get_event_loop().create_task(self.listener())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
)
from schema import Optional, Schema

from deckconnect.log import debug, info
from knoepfe.log import debug, info

config = Schema(
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from schema import Schema

from deckconnect.key import Key
from deckconnect.widgets.obs.base import OBSWidget
from deckconnect.widgets.obs.connector import obs
from knoepfe.key import Key
from knoepfe.widgets.obs.base import OBSWidget
from knoepfe.widgets.obs.connector import obs


class CurrentScene(OBSWidget):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

from schema import Schema

from deckconnect.key import Key
from deckconnect.widgets.obs.base import OBSWidget
from deckconnect.widgets.obs.connector import obs
from knoepfe.key import Key
from knoepfe.widgets.obs.base import OBSWidget
from knoepfe.widgets.obs.connector import obs


class Recording(OBSWidget):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

from schema import Schema

from deckconnect.key import Key
from deckconnect.widgets.obs.base import OBSWidget
from deckconnect.widgets.obs.connector import obs
from knoepfe.key import Key
from knoepfe.widgets.obs.base import OBSWidget
from knoepfe.widgets.obs.connector import obs


class Streaming(OBSWidget):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from schema import Schema

from deckconnect.key import Key
from deckconnect.widgets.obs.base import OBSWidget
from deckconnect.widgets.obs.connector import obs
from knoepfe.key import Key
from knoepfe.widgets.obs.base import OBSWidget
from knoepfe.widgets.obs.connector import obs


class SwitchScene(OBSWidget):
Expand Down
4 changes: 2 additions & 2 deletions deckconnect/widgets/text.py → knoepfe/widgets/text.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from schema import Schema

from deckconnect.key import Key
from deckconnect.widgets.base import Widget
from knoepfe.key import Key
from knoepfe.widgets.base import Widget


class Text(Widget):
Expand Down
4 changes: 2 additions & 2 deletions deckconnect/widgets/timer.py → knoepfe/widgets/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from schema import Schema

from deckconnect.key import Key
from deckconnect.widgets.base import Widget
from knoepfe.key import Key
from knoepfe.widgets.base import Widget


class Timer(Widget):
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "deckconnect"
name = "knoepfe"
version = "0.1.0"
description = "Connect and control Elgato Stream Decks"
authors = ["Simon Hayessen <simon@lnqs.io>"]
license = "GPL-3.0-or-later"
readme = "README.md"
homepage = "https://github.com/lnqs/deckconnect"
repository = "https://github.com/lnqs/deckconnect"
homepage = "https://github.com/lnqs/knoepfe"
repository = "https://github.com/lnqs/knoepfe"

[tool.poetry.dependencies]
python = "^3.10"
Expand All @@ -33,14 +33,14 @@ types-Pillow = "^9.0.6"
pytest-asyncio = "^0.18.1"

[tool.poetry.scripts]
deckconnect = 'deckconnect.__main__:main'
knoepfe = 'knoepfe.__main__:main'

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
filterwarnings = "ignore::DeprecationWarning:pulsectl_asyncio"
addopts = "--cov=deckconnect --cov-report=term-missing --asyncio-mode=auto"
addopts = "--cov=knoepfe --cov-report=term-missing --asyncio-mode=auto"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
Loading

0 comments on commit 871c751

Please sign in to comment.