diff --git a/src/integrations/schema.js b/src/integrations/schema.js index f43c74a..9e0db41 100644 --- a/src/integrations/schema.js +++ b/src/integrations/schema.js @@ -52,6 +52,11 @@ export const INTEGRATIONS = { configFields: ['host', 'port'], secretFields: ['username', 'password'], }, + mqtt_plant: { + name: 'MQTT Broker (Plant)', + configFields: ['host', 'port'], + secretFields: ['username', 'password'], + }, } export const MASKED = '••••••••' diff --git a/src/routes/integrations.js b/src/routes/integrations.js index a8a2125..3ece339 100644 --- a/src/routes/integrations.js +++ b/src/routes/integrations.js @@ -141,7 +141,7 @@ export async function integrationRoutes(app) { if (res.status === 401) throw new Error('Invalid Nextcloud credentials') if (!res.ok) throw new Error(`Nextcloud returned ${res.status}`) } - else if (req.params.slug === 'mqtt') { + else if (req.params.slug === 'mqtt' || req.params.slug.startsWith('mqtt_')) { if (!creds.host || !creds.username || !creds.password) throw new Error('MQTT host, username and password are required') const mqtt = await import('mqtt') await new Promise((resolve, reject) => {