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:
22
bun.config.ts
Normal file
22
bun.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { resolvePath } from '@kevisual/use-config';
|
||||
import { execSync } from 'node:child_process';
|
||||
|
||||
const buildFn = async (opts: { entry?: string, naming?: string, external?: string[] }) => {
|
||||
const entry = opts.entry || 'index.ts';
|
||||
const naming = opts.naming || 'app';
|
||||
const external: string[] = opts.external || ["bun", "ws"];
|
||||
await Bun.build({
|
||||
target: 'node',
|
||||
format: 'esm',
|
||||
entrypoints: [resolvePath(entry, { meta: import.meta })],
|
||||
outdir: resolvePath('./dist', { meta: import.meta }),
|
||||
naming: {
|
||||
entry: `${naming}.js`,
|
||||
},
|
||||
external,
|
||||
});
|
||||
const cmd = `dts -i ${entry} -o ${naming}.d.ts`;
|
||||
execSync(cmd);
|
||||
};
|
||||
|
||||
await buildFn({ naming: 'app', entry: 'agent/index.ts' });
|
||||
Reference in New Issue
Block a user