Changes to virtual contact sensor?

@anon36505037 would i be able to use same additions to code for a uDTH device? I’m using a light sensor I’d like to eliminate manual control of.