# -*- 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)