Include QoS and retain in MQTT debug info (#5759)

This commit is contained in:
Erik Montnemery 2020-05-06 12:58:19 +02:00 committed by GitHub
parent c631554eb0
commit e5abb95f5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,16 +75,15 @@ class MQTTMessages extends LitElement {
private _renderSingleMessage(message): TemplateResult {
const topic = message.topic;
return this._showTopic
? html`
<ul class="message-with-topic">
<li>Topic: <code>${topic}</code></li>
<li>
Payload: ${this._renderSinglePayload(message)}
</li>
</ul>
`
: this._renderSinglePayload(message);
return html`
<ul class="message-with-topic">
${this._showTopic ? html` <li>Topic: <code>${topic}</code></li> ` : ""}
<li>QoS: ${message.qos}${message.retain ? ", Retained" : ""}</li>
<li>
Payload: ${this._renderSinglePayload(message)}
</li>
</ul>
`;
}
private _renderSinglePayload(message): TemplateResult {