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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading GeneralToBrotherPJSpeed Converter")

class GeneralToBrotherPJSpeed(Converter):

	def Execute(self, myList = [], *args):
		arg = float(myList[0])        
		res = 1.1
		if arg <= 48.26 and arg > 27.94:
			res = 1.9
		elif arg <= 68.58 and arg > 48.26:
			res = 2.7
		elif arg <= 88.9 and arg >  68.58:
			res = 3.5
		elif arg > 88.9:
			res = 3.5
		return res




plugin = GeneralToBrotherPJSpeed("GeneralToBrotherPJSpeed")

store.AddConverter(plugin)