added entities as devices and stability in ble

This commit is contained in:
Marcus Westin 2020-01-21 14:24:02 +00:00
parent 85a194b794
commit ff1952cd88
3 changed files with 29 additions and 26 deletions

View file

@ -35,11 +35,19 @@ const getSettingsTopic = () => `plejd/settings`;
const getDiscoveryPayload = device => ({
schema: 'json',
name: device.name,
unique_id: `light.plejd.${device.name.toLowerCase().replace(/ /g, '')}`,
unique_id: device.serialNumber,
state_topic: getStateTopic(device),
command_topic: getCommandTopic(device),
optimistic: false,
brightness: `${device.dimmable}`
retain: true,
brightness: `${device.dimmable}`,
device: {
identifiers: device.serialNumber,
manufacturer: 'Plejd',
model: device.typeName,
name: device.name,
sw_version: device.version
}
});
// #endregion