toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final mqttTopic = this.mqttTopic;
  final payload = this.payload;
  return {
    'mqttTopic': mqttTopic,
    if (payload != null) 'payload': payload,
  };
}