Compare commits

..

No commits in common. "42be31ca8167d52e500dc3a68b29f9ea2b683bde" and "869fbfc4f9fcf0fd98e5f8b51b6bef62db44dff6" have entirely different histories.

View File

@ -126,20 +126,12 @@ class Camera:
return {} return {}
def get(self, method): def get(self, method):
while True: return requests.get(self.url(method), auth=self.auth).text
try:
return requests.get(self.url(method), auth=self.auth).text
except requests.exceptions.ConnectionError:
time.sleep(0.1)
def put(self, method, data): def put(self, method, data):
if isinstance(data, dict): if isinstance(data, dict):
data = PTZData(data) data = PTZData(data)
while True: return requests.put(self.url(method), data=data, auth=self.auth).text
try:
return requests.put(self.url(method), data=data, auth=self.auth).text
except requests.exceptions.ConnectionError:
time.sleep(0.1)
def momentary(self, cmd, duration=None): def momentary(self, cmd, duration=None):
if duration: if duration:
@ -229,11 +221,6 @@ class Camera:
segment_t0 = time.time() segment_t0 = time.time()
if self.abort: if self.abort:
return return
print('next step %s at %s - %s' % (
steps.index(step),
datetime.now().strftime('%Y-%m-%d_%H:%M:%S'),
json.dumps(step)
))
if isinstance(step, dict): if isinstance(step, dict):
if 'fast' in step or ('speed' in step and step['speed'] > 100): if 'fast' in step or ('speed' in step and step['speed'] > 100):
self.fast_preset(step.get('fast', step.get('preset')), True) self.fast_preset(step.get('fast', step.get('preset')), True)