Reading thermistor/ADC directly in Octoprint

What is the problem?

I'm building a custom large format printer (1200x400mm) and I'm trying to figure out a way to get some heatbeds working for my setup. I've ordered 3x 350x350mm beds and I want to be able to turn them on/set temperature either for all 3 or just individual beds.

I'm using an Analog Digital Converter and voltage divider circuit to read thermistor voltage and a python script to convert that to temperature using the Steinhart-Hart Equation.

But I'm stuck in how to incorporate this into Octoprint (I'm fairly new to python).

I'm not sure if something like the Enclosure plugin could be used/modified to do what I want. Eventually I'll need to use this temperature data to trigger a SSR for each bed as the bed temps change. Also I realise I won't have any of the safety features, overtemp etc, that Marlin provides. But I think modifying Marlin to work with my setup is going to be more tricky.

What did you already try to solve it?

This is the script I'm currently testing out to ready 2 spare small heatbeds I've got lying around while I wait for the new ones to arrive. As I said I'm new to python so I'm basically just copy and pasting at this stage.

import time
import board
import busio
import adafruit_ads1x15.ads1115 as ADS
from adafruit_ads1x15.analog_in import AnalogIn

# Create the I2C bus
i2c = busio.I2C(board.SCL, board.SDA)

# Create the ADC object using the I2C bus
ads = ADS.ADS1115(i2c)

# Create single-ended input channels
chan0 = AnalogIn(ads, ADS.P0)
chan1 = AnalogIn(ads, ADS.P1)

R0 = 100000 * ((3.3 / chan0.voltage ) -1)
R1 = 100000 * ((3.3 / chan1.voltage ) -1)

def steinhart_temperature_C_0(r, Ro=100000.0, To=25.0, beta=4147.29):
    import math
    steinhart = math.log(r / Ro) / beta      # log(R/Ro) / beta
    steinhart += 1.0 / (To + 273.15)         # log(R/Ro) / beta + 1/To
    steinhart = (1.0 / steinhart) - 273.15   # Invert, convert to C
    return steinhart

def steinhart_temperature_C_1(r, Ro=100000.0, To=25.0, beta=4147.29):
    import math
    steinhart = math.log(r / Ro) / beta      # log(R/Ro) / beta
    steinhart += 1.0 / (To + 273.15)         # log(R/Ro) / beta + 1/To
    steinhart = (1.0 / steinhart) - 273.15   # Invert, convert to C
    return steinhart

#R0 = 100000 * ((3.3 / chan0.voltage ) -1)
#R1 = 100000 * ((3.3 / chan1.voltage ) -1)

print("{:>5}".format("A0 Temp:") , "{:>5.3f}".format(steinhart_temperature_C_0(R0)) ," |" , "{:>5}$

Additional information about your setup

OctoPi version: 1.4.0
Cusom Printer: Marlin 2.0.5