only send device update info when it is extractable
This commit is contained in:
@@ -423,6 +423,11 @@ class BusHandler : public WaitThread {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the @a Device instance for accessing the bus.
|
||||
*/
|
||||
const Device* getDevice() const { return m_device; }
|
||||
|
||||
/**
|
||||
* Clear stored values (e.g. scan results).
|
||||
*/
|
||||
|
||||
@@ -952,8 +952,10 @@ void MqttHandler::run() {
|
||||
publishDefinition(m_replacers, "def_global_uptime-", uptimeTopic, "global", "uptime", "def_global-");
|
||||
publishDefinition(m_replacers, "def_global_updatecheck-", m_globalTopic.get("", "updatecheck"), "global",
|
||||
"updatecheck", "def_global-");
|
||||
publishDefinition(m_replacers, "def_global_updatecheck_device-", m_globalTopic.get("", "updatecheck"), "global",
|
||||
"updatecheck_device", "");
|
||||
if (m_busHandler->getDevice()->supportsEnhancedInfos()) {
|
||||
publishDefinition(m_replacers, "def_global_updatecheck_device-", m_globalTopic.get("", "updatecheck"),
|
||||
"global", "updatecheck_device", "");
|
||||
}
|
||||
publishDefinition(m_replacers, "def_global_scan-", m_globalTopic.get("", "scan"), "global", "scan",
|
||||
"def_global-");
|
||||
}
|
||||
|
||||
@@ -205,6 +205,11 @@ class Device {
|
||||
*/
|
||||
bool isEnhancedProto() const { return m_enhancedProto; }
|
||||
|
||||
/**
|
||||
* @return whether the device supports the ebusd enhanced protocol and supports querying extra infos.
|
||||
*/
|
||||
bool supportsEnhancedInfos() const { return m_enhancedProto && m_extraFatures & 0x01; }
|
||||
|
||||
/**
|
||||
* Set the @a DeviceListener.
|
||||
* @param listener the @a DeviceListener.
|
||||
|
||||
Reference in New Issue
Block a user