1 parent
8714141630
commit
145896516d
2 files changed
+18
-8
No files matched your search
+15
-7
@@ -139,12 +139,16 @@ void announceDeviceTrigger(bool use_gateway_info, char* topic, char* type, char*
|
|||||||
JsonArray identifiers = device.createNestedArray("identifiers");
|
JsonArray identifiers = device.createNestedArray("identifiers");
|
||||||
|
|
||||||
if (use_gateway_info) {
|
if (use_gateway_info) {
|
||||||
char JSONmessageBuffer[JSON_MSG_BUFFER];
|
|
||||||
serializeJson(modules, JSONmessageBuffer, sizeof(JSONmessageBuffer));
|
|
||||||
|
|
||||||
device["name"] = gateway_name;
|
device["name"] = gateway_name;
|
||||||
device["model"] = JSONmessageBuffer;
|
# ifndef GATEWAY_MODEL
|
||||||
device["manufacturer"] = DEVICEMANUFACTURER;
|
String model = "";
|
||||||
|
serializeJson(modules, model);
|
||||||
|
device["model"] = model;
|
||||||
|
# else
|
||||||
|
device["model"] = GATEWAY_MODEL;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
device["manufacturer"] = GATEWAY_MANUFACTURER;
|
||||||
device["sw_version"] = OMG_VERSION;
|
device["sw_version"] = OMG_VERSION;
|
||||||
identifiers.add(getMacAddress());
|
identifiers.add(getMacAddress());
|
||||||
|
|
||||||
@@ -301,11 +305,15 @@ void createDiscovery(const char* sensor_type,
|
|||||||
|
|
||||||
if (gateway_entity) {
|
if (gateway_entity) {
|
||||||
//device representing the board
|
//device representing the board
|
||||||
|
device["name"] = String(gateway_name);
|
||||||
|
# ifndef GATEWAY_MODEL
|
||||||
String model = "";
|
String model = "";
|
||||||
serializeJson(modules, model);
|
serializeJson(modules, model);
|
||||||
device["name"] = String(gateway_name);
|
|
||||||
device["model"] = model;
|
device["model"] = model;
|
||||||
device["manufacturer"] = DEVICEMANUFACTURER;
|
# else
|
||||||
|
device["model"] = GATEWAY_MODEL;
|
||||||
|
# endif
|
||||||
|
device["manufacturer"] = GATEWAY_MANUFACTURER;
|
||||||
device["sw_version"] = OMG_VERSION;
|
device["sw_version"] = OMG_VERSION;
|
||||||
identifiers.add(String(getMacAddress()));
|
identifiers.add(String(getMacAddress()));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -119,7 +119,9 @@ void announceDeviceTrigger(bool use_gateway_info,
|
|||||||
# define discovery_republish_on_reconnect false
|
# define discovery_republish_on_reconnect false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEVICEMANUFACTURER "OMG_community"
|
#ifndef GATEWAY_MANUFACTURER
|
||||||
|
# define GATEWAY_MANUFACTURER "OMG_community"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-------------- Auto discovery macros-----------------*/
|
/*-------------- Auto discovery macros-----------------*/
|
||||||
// Set the line below to true so as to have autodiscovery working with OpenHAB
|
// Set the line below to true so as to have autodiscovery working with OpenHAB
|
||||||
|
|||||||
Reference in new issue
Block a user