Skip to content

Commit

Permalink
Bug67: Don't assume camera can use latest version of 'getEvent()' (#70)
Browse files Browse the repository at this point in the history
* Bug67: Don't assume camera can use latest version of 'getEvent()'

* Remove 'type()' check
  • Loading branch information
mungewell committed Apr 3, 2021
1 parent d65482c commit d0d06d0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions examples/pyLiveView.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,20 @@ def run(self):
lst = SonyAPI.LiveviewStreamThread(url)
lst.start()

versions = camera.getVersions()
if versions and 'result' in versions.keys():
version = versions['result'][-1]
else:
version = '1.0'

while not self.event_terminate.isSet():
# Handle events from the camera (record start/stop)
if self.frame_count % 50 == 0:
mode = camera.getEvent(["false"])

This comment has been minimized.

Copy link
@Curry-flex

Curry-flex Nov 6, 2023

done

mode = camera.getEvent(["false"], version=version)
else:
mode = None

if mode and type(mode) == dict:
if mode and 'result' in mode.keys():
status = mode['result'][1]
if self.active == False and status['cameraStatus'] == 'MovieRecording':
self.frame_count = 0
Expand Down

1 comment on commit d0d06d0

@Curry-flex
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Please sign in to comment.