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
44 changes: 43 additions & 1 deletion src/adafruit_circuitplayground/express.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def __init__(self):
'light': 0,
'motion_x': 0,
'motion_y': 0,
'motion_z': 0
'motion_z': 0,
'detect_taps': 1,
FMounz marked this conversation as resolved.
Show resolved Hide resolved
'tapped': False,

}

self.pixels = Pixel(self.__state)
Expand All @@ -55,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):
"""
Detects when the board has been tapped.
Sorry, this mehod is not implemented yet.
FMounz marked this conversation as resolved.
Show resolved Hide resolved
FMounz marked this conversation as resolved.
Show resolved Hide resolved
"""
raise NotImplementedError("This method is not available")

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

def play_tone(self, frequency, duration):
"""
Method that plays a tone at a given frequency for a fixed duration.
Sorry, this mehod is not implemented yet.
"""
raise NotImplementedError("This method is not available")

def start_tone(self, frequency):
"""
Method that plays a tone at a given frequency.
Sorry, this mehod is not implemented yet.
FMounz marked this conversation as resolved.
Show resolved Hide resolved
"""
raise NotImplementedError("This method is not available")

def stop_stone(self, frequency):
FMounz marked this conversation as resolved.
Show resolved Hide resolved
"""
Method that stops the playing.
Sorry, this mehod is not implemented yet.
FMounz marked this conversation as resolved.
Show resolved Hide resolved
"""
raise NotImplementedError("This method is not available")


cpx = Express()