Help getting plugin to work with ser2net

Hi

I have modified the lutron plugin to get it to work with my automation system - that part appears to work.
Now I would like it to use a serial port on my raspberry pi using ser2net.
I had an old working basic plugin which worked with ser2net so I have tried to bring the code into my new plugin.
Unfortunately it wasnt as simple as I had hoped and it appears to fail during the startup. I am guessing it could be something to do with different naming conventions between the different plugins, but that is as far as I have been able to understand.

I was hoping that someone could take a look over the startup and give me some pointers where I might be going wrong.

Thanks

Martin