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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading PercentTocabDarkness Converter")

class PercentTocabDarkness(Converter):

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



plugin = PercentTocabDarkness("PercentTocabDarkness")

store.AddConverter(plugin)