Skip to content
This repository was archived by the owner on Mar 15, 2021. It is now read-only.

add an example of subscribing to an mqtt device topic #91

Conversation

tompscanlan
Copy link
Contributor

Submitted for discussion. I'm guessing this was the direction you were headed, right?

This is a package for listening to on an mqtt topic. A device would publish to the topic and we receive the message. The next step would be to pass this on to the DCC.

I'm adding this because I'd like to set up some demo devices and wanted to make sure this is what you were expecting that would look like.


import pint

from liota.device_comms.mqtt_device_comms import MqttDeviceComms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tompscanlan The device entity should remain independent of the device_comms.
Basically, the con object can be passed to it for collecting the message over device_comms and parsing them in required device format.

Please refer DCC entity, device should be designed in a similar way.

https://github.com/vmware/liota/blob/master/liota/dccs/iotcc.py

Also, refer this pull request for more details #90

class PackageClass(LiotaPackage):

def __init__(self):
super(PackageClass, self).__init__()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package class should use the device_comms rather than the device entity.

@tompscanlan
Copy link
Contributor Author

Thanks for the notes. Closing as this was for discussion only.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants