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

from Soti.Connect.SemanticEngine.Conversions import Converter

print("Loading SatoBluetoothDarknessToGen Converter")

class SatoBluetoothDarknessToGen(Converter):
    def Execute(self, args):
        if not args or len(args) == 0:
            return None

        try:
            val = int(args[0])
        except ValueError:
            return None

        max_val = 10
        min_val = 1
        result = val if val <= max_val else max_val
        result = result if result >= min_val else min_val

        result *= 10

        return result


plugin = SatoBluetoothDarknessToGen("SatoBluetoothDarknessToGen")

store.AddConverter(plugin)