-
Notifications
You must be signed in to change notification settings - Fork 521
Reduce code duplication with _toggle_state()
function in Flashlight
#4586
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
base: main
Are you sure you want to change the base?
Conversation
## Just some tricks that I think might improve the code! :)
I'm wondering if flashlight is turned off on device side are we getting the state change back in Python code? |
Thanks, I think I made a mistake in the def _toggle_state(self, sr: str, state: bool=True) -> bool:
if ("1" == sr):
self.turned_on = state
return self.turned_on Is it true or what? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, but can you fix this? It's strange looking.
Can you change title like this: Reduce code duplication with |
_toggle_state()
function in Flashlight
Can it will be reviewed, please? |
Flashlight lives in its own repo now: https://github.com/flet-dev/flet-flashlight |
Thanks. Can you see #5287 now, please? |
Just some tricks that I think might improve the code! :)
Description
Test Code
# Test code for the review of this PR
Type of change
Checklist
Screenshots
Additional details
Summary by Sourcery
Enhancements: