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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading PercentToBixolonDarkness Converter")

class PercentToBixolonDarkness(Converter):

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




plugin = PercentToBixolonDarkness("PercentToBixolonDarkness")

store.AddConverter(plugin)