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

from Soti.Connect.SemanticEngine.Conversions import Converter

print("Loading HoneywellDarknessToPercentv2 Converter")

class HoneywellDarknessToPercentv2(Converter):

    def Execute(self, args):
        return round(max(1, ((int(args[0]) *100 ) / 30.0)))

plugin = HoneywellDarknessToPercentv2("HoneywellDarknessToPercentv2")

store.AddConverter(plugin)