homecontrol-dash: update max slider values in callback

This commit is contained in:
Konstantin Koslowski 2019-11-15 07:59:36 +01:00
parent 6639e138b6
commit 815bf282f6

View file

@ -115,18 +115,22 @@ def update_slider_limit(value):
@app.callback( @app.callback(
Output('slider-min-txt', 'children'), [Output('slider-min-txt', 'children'), Output('slider-min', 'max')],
[Input('slider-min', 'value')]) [Input('slider-min', 'value')])
def update_slider_min(value): def update_slider_min(value):
return "From: %s" % (time.strftime("%Y/%m/%d %H:%M", time.localtime(float(value))) if txt = "From: %s" % (time.strftime("%Y/%m/%d %H:%M", time.localtime(float(value))) if
value > 0 else 0) value > 0 else 0)
t = time.time()
return txt, t
@app.callback( @app.callback(
Output('slider-max-txt', 'children'), [Output('slider-max-txt', 'children'), Output('slider-max', 'max')],
[Input('slider-max', 'value')]) [Input('slider-max', 'value')])
def update_slider_max(value): def update_slider_max(value):
return "To: %s" % (time.strftime("%Y/%m/%d %H:%M", time.localtime(float(value)))) txt = "To: %s" % (time.strftime("%Y/%m/%d %H:%M", time.localtime(float(value))))
t = time.time()
return txt, t
@app.callback( @app.callback(