
import { commonSettings } from '../common_code/commonSettings.js'
import {ControllerEnum} from '../common_code/yoctopuce_plugin.js'

export class currentLoopOutputSettings extends commonSettings
{
    public action    : string = "TOGGLE";
    public targetmin : number = 0;
    public targetmax : number = 20;
    public delay     : number = 0;

    
    public set(unknownSettings : any) :boolean
    { if (!super.set(unknownSettings)) return false;
      if ("action" in unknownSettings)      this.action    =  unknownSettings["action"].toString();
      if ("targetmin" in unknownSettings)   this.targetmin =  parseFloat(unknownSettings["targetmin"]);
      if ("targetmax" in unknownSettings)   this.targetmax =  parseFloat(unknownSettings["targetmax"]);
      if ("delay" in unknownSettings)       this.delay     =  parseFloat(unknownSettings["delay"]);

      return true;
   }
}