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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading BixolonXDRSpeed Converter")

class BixolonXDRSpeed(Converter):
    def Execute(self, myList=[], *args):
        if myList == None or myList[0] == None:
            return
        hi = 178
        lo = 25.4
        print(myList[0])
        return max(min(float(myList[0]), hi), lo)


plugin = BixolonXDRSpeed("BixolonXDRSpeed")

store.AddConverter(plugin)