Skip to content

Commit 8ffa9af

Browse files
authored
Merge pull request #86 from kattni/express-notimplementederror
Raise NotImplementedError if using non-Express features
2 parents 2cf0f40 + fdce477 commit 8ffa9af

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

adafruit_circuitplayground/express.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ def __init__(self):
7171

7272
super().__init__()
7373

74+
@property
75+
def _unsupported(self):
76+
"""This feature is not supported on Circuit Playground Express."""
77+
raise NotImplementedError("This feature is not supported on Circuit Playground Express.")
78+
79+
# The following is a list of the features available in other Circuit Playground modules but
80+
# not available for Circuit Playground Express. If called while using a Circuit Playground
81+
# Express, they will result in the NotImplementedError raised in the property above.
82+
sound_level = _unsupported
83+
loud_sound = _unsupported
84+
7485

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

0 commit comments

Comments
 (0)