Skip to content

Commit

Permalink
fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Der-Henning committed Sep 13, 2021
1 parent 75902a8 commit 4a73165
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/notifiers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions src/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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:
Expand Down Expand Up @@ -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 ...")
Expand Down

0 comments on commit 4a73165

Please sign in to comment.