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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading BixolonXMRSpeed Converter")

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


plugin = BixolonXMRSpeed("BixolonXMRSpeed")

store.AddConverter(plugin)