use local hour instead of gmt hour
This commit is contained in:
parent
8934e8c3e2
commit
869fbfc4f9
|
@ -168,8 +168,11 @@ class Camera:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
print('presets loaded')
|
print('presets loaded')
|
||||||
|
|
||||||
|
def get_hour(self):
|
||||||
|
return time.localtime().tm_hour
|
||||||
|
|
||||||
def hour_changed(self):
|
def hour_changed(self):
|
||||||
return self.hour is not None and time.gmtime().tm_hour != self.hour
|
return self.hour is not None and self.get_hour() != self.hour
|
||||||
|
|
||||||
def sleep(self, seconds):
|
def sleep(self, seconds):
|
||||||
n = float(seconds)
|
n = float(seconds)
|
||||||
|
@ -189,7 +192,7 @@ class Camera:
|
||||||
first = steps[0]
|
first = steps[0]
|
||||||
steps = steps[1:]
|
steps = steps[1:]
|
||||||
if hour_loop:
|
if hour_loop:
|
||||||
self.hour = time.gmtime().tm_hour
|
self.hour = self.get_hour()
|
||||||
else:
|
else:
|
||||||
self.hour = None
|
self.hour = None
|
||||||
|
|
||||||
|
@ -210,7 +213,7 @@ class Camera:
|
||||||
self.segment_times[first['seqid']] = segment_time
|
self.segment_times[first['seqid']] = segment_time
|
||||||
self.sequence_start = t0 = time.time()
|
self.sequence_start = t0 = time.time()
|
||||||
for step in steps:
|
for step in steps:
|
||||||
next_hour = time.gmtime().tm_hour
|
next_hour = self.get_hour()
|
||||||
if hour_loop and next_hour != self.hour:
|
if hour_loop and next_hour != self.hour:
|
||||||
self.hour = next_hour
|
self.hour = next_hour
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue
Block a user