update
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { LightHA, AutoHA, EventHA, ScriptHA, ButtonHA } from "../src/index.ts";
|
||||
import { LightHA, AutoHA, EventHA, ScriptHA, ButtonHA, HACore, SpeakerHA, TextHA } from "../src/index.ts";
|
||||
|
||||
import util from 'node:util';
|
||||
import dotenv from 'dotenv';
|
||||
@@ -7,13 +7,15 @@ export const showMore = (obj: any) => {
|
||||
return util.inspect(obj, { depth: null, colors: true });
|
||||
}
|
||||
|
||||
export const hacore = new LightHA({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
export const hacore = new HACore({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
export const light = new LightHA({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
|
||||
export const auto = new AutoHA({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
export const event = new EventHA({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
export const script = new ScriptHA({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
export const button = new ButtonHA({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
|
||||
export const speaker = new SpeakerHA({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
export const text = new TextHA({ token: process.env.HAAS_TOKEN || '', homeassistantURL: process.env.HAAS_URL });
|
||||
// const enti = await hacore.getEntities((item) => item.attributes?.friendly_name?.includes?.('电视'));
|
||||
// console.log(showMore(enti), enti.length);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user