public static AutomationConfig FromXml(XElement element)
        {
            var obj = new AutomationConfig();

            obj.Triggers.AddRange(element.Elements("Trigger").Select(element => TriggerConfig.FromXml(element)));
            return(obj);
        }
        public static TriggerConfig FromXml(XElement element)
        {
            var obj = new TriggerConfig();

            obj.Name = (string)element.Attribute(nameof(obj.Name));
            if (element.Attribute(nameof(obj.StartTime)) != null)
            {
                obj.StartTime = TimeSpan.Parse((string)element.Attribute(nameof(obj.StartTime)));
            }
            if (element.Attribute(nameof(obj.EndTime)) != null)
            {
                obj.EndTime = TimeSpan.Parse((string)element.Attribute(nameof(obj.EndTime)));
            }
            obj.Events.AddRange(element.Elements("Event").Select(element => EventConfig.FromXml(element)));
            obj.Actions.AddRange(element.Elements("Action").Select(element => ActionConfig.FromXml(element)));
            return(obj);
        }