feat: integrate light control functionality with Home Assistant

- Added LightHA class to manage light services.
- Implemented searchLight method for device discovery.
- Created app.ts and index.ts for application setup and routing.
- Developed callText function to parse and execute light commands.
- Established routes for handling Home Assistant control commands.
- Configured Bun for building the application with TypeScript support.
This commit is contained in:
2026-01-31 16:11:52 +08:00
parent f18c6d4e3d
commit d17efcc606
10 changed files with 740 additions and 37 deletions

View File

@@ -1,16 +1,18 @@
{
"name": "@kevisual/ha-api",
"version": "0.0.6",
"version": "0.0.7",
"description": "",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "bun run bun.config.ts"
},
"app": {
"type": "pm2-system-app",
"entry": "src/index.ts"
"type": "system-app",
"entry": "dist/app.js"
},
"files": [
"dist",
"agent",
"src"
],
"keywords": [],
@@ -19,16 +21,24 @@
},
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
"license": "MIT",
"packageManager": "pnpm@10.26.2",
"packageManager": "pnpm@10.28.2",
"type": "module",
"devDependencies": {
"@types/bun": "^1.3.5",
"@types/node": "^25.0.3",
"@types/bun": "^1.3.8",
"@types/node": "^25.1.0",
"dayjs": "^1.11.19",
"@kevisual/context": "^0.0.4",
"@kevisual/router": "^0.0.64",
"@kevisual/use-config": "^1.0.28",
"dotenv": "^17.2.3"
},
"dependencies": {
"@kevisual/cache": "^0.0.4",
"@kevisual/cache": "^0.0.5",
"fuse.js": "^7.1.0",
"lru-cache": "^11.2.4"
"lru-cache": "^11.2.5"
},
"exports": {
".": "./src/index.ts",
"./routes": "./dist/app.js"
}
}