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

from Soti.IoT.SemanticEngine.Conversions import Converter

print("Loading cabDarknessToPercent Converter")

class cabDarknessToPercent(Converter):

	def Execute(self, myList = [], *args):
		return round(int(100 * (int(myList[0]) + 20) / (20 + 20)))




plugin = cabDarknessToPercent("cabDarknessToPercent")

store.AddConverter(plugin)