import clr
clr.AddReference('Soti.IoT.SemanticEngine.Conversions')

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading MPXDotsToMm Converter")

class MPXDotsToMm(Converter):
    def Execute(self, myList=[], *args):
        if myList == None or myList[0] == None:
            return
        input_value = float(myList[0])
        res = (input_value / 300) * 25.4
        return int(res)

plugin = MPXDotsToMm("MPXDotsToMm")

store.AddConverter(plugin)