sofabaton-x-server 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sofabaton_x_server-0.2.0/.gitignore +47 -0
- sofabaton_x_server-0.2.0/Dockerfile +41 -0
- sofabaton_x_server-0.2.0/PKG-INFO +758 -0
- sofabaton_x_server-0.2.0/README.md +730 -0
- sofabaton_x_server-0.2.0/codegen-smoke/smoke.ts +105 -0
- sofabaton_x_server-0.2.0/codegen-smoke/tsconfig.json +12 -0
- sofabaton_x_server-0.2.0/docker-compose.yml +33 -0
- sofabaton_x_server-0.2.0/docs/getting-started.md +220 -0
- sofabaton_x_server-0.2.0/docs/platform-integration.md +575 -0
- sofabaton_x_server-0.2.0/examples/edit_activity.py +113 -0
- sofabaton_x_server-0.2.0/examples/hubitat/README.md +247 -0
- sofabaton_x_server-0.2.0/examples/hubitat/SofabatonXActivity.groovy +14 -0
- sofabaton_x_server-0.2.0/examples/hubitat/SofabatonXButtons.groovy +30 -0
- sofabaton_x_server-0.2.0/examples/hubitat/SofabatonXHub.groovy +36 -0
- sofabaton_x_server-0.2.0/examples/hubitat/SofabatonXServerApp.groovy +296 -0
- sofabaton_x_server-0.2.0/examples/hubitat/SofabatonXServerBridge.groovy +162 -0
- sofabaton_x_server-0.2.0/examples/hubitat/tests/HubitatExampleTest.groovy +259 -0
- sofabaton_x_server-0.2.0/examples/starter.py +202 -0
- sofabaton_x_server-0.2.0/openapi-toolchain.txt +10 -0
- sofabaton_x_server-0.2.0/openapi.json +9941 -0
- sofabaton_x_server-0.2.0/pyproject.toml +50 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/__init__.py +15 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/app.py +219 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/callbacks.py +1079 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/cli.py +119 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/config.py +183 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/discovery.py +284 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/jobs.py +232 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/manager.py +406 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/models.py +126 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/openapi.py +40 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/problems.py +245 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_apply.py +424 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_callbacks.py +367 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_discovery.py +32 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_edit.py +530 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_hub_data.py +271 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_hubs.py +108 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_payload.py +256 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_snapshot.py +276 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/routes_ui.py +208 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/store.py +244 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/ui/panel/index.html +22 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/ui/panel/panel.js +12264 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/ui/remote/icon.svg +8 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/ui/remote/index.html +25 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/ui/remote/manifest.webmanifest +14 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/ui/remote/remote-web.js +10593 -0
- sofabaton_x_server-0.2.0/src/sofabaton_server/ws.py +255 -0
- sofabaton_x_server-0.2.0/tests/conftest.py +45 -0
- sofabaton_x_server-0.2.0/tests/fakes.py +674 -0
- sofabaton_x_server-0.2.0/tests/test_apply_routes.py +253 -0
- sofabaton_x_server-0.2.0/tests/test_callbacks.py +504 -0
- sofabaton_x_server-0.2.0/tests/test_discovery.py +205 -0
- sofabaton_x_server-0.2.0/tests/test_edit_routes.py +235 -0
- sofabaton_x_server-0.2.0/tests/test_harness.py +25 -0
- sofabaton_x_server-0.2.0/tests/test_hub_data_routes.py +157 -0
- sofabaton_x_server-0.2.0/tests/test_hubs_routes.py +117 -0
- sofabaton_x_server-0.2.0/tests/test_jobs.py +98 -0
- sofabaton_x_server-0.2.0/tests/test_manager.py +276 -0
- sofabaton_x_server-0.2.0/tests/test_openapi.py +70 -0
- sofabaton_x_server-0.2.0/tests/test_payload_routes.py +216 -0
- sofabaton_x_server-0.2.0/tests/test_skeleton.py +130 -0
- sofabaton_x_server-0.2.0/tests/test_snapshot_routes.py +254 -0
- sofabaton_x_server-0.2.0/tests/test_starter_example.py +129 -0
- sofabaton_x_server-0.2.0/tests/test_ui.py +146 -0
- sofabaton_x_server-0.2.0/tests/test_ws.py +210 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.pyc
|
|
3
|
+
*.pyo
|
|
4
|
+
*.bak
|
|
5
|
+
*.log
|
|
6
|
+
*.zip
|
|
7
|
+
*.patch
|
|
8
|
+
.vscode/
|
|
9
|
+
.idea/
|
|
10
|
+
.mypy_cache/
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.pytest_tmp/
|
|
13
|
+
.pytest_tmp*/
|
|
14
|
+
pytest-cache-files-*/
|
|
15
|
+
.codex-tmp/
|
|
16
|
+
.venv/
|
|
17
|
+
.venv-py313/
|
|
18
|
+
.venv-py313-smoke/
|
|
19
|
+
pytest.ini
|
|
20
|
+
.python-version
|
|
21
|
+
.claude/
|
|
22
|
+
node_modules/
|
|
23
|
+
playwright-report/
|
|
24
|
+
test-results/
|
|
25
|
+
tests/frontend-dist/
|
|
26
|
+
artifacts/
|
|
27
|
+
docs/internal/
|
|
28
|
+
out/
|
|
29
|
+
pytest.cmd
|
|
30
|
+
dist/
|
|
31
|
+
scripts/.ha-token
|
|
32
|
+
scripts/.ha-config.json
|
|
33
|
+
|
|
34
|
+
# sofabaton-x-server runtime data (default data dir when run from its directory)
|
|
35
|
+
sofabaton-x-server/data/
|
|
36
|
+
data/
|
|
37
|
+
|
|
38
|
+
# generated by the sofabaton-x-server codegen smoke (openapi-typescript)
|
|
39
|
+
sofabaton-x-server/codegen-smoke/schema.d.ts
|
|
40
|
+
|
|
41
|
+
# bench_200 Linux runner artifacts
|
|
42
|
+
dist-bench/
|
|
43
|
+
.venv-bench/
|
|
44
|
+
|
|
45
|
+
# local data directory of the dev-console launch config (.claude/launch.json)
|
|
46
|
+
sofabaton-x-server/.harness-data/
|
|
47
|
+
sofabaton-x-server/.harness-data-empty/
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# sofabaton-x-server image. Build context is the REPOSITORY ROOT (the
|
|
2
|
+
# library and the server are two distributions of one repo):
|
|
3
|
+
#
|
|
4
|
+
# docker build -f sofabaton-x-server/Dockerfile -t sofabaton-x-server .
|
|
5
|
+
#
|
|
6
|
+
# Run with host networking (mDNS, the app's UDP broadcast and the hub's
|
|
7
|
+
# TCP dial-back all need the host's real interface; Linux hosts only):
|
|
8
|
+
#
|
|
9
|
+
# docker run --network host -v ./data:/data sofabaton-x-server --hub 192.168.1.50
|
|
10
|
+
#
|
|
11
|
+
# or use the docker-compose.yml next to this file.
|
|
12
|
+
|
|
13
|
+
# --- build both wheels from the repository ------------------------------
|
|
14
|
+
FROM python:3.12-slim AS build
|
|
15
|
+
WORKDIR /src
|
|
16
|
+
RUN pip install --no-cache-dir build
|
|
17
|
+
COPY pyproject.toml LICENSE ./
|
|
18
|
+
COPY custom_components/sofabaton_x1s/lib ./custom_components/sofabaton_x1s/lib
|
|
19
|
+
COPY sofabaton-x ./sofabaton-x
|
|
20
|
+
RUN python -m build --wheel --outdir /wheels
|
|
21
|
+
COPY sofabaton-x-server ./sofabaton-x-server
|
|
22
|
+
RUN python -m build --wheel --outdir /wheels ./sofabaton-x-server
|
|
23
|
+
|
|
24
|
+
# --- runtime --------------------------------------------------------------
|
|
25
|
+
FROM python:3.12-slim
|
|
26
|
+
LABEL org.opencontainers.image.title="sofabaton-x-server" \
|
|
27
|
+
org.opencontainers.image.description="REST + WebSocket server over the sofabaton-x library for Sofabaton X1 / X1S / X2 hubs" \
|
|
28
|
+
org.opencontainers.image.source="https://github.com/m3tac0de/home-assistant-sofabaton-x1s"
|
|
29
|
+
COPY --from=build /wheels /wheels
|
|
30
|
+
RUN pip install --no-cache-dir /wheels/*.whl && rm -rf /wheels
|
|
31
|
+
ENV SOFABATON_DATA_DIR=/data \
|
|
32
|
+
SOFABATON_BIND=0.0.0.0 \
|
|
33
|
+
SOFABATON_PORT=8480 \
|
|
34
|
+
PYTHONUNBUFFERED=1
|
|
35
|
+
VOLUME ["/data"]
|
|
36
|
+
# Host networking makes EXPOSE informational; listed for the record:
|
|
37
|
+
# API 8480/tcp, hub dial-back 8200/tcp, app discovery 8102/udp, mDNS 5353/udp.
|
|
38
|
+
EXPOSE 8480/tcp 8200/tcp 8102/udp 5353/udp
|
|
39
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
|
|
40
|
+
CMD python -c "import os, urllib.request; urllib.request.urlopen(f'http://127.0.0.1:{os.environ.get(\"SOFABATON_PORT\", \"8480\")}/api/v1/server', timeout=3)" || exit 1
|
|
41
|
+
ENTRYPOINT ["sofabaton-x-server"]
|