Ideally, the initialising the script will be as simple as finding a device definition then initialising this state object. Tbh, this is what the design should have been all along, but I got too fancy with my inheritance and fancy magic code.