diff --git a/database_caller.py b/database_caller.py index eccba9c..ecc1d77 100755 --- a/database_caller.py +++ b/database_caller.py @@ -587,7 +587,7 @@ if __name__ == '__main__': - update_frequencies = {'stocks':1, 'crypto':5, 'forex':60, 'news':60, 'weather': 120, 'sports': 1440} #minutes + update_frequencies = {'stocks':1, 'crypto':5, 'forex':60, 'news':120, 'weather': 120, 'sports': 1440} #minutes NY_zone = pytz.timezone('America/New_York') CET_zone = pytz.timezone('EST') diff --git a/setup_config_files.sh b/setup_config_files.sh index 5271231..029ad22 100755 --- a/setup_config_files.sh +++ b/setup_config_files.sh @@ -23,13 +23,14 @@ echo '{"update_available": false, "first_boot": true}' >> system_info.json echo [\"Standard\", [[\"Stocks\", \"Crypto\", \"Forex\"]]] >> display_settings.json echo '{"stocks": {"time": "06/03/2022 04:12:09", "force": true}, "crypto": {"time": "06/03/2022 04:10:39", "force": true}, "news": {"time": "06/03/2022 04:07:09", "force": true}, "weather": {"time": "06/03/2022 04:08:20", "force": true}, "forex": {"time": "06/03/2022 03:54:02", "force": true}, "sports": {"time": "06/03/2022 04:10:09", "force": true}}' >> last_updates.json + echo '{"feature": "Stocks", "speed": "medium","speed2": "medium", "animation": "down", "percent": false, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"ETH,USD": {"current": "2629.32", "24hr_change": "-27.6432", "percent_change": "-1.04"}, "BTC,USD": {"current": "38161.00", "24hr_change": "-50.8386", "percent_change": "-0.13"}, "BNB,USD": {"current": "372.57", "24hr_change": "0.4140", "percent_change": "0.11"}, "ADA,BTC": {"current": "0.0000", "24hr_change": "-0.0000", "percent_change": "-3.74"}}}' >> crypto_settings.json echo '{"feature": "Sports (Team Stats)", "speed": "medium", "speed2": "medium","animation": "down", "title": true, "leagues": {}}' >> league_tables.json -echo {\"feature\": \"Current Weather\", \"speed\": \"medium\", \"speed2\": \"medium\", \"animation\": \"down\", \"temp\": \"celsius\", \"wind_speed\": \"miles/sec\", \"colour\": \"white\", \"city_colour\": \"yellow\", \"title\": true, \"locations\": {}, \"current_weather\": true} >> current_weather.json +echo {\"feature\": \"Current Weather\", \"speed\": \"medium\", \"speed2\": \"medium\", \"animation\": \"down\", \"temp\": \"celsius\", \"wind_speed\": \"miles/hour\", \"colour\": \"white\", \"city_colour\": \"yellow\", \"title\": true, \"locations\": {}, \"current_weather\": true} >> current_weather.json echo '{"feature": "Stocks", "speed": "medium", "speed2": "medium", "animation": "down", "percent": false, "point": true, "logos": true, "chart": false, "title": true, "symbols": {"AAPL": {"current": "164.02", "change": "-1.59", "percent_change": "-0.97"}, "MSFT": {"current": "288.29", "change": "-1.32", "percent_change": "-0.46"}, "GOOG": {"current": "2586.74", "change": "-34.01", "percent_change": "-1.31"}, "NFLX": {"current": "380.52", "change": "-7.59", "percent_change": "-1.99"}}}' >> stocks_settings.json -echo {\"feature\": \"Current Weather\", \"speed\": \"medium\", \"speed2\": \"medium\", \"animation\": \"down\", \"temp\": \"celsius\", \"wind_speed\": \"miles/sec\", \"colour\": \"white\", \"city_colour\": \"yellow\", \"title\": true, \"locations\": {}, \"current_weather\": true} >> daily_weather.json +echo {\"feature\": \"Current Weather\", \"speed\": \"medium\", \"speed2\": \"medium\", \"animation\": \"down\", \"temp\": \"celsius\", \"wind_speed\": \"miles/hour\", \"colour\": \"white\", \"city_colour\": \"yellow\", \"title\": true, \"locations\": {}, \"current_weather\": true} >> daily_weather.json echo '{"feature": "Sports (Live Games)", "speed": "medium", "speed2": "medium", "animation": "down", "title": true, "leagues": {}}' >> live_games.json echo '{"feature": "Custom Messages", "speed": "Medium", "speed2": "medium", "animation": "Down", "title": false, "messages": [{"name": "welcome", "text": "Welcome to Fintic!", "text_colour": "White", "size": "Large", "background_colour": "Black"}, {"name": "get_started", "text": "To get started, connect your device to the \"Fintic Hotspot\" and access \"fintic.local:1024\" on your web browser. You can connect your ticker to Wi-Fi there.", "text_colour": "White", "size": "Small", "background_colour": "Black"}]}' >> message_settings.json echo '{"feature": "Sports (Upcoming Games)", "speed": "medium", "speed2": "medium", "animation": "down", "title": true, "leagues": {"NFL": [{"date": "2021-11-22", "time": "01:20:00", "round": "11", "home_team": "Los Angeles Chargers", "home_score": "41", "away_team": "Pittsburgh Steelers", "away_score": "37"}, {"date": "2021-11-23", "time": "01:15:00", "round": "11", "home_team": "Tampa Bay Buccaneers", "home_score": "0", "away_team": "New York Giants", "away_score": "0"}, {"date": "2021-11-25", "time": "17:30:00", "round": "12", "home_team": "Detroit Lions", "home_score": null, "away_team": "Chicago Bears", "away_score": null}, {"date": "2021-11-25", "time": "21:30:00", "round": "12", "home_team": "Dallas Cowboys", "home_score": null, "away_team": "Las Vegas Raiders", "away_score": null}, {"date": "2021-11-26", "time": "01:20:00", "round": "12", "home_team": "New Orleans Saints", "home_score": null, "away_team": "Buffalo Bills", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Cincinnati Bengals", "home_score": null, "away_team": "Pittsburgh Steelers", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Houston Texans", "home_score": null, "away_team": "New York Jets", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Indianapolis Colts", "home_score": null, "away_team": "Tampa Bay Buccaneers", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Jacksonville Jaguars", "home_score": null, "away_team": "Atlanta Falcons", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Miami Dolphins", "home_score": null, "away_team": "Carolina Panthers", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "New England Patriots", "home_score": null, "away_team": "Tennessee Titans", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "New York Giants", "home_score": null, "away_team": "Philadelphia Eagles", "away_score": null}, {"date": "2021-11-28", "time": "21:05:00", "round": "12", "home_team": "Denver Broncos", "home_score": null, "away_team": "Los Angeles Chargers", "away_score": null}, {"date": "2021-11-28", "time": "21:25:00", "round": "12", "home_team": "Green Bay Packers", "home_score": null, "away_team": "Los Angeles Rams", "away_score": null}, {"date": "2021-11-28", "time": "21:25:00", "round": "12", "home_team": "San Francisco 49ers", "home_score": null, "away_team": "Minnesota Vikings", "away_score": null}], "NBA": [{"date": "2021-11-22", "time": "01:20:00", "round": "11", "home_team": "Los Angeles Chargers", "home_score": "41", "away_team": "Pittsburgh Steelers", "away_score": "37"}, {"date": "2021-11-23", "time": "01:15:00", "round": "11", "home_team": "Tampa Bay Buccaneers", "home_score": "0", "away_team": "New York Giants", "away_score": "0"}, {"date": "2021-11-25", "time": "17:30:00", "round": "12", "home_team": "Detroit Lions", "home_score": null, "away_team": "Chicago Bears", "away_score": null}, {"date": "2021-11-25", "time": "21:30:00", "round": "12", "home_team": "Dallas Cowboys", "home_score": null, "away_team": "Las Vegas Raiders", "away_score": null}, {"date": "2021-11-26", "time": "01:20:00", "round": "12", "home_team": "New Orleans Saints", "home_score": null, "away_team": "Buffalo Bills", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Cincinnati Bengals", "home_score": null, "away_team": "Pittsburgh Steelers", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Houston Texans", "home_score": null, "away_team": "New York Jets", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Indianapolis Colts", "home_score": null, "away_team": "Tampa Bay Buccaneers", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Jacksonville Jaguars", "home_score": null, "away_team": "Atlanta Falcons", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "Miami Dolphins", "home_score": null, "away_team": "Carolina Panthers", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "New England Patriots", "home_score": null, "away_team": "Tennessee Titans", "away_score": null}, {"date": "2021-11-28", "time": "18:00:00", "round": "12", "home_team": "New York Giants", "home_score": null, "away_team": "Philadelphia Eagles", "away_score": null}, {"date": "2021-11-28", "time": "21:05:00", "round": "12", "home_team": "Denver Broncos", "home_score": null, "away_team": "Los Angeles Chargers", "away_score": null}, {"date": "2021-11-28", "time": "21:25:00", "round": "12", "home_team": "Green Bay Packers", "home_score": null, "away_team": "Los Angeles Rams", "away_score": null}, {"date": "2021-11-28", "time": "21:25:00", "round": "12", "home_team": "San Francisco 49ers", "home_score": null, "away_team": "Minnesota Vikings", "away_score": null}]}}' >> upcoming_games.json @@ -38,6 +39,7 @@ echo '{"speed": "medium", "speed2": "medium", "animation": "down", "title": true echo '{"feature": "News", "speed": "medium", "speed2": "medium", "animation": "down", "country": "US", "category": "General", "title": true, "headlines": [], "use_category": true, "use_country": false, "num_headlines": "10"}' >> news_settings.json echo '{"speed": "slow", "speed2": "medium","animation": "down", "title": true, "pause": "/", "images": []}' >> image_settings.json echo '{"feature": "Sports (Past Games)", "speed2": "medium", "speed": "medium", "animation": "down", "title": true, "leagues": {}}' >> past_games.json + echo '{"brightness": 10, "country_code": "GB", "hostname": "fintic"}' >> general_settings.json chmod 777 * diff --git a/stockTicker.py b/stockTicker.py index 327990a..be04c89 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -1254,11 +1254,11 @@ class StockTicker(): arrow, change = self.getArrow(change) percent_change = '%.2f' % abs(float(info['percent_change'])) + '%' - point_change = str(abs(change)) + point_change = '%.2f' % abs(change) print(percent_change, point_change) - current = str(float(info['current'])) #TEXT + current = '%.2f' % float(info['current']) #TEXT @@ -1338,10 +1338,10 @@ class StockTicker(): if all_stocks_settings["percent"]: change = '%.2f' % abs(float(info['percent_change'])) + '%' else: - change = str(abs(change)) + change = '%.2f' % abs(change) - current = str(float(info['current'])) #TEXT + current = '%.2f' % float(info['current']) #TEXT midFrame = self.textToImageProf(ticker, current, change, arrow, font=ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT if all_stocks_settings['logos']: diff --git a/templates/index.html b/templates/index.html index 62a57b1..e279445 100644 --- a/templates/index.html +++ b/templates/index.html @@ -715,11 +715,11 @@ > - + - + - + @@ -787,11 +787,11 @@ > - + - + - + @@ -1185,11 +1185,11 @@ > - + - + - + @@ -1257,11 +1257,11 @@ > - + - + - + @@ -1657,11 +1657,11 @@ > - + - + - + @@ -1729,11 +1729,11 @@ > - + - + - + @@ -2131,11 +2131,11 @@ > - + - + - + @@ -2203,11 +2203,11 @@ > - + - + - + @@ -2281,9 +2281,9 @@ > - + - + @@ -2317,9 +2317,9 @@ > - + - + @@ -2555,11 +2555,11 @@ > - + - + - + @@ -2627,11 +2627,11 @@ > - + - + - + @@ -2705,9 +2705,9 @@ > - + - + @@ -2741,9 +2741,9 @@ > - + - + @@ -3009,11 +3009,11 @@ > - + - + - + @@ -3081,11 +3081,11 @@ > - + - + - + @@ -3119,23 +3119,23 @@ > - + - + - + - + - + - + - + - + - + @@ -3152,6 +3152,17 @@ value="" id="flexCheckChecked30" + + {% + + if + + news_settings.use_country%} + + checked + + {%endif%} + /> @@ -3185,19 +3196,19 @@ > - + - + - + - + - + - + - + @@ -3219,7 +3230,7 @@ if - news_settings.title%} + news_settings.use_category%} checked @@ -3255,15 +3266,15 @@ > - + - + - + - + - + @@ -3521,11 +3532,11 @@ > - + - + - + @@ -3593,11 +3604,11 @@ > - + - + - + @@ -3823,11 +3834,11 @@ > - + - + - + @@ -3895,11 +3906,11 @@ > - + - + - + @@ -4125,11 +4136,11 @@ > - + - + - + @@ -4197,11 +4208,11 @@ > - + - + - + @@ -4423,11 +4434,11 @@ > - + - + - + @@ -4495,11 +4506,11 @@ > - + - + - + @@ -4771,11 +4782,11 @@ > - + - + - + @@ -4843,11 +4854,11 @@ > - + - + - + @@ -5137,11 +5148,11 @@ > - + - + - + @@ -5209,11 +5220,11 @@ > - + - + - + @@ -5499,11 +5510,11 @@ > - + - + - + @@ -5571,11 +5582,11 @@ > - + - + - +