Skip to content

Commit 8a1da62

Browse files
committed
Initial commit: Home Assistant Windows Voice Assistant
0 parents  commit 8a1da62

92 files changed

Lines changed: 14341 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# GitHub Actions CI/CD Workflow
2+
# Automatically build Windows executable
3+
4+
name: Build Windows EXE
5+
6+
on:
7+
push:
8+
branches: [main, develop]
9+
pull_request:
10+
branches: [main]
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
name: Build Windows EXE
16+
runs-on: windows-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Python 3.13
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.13'
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt --verbose
31+
echo "=== Installed packages ==="
32+
pip list
33+
shell: pwsh
34+
35+
- name: Verify dependencies
36+
run: |
37+
python -c "import aioesphomeapi; print(f'aioesphomeapi version: {aioesphomeapi.__version__}')"
38+
python -c "import customtkinter; print('customtkinter OK')"
39+
python -c "import pymicro_wakeword; print('pymicro_wakeword OK')"
40+
41+
- name: Build EXE
42+
run: |
43+
python setup.py --build
44+
45+
- name: Check build output
46+
run: |
47+
if (Test-Path "dist\HomeAssistantWindows.exe") {
48+
Write-Host "EXE file built successfully!"
49+
$file = Get-Item dist\HomeAssistantWindows.exe
50+
Write-Host "Size: $([math]::Round($file.Length / 1MB, 2)) MB"
51+
Write-Host "LastWriteTime: $($file.LastWriteTime)"
52+
} else {
53+
Write-Host "EXE file build failed!"
54+
exit 1
55+
}
56+
57+
- name: Upload build artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: ha-windows-exe
61+
path: dist/HomeAssistantWindows.exe
62+
retention-days: 30

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# GitHub Actions Release Workflow
2+
# Create release when tag is pushed
3+
4+
name: Release
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
build-and-release:
13+
name: Build and Release
14+
runs-on: windows-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python 3.13
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.13'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt --verbose
29+
echo "=== Installed packages ==="
30+
pip list
31+
shell: pwsh
32+
33+
- name: Verify dependencies
34+
run: |
35+
python -c "import aioesphomeapi; print(f'aioesphomeapi version: {aioesphomeapi.__version__}')"
36+
python -c "import customtkinter; print('customtkinter OK')"
37+
python -c "import pymicro_wakeword; print('pymicro_wakeword OK')"
38+
39+
- name: Build EXE
40+
run: |
41+
python setup.py --build
42+
43+
- name: Check build output
44+
run: |
45+
if (Test-Path "dist\HomeAssistantWindows.exe") {
46+
Write-Host "EXE file built successfully!"
47+
$file = Get-Item dist\HomeAssistantWindows.exe
48+
Write-Host "Size: $([math]::Round($file.Length / 1MB, 2)) MB"
49+
Write-Host "LastWriteTime: $($file.LastWriteTime)"
50+
} else {
51+
Write-Host "EXE file build failed!"
52+
exit 1
53+
}
54+
55+
- name: Create Release
56+
uses: softprops/action-gh-release@v2
57+
with:
58+
files: dist/HomeAssistantWindows.exe
59+
draft: false
60+
prerelease: false
61+
generate_release_notes: true
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
MANIFEST
23+
24+
# Virtual Environment
25+
venv/
26+
ENV/
27+
env/
28+
.venv
29+
30+
# IDE
31+
.vscode/
32+
.idea/
33+
*.swp
34+
*.swo
35+
*~
36+
.DS_Store
37+
.kiro/
38+
.hypothesis/
39+
40+
# Claude Code 配置(老王我自己的配置文件)
41+
.claude/
42+
.serena/
43+
.spec-workflow/
44+
45+
46+
# 参考项目(linux-voice-assistant 和 HASS.Agent)
47+
reference/
48+
49+
# 日志文件
50+
*.log
51+
ha_windows.log
52+
53+
# PyInstaller 临时文件
54+
*.exe
55+
*.dmg
56+
*.app
57+
58+
# 测试和覆盖率
59+
.pytest_cache/
60+
.coverage
61+
htmlcov/
62+
.tox/
63+
64+
# 临时文件
65+
*.tmp
66+
*.temp
67+
*.bak
68+
*.backup
69+
nul
70+
commit_v022.py
71+
commit_workflow.py
72+
do_tag.py
73+
74+
# 系统文件
75+
Thumbs.db
76+
Desktop.ini
77+
78+
# 打包输出
79+
dist/
80+
build/
81+
82+
# 用户配置(虽然项目是零配置,但保留此注释以防万一)
83+
# *.json
84+
# *.yaml
85+
# *.yml
86+
87+
# 开发工具
88+
.mypy_cache/
89+
.dmypy.json
90+
dmypy.json
91+
.pyreplay
92+
93+
# Jupyter Notebook
94+
.ipynb_checkpoints
95+
96+
# 环境变量
97+
.env
98+
.env.local

HomeAssistantWindows.spec

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
from PyInstaller.utils.hooks import collect_all
3+
4+
datas = [('src', 'src')]
5+
binaries = []
6+
hiddenimports = ['customtkinter', 'aioesphomeapi', 'soundcard', 'mpv', 'numpy', 'psutil', 'win10toast', 'pymicro_wakeword', 'webrtcvad', 'zeroconf', 'pycaw', 'PIL', 'pystray', 'i18n', 'core.mdns_discovery', 'core.esphome_protocol', 'ui.system_tray_icon', 'voice.audio_recorder', 'voice.mpv_player', 'voice.wake_word', 'voice.vad', 'voice.voice_assistant', 'commands.command_executor', 'commands.system_commands', 'commands.media_commands', 'commands.audio_commands', 'sensors.windows_monitor', 'notify.announcement', 'ui.main_window']
7+
tmp_ret = collect_all('customtkinter')
8+
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
9+
tmp_ret = collect_all('aioesphomeapi')
10+
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
11+
tmp_ret = collect_all('pymicro_wakeword')
12+
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
13+
14+
15+
a = Analysis(
16+
['src\\__main__.py'],
17+
pathex=[],
18+
binaries=binaries,
19+
datas=datas,
20+
hiddenimports=hiddenimports,
21+
hookspath=['hooks'],
22+
hooksconfig={},
23+
runtime_hooks=[],
24+
excludes=['matplotlib', 'pandas', 'scipy', 'pytest'],
25+
noarchive=False,
26+
optimize=0,
27+
)
28+
pyz = PYZ(a.pure)
29+
30+
exe = EXE(
31+
pyz,
32+
a.scripts,
33+
a.binaries,
34+
a.datas,
35+
[],
36+
name='HomeAssistantWindows',
37+
debug=False,
38+
bootloader_ignore_signals=False,
39+
strip=False,
40+
upx=True,
41+
upx_exclude=[],
42+
runtime_tmpdir=None,
43+
console=False,
44+
disable_windowed_traceback=False,
45+
argv_emulation=False,
46+
target_arch=None,
47+
codesign_identity=None,
48+
entitlements_file=None,
49+
version='version_info.txt',
50+
icon=['src\\logo.ico'],
51+
)

0 commit comments

Comments
 (0)