Skip to content

Raise NotImplementedError if using non-Express features #86

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

Merged
merged 3 commits into from
Jan 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions adafruit_circuitplayground/express.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ def __init__(self):

super().__init__()

@property
def _unsupported(self):
"""This feature is not supported on Circuit Playground Express."""
raise NotImplementedError("This feature is not supported on Circuit Playground Express.")

# The following is a list of the features available in other Circuit Playground modules but
# not available for Circuit Playground Express. If called while using a Circuit Playground
# Express, they will result in the NotImplementedError raised in the property above.
sound_level = _unsupported
loud_sound = _unsupported


cpx = Express() # pylint: disable=invalid-name
"""Object that is automatically created on import.
Expand Down