'Polling' an end-point

I’ve created an app that talks to my 3D Printer’s Klipper controller.

Everything works and it is able to get printer stats successfully and display them.
Issue is that the app only calls the end-point once, even though I have it in an animation.
Is there something I am missing?

Here’s a code segment:

            render.Animation(
                children=[
                    render.Text(" "+file[0: -6]),   # Strip .gcode,
                    render.Text(str(getPercentComplete()))
                ]
            )

The getPercentComplete() function makes an HTTP Get request to the printer to get stats, but it only gets called once, even though these two children do get animated back and forth.

Thanks in advance.

You mean it only displays it once or the next time the app comes about it’s the same text?

Yes, it seems like it renders once, then just uses a cached copy every subsequent time.

If you are running locally you need to run it via a cron job or something as it’s just a static image. Should set up reasonable cache, but it wont technically be used on a local installation. Should still have it in there for good practice.

You’d have to set schema from the command line too, but essentially your cron job would pixlet render and pixlet push and then you would have updated information.