Skip to content

Commit

Permalink
Adding Expensive price notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
daithihearn committed Mar 26, 2023
1 parent 131bbf1 commit e747760
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ExpensivePriceNotifier.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

from services.SmsService import send_sms
from services.PriceService import get_current_price, get_max_price, get_min_price

curr_price = get_current_price()
min_price = get_min_price()
max_price = get_max_price()

message = 'Turn everything off!! Now is the most expensive time. Min price: ' + \
min_price.value_euro + '@' + min_price.hour + ', Max price: ' + max_price.value_euro + '@' + max_price.hour + \
', Current Price: ' + curr_price.value_euro + '@' + curr_price.hour + '.'

print(message)

if curr_price.value == max_price.value:
send_sms(message)
else:
print('No need to warn about the price. Min price is ' +
min_price.value_euro+', max price is' + max_price.value_euro+', current price is '+curr_price.value_euro+'.')

0 comments on commit e747760

Please sign in to comment.