Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Adding mock calls for missing API functionalities. #95

Merged
merged 14 commits into from
Aug 8, 2019
39 changes: 39 additions & 0 deletions src/adafruit_circuitplayground/express.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def __init__(self):
'motion_x': 0,
'motion_y': 0,
'motion_z': 0,
'detect_taps': 1,
FMounz marked this conversation as resolved.
Show resolved Hide resolved
'tapped': False,
'shake': False,
}

Expand All @@ -56,6 +58,24 @@ def button_a(self):
def button_b(self):
return self.__state['button_b']

@property
def detect_taps(self):
return self.__state['detect_taps']

@detect_taps.setter
def detect_taps(self, value):
value_int = int(value)
self.__state['detect_taps'] = value_int if (
FMounz marked this conversation as resolved.
Show resolved Hide resolved
value_int == 1 or value_int == 2) else 1

@property
def tapped(self):
""" Not Implemented!
"""

raise NotImplementedError(
"This method is not implemented by the simulator")

@property
def red_led(self):
return self.__state['red_led']
Expand Down Expand Up @@ -103,5 +123,24 @@ def play_file(self, file_name):
else:
raise NotImplementedError("Please use Python 3 or higher.")

def play_tone(self, frequency, duration):
""" Not Implemented!
"""
raise NotImplementedError(
"This method is not implemented by the simulator")

def start_tone(self, frequency):
""" Not Implemented!
"""
raise NotImplementedError(
"This method is not implemented by the simulator")

def stop_tone(self):
""" Not Implemented!
"""
# Stop playing any tones.
raise NotImplementedError(
"This method is not implemented by the simulator")


cpx = Express()