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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading FloatToInt_30To300 Converter")

class FloatToInt_30To300(Converter):

	def Execute(self, myList = [], *args):
		res = float(myList[0])

		if (res < 30.0):
			res = 30.0
		elif (res > 300.0):
			res = 300.0 

		return int(res)

plugin = FloatToInt_30To300("FloatToInt_30To300")

store.AddConverter(plugin)