Skip to content

Support registration of a custom topic name with MQTT publisher #134

@VigneshVSV

Description

@VigneshVSV

Please describe.
Topic names are autogenerated from the event name or observable name, & prefixed with thing ID, which is fine.

We should also allow registering custom topic names just like one can add a custom URL path for the HTTP protocol.

Describe the solution you'd like
Rough steps:

  • define add_observable and add_event methods with signature (affordance: InteractionAffordance, topic: str) -> None on hololinked.server.mqtt.MQTTPublisher.
  • store the custom topic names per interaction affordance (events and observable properties only, we dont support MQTT req rep yet). A rough idea of point 1 & 2 can be seen in HTTP implementation
  • use the topic in the MQTT publish method, fit the value into the TD as well

Please add docs. Test locally as we need too add some infrastructure in CI/CD to test in pipeline.

Additional context
If contributing first time, CONTRIBUTING.md can help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions