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

from Soti.Connect.SemanticEngine.Conversions import Converter

print("Loading GeneralToBixolonSpeedXL5v4 Converter")

class GeneralToBixolonSpeedXL5v4(Converter):
    def Execute(self, args):
        if args == None or args[0] == None:
            return
        max_speed = 152.4
        min_speed = 76.2
        return max(min(float(args[0]), max_speed), min_speed)


plugin = GeneralToBixolonSpeedXL5v4("GeneralToBixolonSpeedXL5v4")

store.AddConverter(plugin)