Example #1
0
        public DeviceAlert(XmlNode alert, VeraController controller) :
            base(alert, controller)
        {
            XmlAttributeCollection xmlAttribs = alert.Attributes;

            DeviceID   = Convert.ToInt32(xmlAttribs["PK_Device"].Value);
            RoomID     = Convert.ToInt32(xmlAttribs["Room"].Value);
            DeviceName = xmlAttribs["DeviceName"].Value;
            DeviceType = xmlAttribs["DeviceType"].Value;
        }
Example #2
0
        private async void btnGetDevices_ClickAsync(object sender, EventArgs e)
        {
            m_Controller = new VeraController(txtControllerAddress.Text);

            m_Controller.DebugPrint += AddTextToOutput;

            await m_Controller.ConnectAsync();

            PopulateDeviceTreeView();
        }
Example #3
0
        public Alert(XmlNode alert, VeraController controller)
        {
            XmlAttributeCollection xmlAttribs = alert.Attributes;

            Controller  = controller;
            Description = xmlAttribs["Description"].Value;
            Timestamp   = Convert.ToInt64(xmlAttribs["LocalTimestamp"].Value);
            LocalTime   = Convert.ToDateTime(xmlAttribs["LocalDate"].Value);
            ID          = Convert.ToUInt64(xmlAttribs["PK_Alert"].Value);
            Type        = (EventType)Convert.ToUInt32(xmlAttribs["EventType"].Value);
        }
Example #4
0
        public static Alert Construct(XmlNode alert, VeraController controller)
        {
            XmlAttributeCollection xmlAttribs = alert.Attributes;

            Alert.EventType iEventType = (Alert.EventType)Convert.ToInt32(xmlAttribs["EventType"].Value);
            Alert           retAlert   = null;

            switch (iEventType)
            {
            case Alert.EventType.DeviceStatus:
                retAlert = new DeviceAlert(alert, controller);
                break;

            case Alert.EventType.SysError:
            default:
                retAlert = new Alert(alert, controller);
                break;
            }

            return(retAlert);
        }
Example #5
0
 public Device(XmlNode device, VeraController controller)
 {
     Controller = controller;
     Update(device, Controller.Rooms);
 }
Example #6
0
 public Dimmer(XmlNode device, VeraController controller) :
     base(device, controller)
 {
 }
Example #7
0
 public SwitchDevice(XmlNode device, VeraController controller) :
     base(device, controller)
 {
 }
Example #8
0
 public RollerShutter(XmlNode device, VeraController controller) :
     base(device, controller)
 {
 }