Control seven segment display on MAX7219 from scripts

I am trying to create a garden watering timer and I want to have a seven segment display to display temperature but I want to have a physical button to cycle through different things on the display for example the temperature and then the time left until the watering stops. I am unsure if this will be possible through scripts because I also want it to be possible to adjust the set watering time from home assistant