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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading BixolonDarknessToPercentSRP Converter")

class BixolonDarknessToPercentSRP(Converter):

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

plugin = BixolonDarknessToPercentSRP("BixolonDarknessToPercentSRP")

store.AddConverter(plugin)