1234567891011121314151617181920212223 |
- # -*- coding: utf-8 -*-
- """
- demeter web
- name:admin.py
- author:rabin
- """
- import time
- from demeter.core import *
- from demeter.mqtt import *
- timeSleep = 3600*24
- # 同步时间,24小时同步一次
- class Timesync(object):
- def run(self):
- self.handle()
- time.sleep(timeSleep)
- def handle(self):
- pub = Pub()
- key = 'time/bh'
- value = Demeter.date(Demeter.time())
- pub.push(key, value)
|