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

from Soti.Connect.SemanticEngine.Conversions import Converter

print("Loading BixolonXTRSpeed Converter")

class BixolonXTRSpeed(Converter):
    def Execute(self, args):
        if args == None or args[0] == None:
            return
        hi = 400
        lo = 25
        return max(min(float(args[0]), hi), lo)


plugin = BixolonXTRSpeed("BixolonXTRSpeed")

store.AddConverter(plugin)