Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- fix web controller recording state so it is latched. #1007

Merged
merged 1 commit into from
Apr 6, 2022

Conversation

Ezward
Copy link
Contributor

@Ezward Ezward commented Apr 5, 2022

@Ezward Ezward requested a review from DocGarbanzo April 5, 2022 20:29
@Ezward Ezward self-assigned this Apr 5, 2022
Copy link
Contributor

@DocGarbanzo DocGarbanzo left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for fixing this.

self.application.angle = data.get('angle', self.application.angle)
self.application.throttle = data.get('throttle', self.application.throttle)
if data.get('drive_mode') is not None:
self.application.mode = data['drive_mode']
self.application.mode_latch = self.application.mode
self.application.recording = data.get('recording', self.application.recording)
if data.get('recording') is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a comment for future improvements. Because you are already getting the entry from the dict, you could use it in the next line, w/o getting it again, i.e.

recording = data.get('recording') 
if recording is not None:
    self.application.recording = recording
    self.application.recording_latch = self.application.recording

or even

recording = data.get('recording') 
if recording is not None:
    self.application.recording_latch = self.application.recording = recording

@DocGarbanzo DocGarbanzo merged commit 6c9ecb9 into main Apr 6, 2022
DocGarbanzo pushed a commit that referenced this pull request Apr 24, 2022
- fix for #996
- version="4.3.10" (on main only, here it is 4.3.6.3).

(cherry picked from commit 6c9ecb9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants