leng-yue / py-scrcpy-client

An easy to use python scrcpy client
https://leng-yue.github.io/py-scrcpy-client/
MIT License
283 stars 71 forks source link

added disconnect listener #40

Closed FieryRMS closed 1 year ago

FieryRMS commented 1 year ago

fixes #38 self.__video_socket.recv returns an empty byte string when device gets disconnected. I also added a new event EVENT_DISCONNECT that is called when disconnect happens.

https://github.com/leng-yue/py-scrcpy-client/blob/f94749b9d187e264e2ef394a9b00a2228572f79f/scrcpy/core.py#L227

codecov-commenter commented 1 year ago

Codecov Report

Merging #40 (ca55a2b) into main (f94749b) will decrease coverage by 0.17%. The diff coverage is 85.71%.

@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
- Coverage   98.34%   98.17%   -0.18%     
==========================================
  Files           3        3              
  Lines         543      547       +4     
==========================================
+ Hits          534      537       +3     
- Misses          9       10       +1     
Flag Coverage Δ
unittests 98.17% <85.71%> (-0.18%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
scrcpy/core.py 93.23% <83.33%> (-0.62%) :arrow_down:
scrcpy/const.py 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more