Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
everettsouthwick authored Apr 17, 2024
2 parents 36b6607 + 2af731b commit 8ae48f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ This above configuration will notify you if a new appointment is found for Decem

Default: []

Type: List or Integer
Type: Comma Seperated List or Integer

This represents the IDs of the enrollment centers you wish to monitor. This can either be a list of locations, or a singular location represented by an integer. This list is used in addition to whatever arguments you pass in at run-time of the script. For more information on locations, please see [LOCATIONS.md](LOCATIONS.md).

```json
{
"location_ids": [ 5140 ]
"location_ids": [ 5140,5444 ]
}
```

Expand Down Expand Up @@ -99,7 +99,7 @@ or
### Test Notifications
To test your notification configuration, run the following command:
```shell
python tty.py -t
python ttp.py -t
```

## Retrieval Interval
Expand Down Expand Up @@ -146,4 +146,4 @@ This indicates the latest appointment you would like to be notified for. To be n


[0]: https://github.com/caronc/apprise
[1]: https://github.com/caronc/apprise#supported-notifications
[1]: https://github.com/caronc/apprise#supported-notifications
6 changes: 3 additions & 3 deletions src/notifcation_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def send_notification(self, body: str, level: int = 1) -> None:
level (int, optional): The level of the notification. If the level is less than the configured notification
level, the notification will not be sent. Defaults to 1.
"""
print(body)
print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: {body}\n")

# Check the level to see if we still want to send it. If level is none, it means
# the message will always be printed. For example, this is used when testing notifications.
Expand All @@ -58,9 +58,9 @@ def send_notification(self, body: str, level: int = 1) -> None:
# If you encounter Apprise errors, https://github.com/caronc/apprise/wiki/Development_LogCapture
# may be useful.
if result is None:
print('error: No notifications sent (configuration error)')
print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: No notifications sent (configuration error)')
elif result is False:
print('error: At least 1 notification failed to send')
print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: At least 1 notification failed to send')

def new_appointment(self, location_id: int, appointments: List[Schedule]) -> None:
"""
Expand Down
4 changes: 2 additions & 2 deletions src/schedule_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _clear_database_of_claimed_appointments(
)

if cursor.rowcount > 0:
print(f"Removed {cursor.rowcount} appointments that have been claimed for location {location_id}.\n")
print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: Removed {cursor.rowcount} appointments that have been claimed for location {location_id}.\n")

conn.commit()
conn.close()
Expand All @@ -152,7 +152,7 @@ def _get_schedule(self, location_id: int) -> None:
).json()

if not appointments:
print(f"No active appointments available for location {location_id}.")
print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: No active appointments available for location {location_id}.")
return

schedule = []
Expand Down

0 comments on commit 8ae48f5

Please sign in to comment.