private bool IsIgnored(LoxoneUuid uuid, LoxAppModel.ControlModel controlModel) { if (this.loxoneConfig.IgnoreControls.Contains(uuid.ToString())) { return(true); } if (this.loxoneConfig.IgnoreCategories.Contains(controlModel.Cat.ToString())) { return(true); } return(false); }
private IEnumerable <Control> ParseControl(LoxoneUuid key, LoxAppModel.ControlModel loxControl, string roomName) { if (loxControl.Type == LoxAppModel.ControlTypeModel.Switch) { // is normal light switch? Control newControl = new Control(ControlType.LightControl, loxControl.Name, key, loxControl.Name, loxControl.States.ToImmutableDictionary <string, LoxoneUuid>(), roomName ); return(new[] { newControl }); } else if (loxControl.Type == LoxAppModel.ControlTypeModel.Dimmer) { // is dimmer? Control newControl = new Control(ControlType.LightDimmableControl, loxControl.Name, key, loxControl.Name, loxControl.States.ToImmutableDictionary <string, LoxoneUuid>(), roomName ); return(new[] { newControl }); } else if (loxControl.Type == LoxAppModel.ControlTypeModel.Jalousie) { // is blinds? Control newControl = new Control(ControlType.BlindControl, loxControl.Name, key, loxControl.Name, loxControl.States.ToImmutableDictionary <string, LoxoneUuid>(), roomName ); return(new[] { newControl }); } else if (loxControl.Type == LoxAppModel.ControlTypeModel.LightController) { // defer to subcontrols which should be switches and dimmers List <Control> controls = new List <Control>(); foreach (var sc in loxControl.SubControls) { controls.AddRange(ParseControl(sc.Key, sc.Value, roomName)); } return(controls); } log.Debug("Ignoring model control {0}: {1}, not supported type '{2}'", key, loxControl.Name, loxControl.Type); return(Enumerable.Empty <Control>()); }