Bloodevil / sony_camera_api

sony camera remote api
http://developer.sony.com/develop/cameras/
MIT License
244 stars 60 forks source link

Bug67: Don't assume camera can use latest version of 'getEvent()' #70

Closed mungewell closed 3 years ago

mungewell commented 3 years ago

Older cameras error when code requests to use newest version of 'getEvent()', this code snippet checks which versions the camera actually supports and uses the latest supported.

Failure seen on my QX10. Reported in #67

simon@thevoid:~/sony_camera_api-github$ python2 examples/pyLiveView.py -g
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "examples/pyLiveView.py", line 155, in run
    status = mode['result'][1]
KeyError: 'result'

^CKilled
bjmc commented 3 years ago

This looks like a good bugfix to me!

mungewell commented 3 years ago

Patch pushed with 'type()' removed.

I think that we still need to force version to lowest, otherwise the pysony will (again) assume the highest possible.

bjmc commented 3 years ago

Looks good!

FYI, you don't need keys() either (but it's harmless to have it).

I don't have commit access, but maybe @Bloodevil can take a look at this when they have a chance.

Bloodevil commented 3 years ago

looks good to me thanks for contribute!!