sub.py 353 B

1234567891011121314151617181920
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. """
  4. demeter mqtt
  5. name:sub.py
  6. author:rabin
  7. """
  8. from connect import Connect
  9. class Sub(object):
  10. def __init__(self):
  11. Connect(self)
  12. def __del__(self):
  13. pass
  14. def message(self, client, userdata, msg):
  15. #print(msg.topic+" "+str(msg.payload))
  16. self.connect.handle(msg.topic, str(msg.payload))