Add TypeScript integrations package
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
export * from './core/index.js';
|
||||
export * from './protocols/index.js';
|
||||
export * from './integrations/index.js';
|
||||
|
||||
import { HueIntegration } from './integrations/hue/index.js';
|
||||
import { ShellyIntegration } from './integrations/shelly/index.js';
|
||||
import { WolfSmartsetIntegration } from './integrations/wolf_smartset/index.js';
|
||||
import { generatedHomeAssistantPortIntegrations } from './integrations/generated/index.js';
|
||||
import { IntegrationRegistry } from './core/index.js';
|
||||
|
||||
export const integrations = [
|
||||
new HueIntegration(),
|
||||
new ShellyIntegration(),
|
||||
new WolfSmartsetIntegration(),
|
||||
];
|
||||
|
||||
export const createDefaultIntegrationRegistry = (): IntegrationRegistry => {
|
||||
const registry = new IntegrationRegistry();
|
||||
for (const integration of integrations) {
|
||||
registry.register(integration);
|
||||
}
|
||||
for (const integration of generatedHomeAssistantPortIntegrations) {
|
||||
if (!registry.get(integration.domain)) {
|
||||
registry.register(integration);
|
||||
}
|
||||
}
|
||||
return registry;
|
||||
};
|
||||
Reference in New Issue
Block a user