This commit is contained in:
j 2018-12-06 13:24:45 +01:00
parent fa6092784c
commit 9bf1dfd6e9

View File

@ -228,13 +228,12 @@ class Camera:
raise Exception('unknown preset %s' % id) raise Exception('unknown preset %s' % id)
preset = preset[0] preset = preset[0]
i = preset['position'] i = preset['position']
#info = etree_to_dict(xml.etree.ElementTree.fromstring(self.get('presets/%s' % id)))
#i = info['PTZPreset']['AbsoluteHigh']
if i['elevation'] < 0: if i['elevation'] < 0:
i['elevation'] -= 1 i['elevation'] -= 1
i['azimuth'] += 1 i['azimuth'] += 1
print('goto preset', id, i['elevation'], i['azimuth'], i['absoluteZoom']) print('goto preset', id, i['elevation'], i['azimuth'], i['absoluteZoom'])
return self.goto(i['elevation'], i['azimuth'], i['absoluteZoom'], pan=pan, tilt=tilt, zoom=zoom, zoom_last=zoom_last) return self.goto(i['elevation'], i['azimuth'], i['absoluteZoom'],
pan=pan, tilt=tilt, zoom=zoom, zoom_last=zoom_last)
def goto(self, elevation, azimuth, absoluteZoom, speed=1, pan=None, tilt=None, zoom=None, zoom_last=False): def goto(self, elevation, azimuth, absoluteZoom, speed=1, pan=None, tilt=None, zoom=None, zoom_last=False):
t0 = time.time() t0 = time.time()
@ -364,7 +363,6 @@ class Camera:
def get_presets_xml(self): def get_presets_xml(self):
return self.get('presets') return self.get('presets')
def get_presets(self, details=False): def get_presets(self, details=False):
system_presets = list(range(33, 47)) + list(range(90, 106)) system_presets = list(range(33, 47)) + list(range(90, 106))
presets = etree_to_list(xml.etree.ElementTree.fromstring(self.get('presets'))) presets = etree_to_list(xml.etree.ElementTree.fromstring(self.get('presets')))
@ -377,6 +375,3 @@ class Camera:
preset['position'] = preset.pop('AbsoluteHigh') preset['position'] = preset.pop('AbsoluteHigh')
preset['name'] = preset.pop('presetName') preset['name'] = preset.pop('presetName')
return presets return presets
#/PTZCtrl/channels/<ID>/patterns/<ID>/recordstart
#/PTZCtrl/channels/<ID>/patterns/<ID>/recordstop