bug fix and update button
This commit is contained in:
parent
9c6ad0cde2
commit
9d9306245e
@ -1 +1 @@
|
||||
{"feature": "Stocks", "speed": "medium", "animation": "down", "percent": false, "point": false, "logos": true, "chart": false, "title": true, "symbols": {"NEO,USD": {"current": 39.96, "24hr_change": -7.219334624451841}, "BTC,USD": {"current": 58157, "24hr_change": -4.272633605785742}, "ETH,BTC": {"current": 0.07040904, "24hr_change": -4.2611160146511455}, "ADA,GBP": {"current": 1.34, "24hr_change": -3.8299564614508417}}}
|
||||
{"feature": "Stocks", "speed": "medium", "animation": "down", "percent": false, "point": false, "logos": true, "chart": false, "title": true, "symbols": {"NEO,USD": {"current": 41.17, "24hr_change": -0.8456587230187674}, "BTC,USD": {"current": 58006, "24hr_change": 0.3176129592444612}, "ETH,BTC": {"current": 0.07311235, "24hr_change": 0.7542195107438717}, "ADA,GBP": {"current": 1.4, "24hr_change": 1.2844510982491046}}}
|
@ -1 +1 @@
|
||||
{"feature": "Current Weather", "speed": "medium", "animation": "down", "temp": "celsius", "wind_speed": "miles/sec", "colour": "white", "city_colour": "yellow", "title": true, "locations": {"Tokyo": {"main_weather": "Clouds", "description": "scattered clouds", "temp": 10.82, "min_temp": 10.82, "max_temp": 17.16, "feels_like": 9.92, "humidity": 75, "clouds": 40, "wind_speed": 0.89, "wind_direction": 301, "visibility": 10000, "uv": 0, "rain_chance": 0}, "London": {"main_weather": "Clouds", "description": "overcast clouds", "temp": 12.65, "min_temp": 7.01, "max_temp": 12.79, "feels_like": 12.22, "humidity": 86, "clouds": 90, "wind_speed": 4.12, "wind_direction": 240, "visibility": 10000, "uv": 0, "rain_chance": 0}, "Beijing": {"main_weather": "Clouds", "description": "overcast clouds", "temp": 7.94, "min_temp": 5.77, "max_temp": 9.89, "feels_like": 5.51, "humidity": 34, "clouds": 88, "wind_speed": 3.93, "wind_direction": 39, "visibility": 10000, "uv": 0, "rain_chance": 0}, "Moscow": {"main_weather": "Snow", "description": "snow", "temp": -1.06, "min_temp": -2.33, "max_temp": 0.03, "feels_like": -6.41, "humidity": 62, "clouds": 52, "wind_speed": 5.28, "wind_direction": 222, "visibility": 10000, "uv": 0, "rain_chance": 0}}, "current_weather": true}
|
||||
{"feature": "Current Weather", "speed": "medium", "animation": "down", "temp": "celsius", "wind_speed": "miles/sec", "colour": "white", "city_colour": "yellow", "title": true, "locations": {"Beijing": {"main_weather": "Clouds", "description": "overcast clouds", "temp": 3.94, "min_temp": 3.94, "max_temp": 8.81, "feels_like": 3.94, "humidity": 51, "clouds": 100, "wind_speed": 1.24, "wind_direction": 139, "visibility": 10000, "uv": 0, "rain_chance": 0.03}, "London": {"main_weather": "Clouds", "description": "overcast clouds", "temp": 10.09, "min_temp": 8.65, "max_temp": 11.15, "feels_like": 9.32, "humidity": 83, "clouds": 90, "wind_speed": 3.6, "wind_direction": 280, "visibility": 10000, "uv": 0.15, "rain_chance": 0}, "Tokyo": {"main_weather": "Clouds", "description": "few clouds", "temp": 12.97, "min_temp": 12.97, "max_temp": 16.47, "feels_like": 12.2, "humidity": 72, "clouds": 20, "wind_speed": 0.89, "wind_direction": 78, "visibility": 10000, "uv": 0, "rain_chance": 0}, "Moscow": {"main_weather": "Clouds", "description": "overcast clouds", "temp": 1.24, "min_temp": 0.15, "max_temp": 1.24, "feels_like": -4.66, "humidity": 91, "clouds": 100, "wind_speed": 7.86, "wind_direction": 321, "visibility": 10000, "uv": 0, "rain_chance": 0.9}}, "current_weather": true}
|
@ -1 +1 @@
|
||||
{"feature": "Current Weather", "speed": "medium", "animation": "continuous", "temp": "celsius", "wind_speed": "miles/sec", "colour": "white", "city_colour": "yellow", "title": true, "locations": {"Tokyo": [{"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 10.82, "max_temp": 17.16}, {"main_weather": "Clouds", "description": "scattered clouds", "min_temp": 13.2, "max_temp": 17.34}, {"main_weather": "Rain", "description": "light rain", "min_temp": 13.51, "max_temp": 14.5}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 13.27, "max_temp": 15.48}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 12.82, "max_temp": 14.63}, {"main_weather": "Rain", "description": "light rain", "min_temp": 10.84, "max_temp": 14.38}, {"main_weather": "Clouds", "description": "scattered clouds", "min_temp": 9.31, "max_temp": 13.26}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 10.12, "max_temp": 15.26}], "London": [{"main_weather": "Clouds", "description": "scattered clouds", "min_temp": 7.01, "max_temp": 12.79}, {"main_weather": "Clouds", "description": "few clouds", "min_temp": 8.76, "max_temp": 13.35}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 9.84, "max_temp": 12.84}, {"main_weather": "Rain", "description": "light rain", "min_temp": 5.02, "max_temp": 9.79}, {"main_weather": "Clouds", "description": "few clouds", "min_temp": 5.27, "max_temp": 9.15}, {"main_weather": "Clouds", "description": "broken clouds", "min_temp": 5.05, "max_temp": 7.8}, {"main_weather": "Rain", "description": "light rain", "min_temp": 2.91, "max_temp": 7.67}, {"main_weather": "Clouds", "description": "few clouds", "min_temp": 1.13, "max_temp": 3.87}], "Beijing": [{"main_weather": "Clouds", "description": "broken clouds", "min_temp": 5.77, "max_temp": 9.89}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 5.48, "max_temp": 9.81}, {"main_weather": "Rain", "description": "light rain", "min_temp": 2.63, "max_temp": 7.98}, {"main_weather": "Clear", "description": "clear sky", "min_temp": -0.22, "max_temp": 3.1}, {"main_weather": "Clear", "description": "clear sky", "min_temp": -0.35, "max_temp": 6.4}, {"main_weather": "Clouds", "description": "broken clouds", "min_temp": 1.17, "max_temp": 7.28}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 2.15, "max_temp": 10.85}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 2, "max_temp": 7.86}], "Moscow": [{"main_weather": "Snow", "description": "snow", "min_temp": -2.33, "max_temp": 0.03}, {"main_weather": "Snow", "description": "light snow", "min_temp": -1.01, "max_temp": 1.22}, {"main_weather": "Snow", "description": "rain and snow", "min_temp": 0.35, "max_temp": 2.94}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 0.27, "max_temp": 1.82}, {"main_weather": "Snow", "description": "rain and snow", "min_temp": -4.16, "max_temp": 3.91}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": -4.86, "max_temp": -2.2}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": -2.64, "max_temp": -0.11}, {"main_weather": "Rain", "description": "light rain", "min_temp": -1.99, "max_temp": 2.21}]}, "current_weather": true}
|
||||
{"feature": "Current Weather", "speed": "medium", "animation": "continuous", "temp": "celsius", "wind_speed": "miles/sec", "colour": "white", "city_colour": "yellow", "title": true, "locations": {"Beijing": [{"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 3.94, "max_temp": 8.81}, {"main_weather": "Rain", "description": "light rain", "min_temp": 2.45, "max_temp": 7.54}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 0.17, "max_temp": 3.41}, {"main_weather": "Clear", "description": "clear sky", "min_temp": -0.49, "max_temp": 7.39}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 1.3, "max_temp": 7.49}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 3.47, "max_temp": 10.49}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 3.41, "max_temp": 9.49}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 1.39, "max_temp": 6.74}], "London": [{"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 8.65, "max_temp": 11.15}, {"main_weather": "Clouds", "description": "few clouds", "min_temp": 4.85, "max_temp": 9.55}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 4.65, "max_temp": 9.51}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 5.93, "max_temp": 8.97}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 5.56, "max_temp": 8.24}, {"main_weather": "Clouds", "description": "overcast clouds", "min_temp": 5.06, "max_temp": 8.16}, {"main_weather": "Clouds", "description": "broken clouds", "min_temp": 2.55, "max_temp": 5.05}, {"main_weather": "Rain", "description": "light rain", "min_temp": 2.76, "max_temp": 6.97}], "Tokyo": [{"main_weather": "Rain", "description": "light rain", "min_temp": 12.97, "max_temp": 16.47}, {"main_weather": "Rain", "description": "moderate rain", "min_temp": 14.97, "max_temp": 19.03}, {"main_weather": "Rain", "description": "light rain", "min_temp": 13.66, "max_temp": 15.7}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 10.62, "max_temp": 14.74}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 9.8, "max_temp": 14.25}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 10.77, "max_temp": 15.55}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 11.35, "max_temp": 17.33}, {"main_weather": "Clear", "description": "clear sky", "min_temp": 10.32, "max_temp": 13.98}], "Moscow": [{"main_weather": "Snow", "description": "rain and snow", "min_temp": 0.15, "max_temp": 1.24}, {"main_weather": "Snow", "description": "snow", "min_temp": 0.23, "max_temp": 1.38}, {"main_weather": "Snow", "description": "light snow", "min_temp": -5.68, "max_temp": 0.51}, {"main_weather": "Clouds", "description": "few clouds", "min_temp": -6.8, "max_temp": -4.63}, {"main_weather": "Snow", "description": "light snow", "min_temp": -6.12, "max_temp": 0.48}, {"main_weather": "Snow", "description": "light snow", "min_temp": 0.48, "max_temp": 2.15}, {"main_weather": "Snow", "description": "light snow", "min_temp": -1.78, "max_temp": 2.11}, {"main_weather": "Snow", "description": "light snow", "min_temp": -5.05, "max_temp": -3.1}]}, "current_weather": true}
|
@ -1 +1 @@
|
||||
{"feature": "Stocks", "speed": "medium", "animation": "down", "percent": false, "point": false, "logos": false, "chart": false, "title": true, "symbols": {"NZD,GBP": {"current": 1.9134, "24hr_change": -0.008599999999999941}, "CAD,USD": {"current": 1.26, "24hr_change": 0.0045999999999999375}}}
|
||||
{"feature": "Stocks", "speed": "medium", "animation": "down", "percent": false, "point": false, "logos": false, "chart": false, "title": true, "symbols": {"NZD,GBP": {"current": 1.9181, "24hr_change": 0.0046999999999999265}, "CAD,USD": {"current": 1.2647, "24hr_change": 0.0046999999999999265}}}
|
@ -1 +1 @@
|
||||
{"stocks": "18/11/2021 14:41:10", "crypto": "18/11/2021 14:39:10", "news": "18/11/2021 12:52:43", "weather": "18/11/2021 12:52:41", "forex": "18/11/2021 18:52:46", "sports": "18/11/2021 12:52:43"}
|
||||
{"stocks": "20/11/2021 10:13:08", "crypto": "20/11/2021 10:23:46", "news": "20/11/2021 10:13:16", "weather": "20/11/2021 10:13:13", "forex": "20/11/2021 16:13:20", "sports": "20/11/2021 10:13:17"}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,2 +1,2 @@
|
||||
speed,brightness
|
||||
f,4
|
||||
f,9
|
|
@ -1 +1 @@
|
||||
{"feature": "Stocks", "speed": "medium", "animation": "down", "percent": true, "point": true, "logos": false, "chart": false, "title": true, "symbols": {"MSFT": {"current": 340.86, "opening": 338.12}, "GOOG": {"current": 3015.62, "opening": 2983.88}}}
|
||||
{"feature": "Stocks", "speed": "medium", "animation": "down", "percent": true, "point": true, "logos": false, "chart": false, "title": true, "symbols": {"MSFT": {"current": 343.2, "opening": 342.74}, "GOOG": {"current": 2999.02, "opening": 3020.64}}}
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
22
server.py
22
server.py
@ -167,7 +167,11 @@ def stop():
|
||||
ticker = pexpect.spawn("sudo -E taskset -c 3 python3 stockTicker.py")
|
||||
displaying_screensaver = False
|
||||
return index()
|
||||
|
||||
|
||||
@app.route("/update", methods=['PUT','POST'])
|
||||
def update():
|
||||
os.system("./update.sh")
|
||||
|
||||
@app.route("/display_format", methods = ['PUT', 'POST', 'GET'])
|
||||
def display_format():
|
||||
global professional
|
||||
@ -209,24 +213,20 @@ def feature_settings():
|
||||
# saves files uploaded to the webpage for images and GIFs
|
||||
@app.route("/upload", methods = ['PUT', 'POST', 'GET'])
|
||||
def upload():
|
||||
|
||||
|
||||
try:
|
||||
|
||||
|
||||
images = request.files
|
||||
names = list(request.files.keys())
|
||||
for name in names:
|
||||
images[name].save('user_uploads/' +name)
|
||||
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
|
||||
return index()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@app.route("/brightness", methods=['PUT','POST'])
|
||||
def brightness():
|
||||
global brightness
|
||||
@ -247,7 +247,7 @@ def brightness():
|
||||
|
||||
f = open('csv/settings.csv', 'w+')
|
||||
f.write('speed,brightness\n')
|
||||
f.write(str(speed) + ',' + str(brightness))
|
||||
f.write(str(speed) + ',' + str(int(brightness) - 1))
|
||||
f.close()
|
||||
|
||||
global LastCommand
|
||||
|
@ -839,6 +839,16 @@ stopButton.addEventListener("click", () => {
|
||||
});
|
||||
});
|
||||
|
||||
var updateButton = document.getElementById("update-btn");
|
||||
updateButton.addEventListener("click", () => {
|
||||
|
||||
fetch("/update", {
|
||||
method: "POST",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
var dispFormatButton = document.getElementById("dispformat-btn");
|
||||
|
||||
var displayFormats = document.getElementById("inputDisplayFormat");
|
||||
|
@ -44,7 +44,16 @@ class StockTicker():
|
||||
#self.blank = Image.open('logos/blank.png')
|
||||
self.blank = Image.new('RGB', (10, 32))
|
||||
self.running = True
|
||||
self.brightness = 1.0
|
||||
|
||||
|
||||
settings = open('csv/settings.csv')
|
||||
|
||||
line = settings.readlines()[1]
|
||||
|
||||
|
||||
self.brightness = (float(line[2])+1)*10
|
||||
|
||||
|
||||
|
||||
|
||||
# Configuration for the matrix
|
||||
@ -55,7 +64,7 @@ class StockTicker():
|
||||
options.parallel = 1
|
||||
options.hardware_mapping = 'adafruit-hat' # If you have an Adafruit HAT: 'adafruit-hat'
|
||||
options.gpio_slowdown = 4
|
||||
options.brightness = 100
|
||||
options.brightness = self.brightness
|
||||
self.matrix = RGBMatrix(options = options)
|
||||
print(dir(self.matrix))
|
||||
#sys.exit()
|
||||
@ -2389,7 +2398,7 @@ class StockTicker():
|
||||
|
||||
elif msg in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']: # birghtness ettings
|
||||
|
||||
self.brightness = float(msg)*10
|
||||
self.brightness = (float(msg)+1)*10
|
||||
|
||||
self.matrix.brightness = self.brightness
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
<p class="hostname-text">
|
||||
Hostname: <span id="host-name">fintic</span>.local
|
||||
</p>
|
||||
<a href="#" class="btn update-btn">Check Updates</a>
|
||||
<a id="update-btn" class="btn update-btn">Check Updates</a>
|
||||
</header>
|
||||
|
||||
<!-- General Ticker Settings -->
|
||||
|
Loading…
Reference in New Issue
Block a user