Dash - "Live update text" error

Hello,
I’m learning python and dash and I’m building an application for monitoring my trading.

I’ve adapted the code from : “Live Updating Components” example (Orbital Satellite). It works well on jupyter notebook and repl.it but I have an error when I try it on my computer :

“The input argument interval-component.n_intervals must be a list or tuple of
dash.dependencies.Inputs.”

I don’t understand why

Here is my code :


import ccxt
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly
from dash.dependencies import Input, Output
import pandas as pd



app = dash.Dash(__name__)

ftx = ccxt.ftx({'verbose': True})
ftx = ccxt.ftx({
    'apiKey': '',
    'secret': '',

    
})


app.layout = html.Div(
    html.Div([
        html.H4('FTX Live Feed'),
        html.Div(id='live-update-text'),
        dcc.Interval(
            id='interval-component',
            interval=1*1000, # in milliseconds
            n_intervals=0
        )
    ])
)

class Client:
    """A sample client class"""

    def __init__(self):
        self.pnl = []


    def get_balances(client):
        try:
            balance = ftx.fetch_balance()
        except ccxt.BaseError as e:
            print(f"Could not get account with error: {e}")
            raise e
        else:
            result = balance["info"]["result"]
            total = []
            for x in result:
                if float(x["free"]) > 0.0:
                    total.append(x["usdValue"])
                    a = list(map(float, total))

            df = pd.Series(a)
            # global totCap
            totCap = df.sum()
            return totCap

@app.callback(Output('live-update-text', 'children'),
              Input('interval-component', 'n_intervals'))


def update_metrics(n):

    arc = Client().get_balances()
    style = {'padding': '5px', 'fontSize': '16px'}
    return [
        html.Span('Balance: {0:.2f}'.format(arc), style=style)
    ]



if __name__ == '__main__':
    app.run_server(host="0.0.0.0", port="8050")

Here is a screenshot from the replit app :
chrome_HQBN1GDUif

I’ve found the answer : it was a problem of callback syntax :
here is the good syntax :

@app.callback(Output(‘live-graph’, ‘figure’),
[Input(‘graph-update’, ‘n_intervals’)])