self.off_flag = 0
self.rtc = RTC()
self.off_on = 1
- self.off_start = "06:00"
- self.off_end = "23:00"
+ self.off_start = "6:0"
+ self.off_end = "23:0"
read_data = EventMesh.publish("get_storage_config","off_on")
if read_data != None:
self.off_on = read_data
EventMesh.subscribe("get_boot_off_time", self.get_boot_off_time)
def set_boot_off_time(self, event, msg):
+ print("set_boot_off_time",msg)
EventMesh.publish("set_storage_config",["off_on",msg[0]])
EventMesh.publish("set_storage_config",["off_start",msg[1]])
EventMesh.publish("set_storage_config",["off_end",msg[2]])
if self.off_on == None:
self.off_on = 1
if self.off_start == None:
- self.off_start = "06:00"
+ self.off_start = "6:0"
- if self.off_on == None:
- self.off_on = "23:00"
+ if self.off_end == None:
+ self.off_end = "23:0"
return [self.off_on,self.off_start,self.off_end]
class setSmsIndexManager(Abstract):#
def __init__(self):
EventMesh.subscribe("push_update_alarm_show", self.update_show_info)
def post_processor_after_instantiation(self):
-
-
+
EventMesh.publish("read_alarminjson")
EventMesh.publish("set_rtc_alarm")
if IFEXIST == True:
with open("/usr/static/storage_file/alarm_msg.json","r",encoding='utf-8') as fd:
alarm_list = ujson.load(fd)
+
+
+ # read_data = EventMesh.publish("get_storage_config","off_on")
+
+ hour1 = str(alarm_list[0]["hour"])+':'+str(alarm_list[0]["minute"])
+ # min1 = str(alarm_list[0]["minute"])
+
+ hour2 = str(alarm_list[1]["hour"])+':'+str(alarm_list[1]["minute"])
+ # min2 = str(alarm_list[1]["minute"])
+ EventMesh.publish("set_boot_off_time",[1,hour1,hour2])
+
+ print("hour1:{}-{}".format(hour1,hour2))
+
+
return alarm_list
def add_alarm(self, event, msg):
msg_data = EventMesh.publish("get_boot_off_time")
EventMesh.debug_log("msg_tmp:{}".format(msg_data))
off_on = 1
- off_start = "06:00"
- off_end = "23:00"
+ off_start = "6:0"
+ off_end = "23:0"
if msg_data[0] != None:
off_on = int(msg_data[0])
if msg_data[1] != None: