class ScalarDevice(RegisterBase): def doRead(self): return self.val if hasattr(self, 'val') else 0.0 def doWrite(self, val): self.val = val def test(self): self.setCache(1.0, None) add_device(ScalarDevice("scan_start"), True) scan_start.test()