From a633ffacb3f2f079e616db8224eab8fccb490a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Hagelb=C3=A4ck?= Date: Tue, 27 Apr 2021 11:36:38 +0200 Subject: [PATCH] Quick-fix to force switch devices to the light mqtt domain --- plejd/MqttClient.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plejd/MqttClient.js b/plejd/MqttClient.js index 92d7f4c..c316798 100644 --- a/plejd/MqttClient.js +++ b/plejd/MqttClient.js @@ -26,7 +26,7 @@ const TOPICS = { COMMAND: 'set', }; -const getMqttType = (/** @type {{ uniqueId: string; type: string; }} */ plug) => (plug.type === 'scene' ? MQTT_TYPES.SCENE : plug.type); +const getMqttType = (/** @type {{ uniqueId: string; type: string; }} */ plug) => (plug.type === 'switch' ? MQTT_TYPES.LIGHT : plug.type); const getBaseTopic = (/** @type {{ uniqueId: string; type: string; }} */ plug) => `${discoveryPrefix}/${getMqttType(plug)}/${nodeId}/${plug.uniqueId}`;