-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
131bbf1
commit e747760
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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+'.') |