添加 ButtonHA 类及其服务功能,更新相关测试用例以支持新功能
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { LightHA, AutoHA, EventHA, ScriptHA } from "../src/index.ts";
|
||||
import { LightHA, AutoHA, EventHA, ScriptHA, ButtonHA } from "../src/index.ts";
|
||||
|
||||
import util from 'node:util';
|
||||
import dotenv from 'dotenv';
|
||||
@@ -12,9 +12,10 @@ export const hacore = new LightHA({ token: process.env.HAAS_TOKEN || '', homeass
|
||||
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 });
|
||||
|
||||
const enti = await hacore.getEntities((item) => item.attributes?.friendly_name?.includes('电视'));
|
||||
console.log(showMore(enti), enti.length);
|
||||
// const enti = await hacore.getEntities((item) => item.attributes?.friendly_name?.includes?.('电视'));
|
||||
// console.log(showMore(enti), enti.length);
|
||||
|
||||
// const lightEntities = await hacore.getInfoList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user