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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading FloatToInt_1To832 Converter")

class FloatToInt_1To832(Converter):

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

		if (res < 1.0):
			res = 1.0
		elif (res > 832.0):
			res = 832.0 

		return int(res)

plugin = FloatToInt_1To832("FloatToInt_1To832")

store.AddConverter(plugin)