1
0

Sound notification support

This commit is contained in:
Jon Michael Aanes 2024-06-02 23:31:01 +02:00
parent 7b905911af
commit 031d9a36cf
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
3 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,8 @@ from . import mailgun
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
SOUND_PATH = 'resource/sound/57808__guitarguy1985__carterattack.mp3'
#SOUND_PATH = 'resource/sound/516855__matrixxx__wake-up-01.wav'
class NotificationType(enum.Enum): class NotificationType(enum.Enum):
EMAIL = 1 EMAIL = 1
@ -30,8 +32,8 @@ def play_loud_and_annoying_sound(
scraper_name: str, scraper_name: str,
latest_dict: frozendict, latest_dict: frozendict,
) -> None: ) -> None:
pass import playsound3
playsound3.playsound(SOUND_PATH, block=False)
NOTIFICATION_TYPE_TO_NOTIFIER = { NOTIFICATION_TYPE_TO_NOTIFIER = {
NotificationType.EMAIL: send_email_notification, NotificationType.EMAIL: send_email_notification,

Binary file not shown.

Binary file not shown.