Beispiel #1
0
        public static MiHomeConfig FromXml(XElement element)
        {
            var obj = new MiHomeConfig();

            obj.Gateways.AddRange(element.Elements("Gateway").Select(element => MiHomeGatewayConfig.FromXml(element)));
            return(obj);
        }
Beispiel #2
0
        public static MiHomeGatewayConfig FromXml(XElement element)
        {
            var obj = new MiHomeGatewayConfig();

            obj.Name        = (string)element.Attribute(nameof(obj.Name));
            obj.Description = (string)element.Attribute(nameof(obj.Description));
            obj.Id          = (string)element.Attribute(nameof(obj.Id));
            obj.Password    = (string)element.Attribute(nameof(obj.Password));
            obj.Devices.AddRange(element.Elements("Device").Select(element => MiHomeDeviceConfig.FromXml(element)));
            obj.Check();
            return(obj);
        }