-
Notifications
You must be signed in to change notification settings - Fork 144
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
show better error message for sevensegment demo #76
Conversation
ps. i haven't tested this on python 2.7; 3.4 only.. (rpi2 jessie) |
I think it he emulators have a seven seg transform that should be accommodated as well |
@rm-hull in that case this isn't a good fix. Ideally we should be able to query a luma library for their sevensegment devices. Thoughts? |
Maybe do a |
Not that it's terribly important but this PR doesn't have any effect on OSX either;
what it does show is that the settings can be printed earlier to clarify what params are used, e.g.
|
@@ -56,12 +56,12 @@ def get_device(actual_args=None): | |||
config = cmdline.load_config(args.config) | |||
args = parser.parse_args(config + actual_args) | |||
|
|||
print(display_settings(args)) |
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.
makes sense 👍
For OSX, I just checked, and the seven segment demo command args are:
That continues to work with 937eb9c that I just pushed |
@@ -68,6 +69,11 @@ def show_message_alt(seg, msg, delay=0.1): | |||
def main(): | |||
# create seven segment device | |||
device = get_device() | |||
|
|||
if not hasattr(device, 'segment_mapper'): |
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.
Hmmm - thinking about it, this check would be better off in the sevensegment
class instead
Looks like that didn't help either, e.g.:
|
Presumably that fails earlier in the init, because OSX doesnt have the i2c device ? p.s. it would be useful if the version printed something like:
|
when using unsupported devices.
fixes #71