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

from Soti.Connect.SemanticEngine.Conversions import Converter

print("Loading DarknessPercentToZebraDarknessBothRanges Converter")

class DarknessPercentToZebraDarknessBothRanges(Converter):

    def Execute(self, args):
        val = 0
        if(args[1] == "zpl"):
            val = (((int(args[0]) ) * 30) /99)
        elif (args[1] == "cpcl"):
            val = (((int(args[0])) * 300) / 99) - 100
        return val




plugin = DarknessPercentToZebraDarknessBothRanges("DarknessPercentToZebraDarknessBothRanges")

store.AddConverter(plugin)