Open NichtEuler opened 5 years ago
Hi,
ist there a possibility to add an eventhandler to a specific topic, like in System.Net.Mqtt: mqttClient.MessageStream.Where(msg => msg.Topic == "home/lights/kitchen").Subscribe(kitchen);
mqttClient.MessageStream.Where(msg => msg.Topic == "home/lights/kitchen").Subscribe(kitchen);
private void kitchen(MqttApplicationMessage obj) { lightSwitch.Text = "Lights are: " + ByteArrayToString(obj.Payload); }
So you dont have to filter by topic in the eventhandler you've added to client.MqttMsgPublishReceived?
client.MqttMsgPublishReceived
Hi,
ist there a possibility to add an eventhandler to a specific topic, like in System.Net.Mqtt:
mqttClient.MessageStream.Where(msg => msg.Topic == "home/lights/kitchen").Subscribe(kitchen);
So you dont have to filter by topic in the eventhandler you've added to
client.MqttMsgPublishReceived
?