Quick-fix to force switch devices to the light mqtt domain

This commit is contained in:
Victor Hagelbäck 2021-04-27 11:36:38 +02:00
parent 74e381f009
commit a633ffacb3

View file

@ -26,7 +26,7 @@ const TOPICS = {
COMMAND: 'set', 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}`; const getBaseTopic = (/** @type {{ uniqueId: string; type: string; }} */ plug) => `${discoveryPrefix}/${getMqttType(plug)}/${nodeId}/${plug.uniqueId}`;