Files
ha-api/test/script.ts

16 lines
373 B
TypeScript

import { script, showMore } from './common.ts';
const scripts = await script.getEntities();
const values = scripts.map(e => {
return {
entity_id: e.entity_id,
state: e.state,
attributes: e.attributes,
last_changed: e.last_changed,
last_updated: e.last_updated,
};
});
console.log(showMore(values));
console.log(`实体数量: ${scripts.length}`);