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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading HoneywellDarknessToPercentv2 Converter")

class HoneywellDarknessToPercentv2(Converter):

	def Execute(self, myList = [], *args):
		return round(max(1, ((int(myList[0]) *100 ) / 30.0)))

plugin = HoneywellDarknessToPercentv2("HoneywellDarknessToPercentv2")

store.AddConverter(plugin)