use local hour instead of gmt hour

This commit is contained in:
j 2022-10-29 14:45:52 +02:00
parent 8934e8c3e2
commit 869fbfc4f9

View File

@ -168,8 +168,11 @@ class Camera:
time.sleep(1)
print('presets loaded')
def get_hour(self):
return time.localtime().tm_hour
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):
n = float(seconds)
@ -189,7 +192,7 @@ class Camera:
first = steps[0]
steps = steps[1:]
if hour_loop:
self.hour = time.gmtime().tm_hour
self.hour = self.get_hour()
else:
self.hour = None
@ -210,7 +213,7 @@ class Camera:
self.segment_times[first['seqid']] = segment_time
self.sequence_start = t0 = time.time()
for step in steps:
next_hour = time.gmtime().tm_hour
next_hour = self.get_hour()
if hour_loop and next_hour != self.hour:
self.hour = next_hour
break