-
Notifications
You must be signed in to change notification settings - Fork 28
Add support to subscribe to a specific topic #9
Comments
Possible API:
What might be confusing is that - unless we handle field/deviceID mapping internally - if you'd use these APIs multiple times each callback would be called for any field/message topic. |
As per @johanstokking's suggestion on Slack we'll keep it simple and allow the user to optionally filter on a single or array of devices and to filter on a specific field. |
Yep, I'd say one method:
If Note that, when subscribing to a field, the |
For example:
/+/devices/+/up/temperature
.The challenge is that if the topic comes in the
+
are the actual app/device IDs so unless we duplicate MQTT's wildcard matching it's hard to map it to an event with the same name. Probably best to have a single event much like MQTT's message which includes the topic.The text was updated successfully, but these errors were encountered: