public LightingFixtureDimming(LightingFixtureSettings settings) : base(settings)
        {
            currentDimmingLevel   = 0.0f;
            autoDimmingLevel      = 0.0f;
            requestedDimmingLevel = 0.0f;
            rateOfChangeLimiter   = new RateOfChangeLimiter(1.0f);

            dimmingChannel = settings.dimmingChannel;
            dimmingMode    = Mode.Auto;
            var dimmingSettings = new GenericDeviceSettings();

            dimmingSettings.name    = name + " Dimming Output";
            dimmingSettings.channel = dimmingChannel;
            dimmingEquipment        = new DimmingEquipment(dimmingSettings, this);
            Driver.AnalogOutput.AddOutputChannel(dimmingChannel, name, dimmingEquipment.key);
        }
 public LightingFixture(LightingFixtureSettings settings) : base(settings)
 {
     highTempLockout = settings.highTempLockout;
     highTempLockoutTemperatureGroup = settings.highTempLockoutTemperatureGroup;
     if (highTempLockoutTemperatureGroup.IsNotEmpty())
     {
         temperatureAlarmIndex = Temperature.GetTemperatureGroupHighTemperatureAlarmIndex(highTempLockoutTemperatureGroup);
     }
     else
     {
         temperatureAlarmIndex = Temperature.defaultHighTemperatureAlarmIndex;
     }
     plugState = false;
     Driver.Power.AddOutlet(channel, name, false, key);
     Subscribe(Driver.Power.GetChannelEventPublisherKey(channel));
     UpdateLightingStates(settings.lightingStates, false);
 }
        public override GenericGadgetSettings GetGadgetSettings(string name)
        {
            CheckGadgetKey(name);
            var settings = new LightingFixtureSettings();
            var fixture  = gadgets[name] as LightingFixture;

            settings.name            = fixture.name;
            settings.channel         = fixture.channel;
            settings.highTempLockout = fixture.highTempLockout;
            settings.highTempLockoutTemperatureGroup = fixture.highTempLockoutTemperatureGroup;
            settings.lightingStates = GetLightingFixtureLightingStates(name);
            var dimmingFixture = fixture as LightingFixtureDimming;

            if (dimmingFixture != null)
            {
                settings.dimmingChannel = dimmingFixture.dimmingChannel;
            }
            return(settings);
        }