diff --git a/src/notifiers/__init__.py b/src/notifiers/__init__.py index f20a3ab9..1c141148 100644 --- a/src/notifiers/__init__.py +++ b/src/notifiers/__init__.py @@ -4,7 +4,7 @@ from models import Config, Item -class Notifier(): +class Notifiers(): def __init__(self, config: Config): self.pushSafer = PushSafer(config) self.smtp = SMTP(config) diff --git a/src/scanner.py b/src/scanner.py index 5baa3ab9..36668a0f 100644 --- a/src/scanner.py +++ b/src/scanner.py @@ -3,7 +3,7 @@ import sys import logging as log from os import path -from notifiers import Notifier +from notifiers import Notifiers from models import Item, Config @@ -22,7 +22,7 @@ def __init__(self): self.amounts = {} self.tgtg_client = TgtgClient( email=self.config.tgtg["username"], password=self.config.tgtg["password"]) - self.notifiers = Notifier(self.config) + self.notifiers = Notifiers(self.config) def _job(self): for item_id in self.item_ids: @@ -75,6 +75,7 @@ def _check_item(self, item: Item): def _send_messages(self, item: Item): log.info( "Sending {0} - new Amount {1}".format(item.display_name, item.items_available)) + self.notifiers.send(item) def run(self): log.info("Scanner started ...")