-
Notifications
You must be signed in to change notification settings - Fork 1
Remove returns that don't do anything (addresses #8) #10
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
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.
LGTM! Can you confirm the examples still run fine? If so, please merge this and make a v2.1 release.
Actually, let's hold on a v2.1 release until we look at #9 and other outstanding issues for low hanging fruit. |
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.
begin()
actually should return a Boolean
def begin(self): | ||
"""! | ||
Initialize the operation of the SerLCD module | ||
|
||
@return **bool** Returns true if the initialization was successful, otherwise False. | ||
""" | ||
# set default settings, as defined in constructor | ||
result0 = self.specialCommand(LCD_DISPLAYCONTROL | self._displayControl) | ||
self.specialCommand(LCD_DISPLAYCONTROL | self._displayControl) | ||
time.sleep(1) | ||
result1 = self.specialCommand(LCD_ENTRYMODESET | self._displayMode) | ||
self.specialCommand(LCD_ENTRYMODESET | self._displayMode) | ||
time.sleep(1) | ||
result2 = self.clearScreen() | ||
self.clearScreen() | ||
time.sleep(1) | ||
|
||
return (bool(result0) & bool(result1) & bool(result2)) | ||
|
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.
Should first check is_connected()
. If it fails, return False
immediately. Otherwise, proceed as before and return True
.
Remove useless returns brought up in #8