-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Milestone
Description
To capture the current 'loud' and 'quiet' options and give us the possibility to expand it in the future to other types of events.
Something along these lines:
class MicroBitSoundEvent:
LOUD = None
QUIET = None
def __init__(self, event_name: string) -> None:
self.event_name = event_name
def __str__(self) -> string:
return "SoundEvent('{}')".format(self.event_name)
def __repr__(self) -> string:
return self.__str__()
MicroBitSoundEvent.LOUD = MicroBitSoundEvent("loud")
MicroBitSoundEvent.QUIET = MicroBitSoundEvent("quiet")
SoundEvent = MicroBitSoundEventSo that the user code will end up:
microphone.was_event(SoundEvent.LOUD)Metadata
Metadata
Assignees
Labels
No labels