Skip to content

Commit 3147b14

Browse files
authored
Merge pull request #975 from sweetpants/patch-1
MQTT Add description to domoticz/out
2 parents 8dec253 + b309e99 commit 3147b14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hardware/MQTT.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ void MQTT::SendDeviceInfo(const int m_HwdID, const uint64_t DeviceRowIdx, const
514514
if (!m_IsConnected)
515515
return;
516516
std::vector<std::vector<std::string> > result;
517-
result = m_sql.safe_query("SELECT DeviceID, Unit, Name, [Type], SubType, nValue, sValue, SwitchType, SignalLevel, BatteryLevel, Options FROM DeviceStatus WHERE (HardwareID==%d) AND (ID==%" PRIu64 ")", m_HwdID, DeviceRowIdx);
517+
result = m_sql.safe_query("SELECT DeviceID, Unit, Name, [Type], SubType, nValue, sValue, SwitchType, SignalLevel, BatteryLevel, Options, Description FROM DeviceStatus WHERE (HardwareID==%d) AND (ID==%" PRIu64 ")", m_HwdID, DeviceRowIdx);
518518
if (result.size() > 0)
519519
{
520520
std::vector<std::string> sd = result[0];
@@ -529,6 +529,7 @@ void MQTT::SendDeviceInfo(const int m_HwdID, const uint64_t DeviceRowIdx, const
529529
int RSSI = atoi(sd[8].c_str());
530530
int BatteryLevel = atoi(sd[9].c_str());
531531
std::map<std::string, std::string> options = m_sql.BuildDeviceOptions(sd[10]);
532+
std::string description = sd[11];
532533

533534
Json::Value root;
534535

@@ -554,6 +555,7 @@ void MQTT::SendDeviceInfo(const int m_HwdID, const uint64_t DeviceRowIdx, const
554555
root["RSSI"] = RSSI;
555556
root["Battery"] = BatteryLevel;
556557
root["nvalue"] = nvalue;
558+
root["description"] = description;
557559

558560
//give all svalues separate
559561
std::vector<std::string> strarray;

0 commit comments

Comments
 (0)