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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading BixolonXTRSpeed Converter")

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


plugin = BixolonXTRSpeed("BixolonXTRSpeed")

store.AddConverter(plugin)