예제 #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;
        }
예제 #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();
        }
예제 #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);
        }
예제 #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);
        }
예제 #5
0
 public Device(XmlNode device, VeraController controller)
 {
     Controller = controller;
     Update(device, Controller.Rooms);
 }
예제 #6
0
 public Dimmer(XmlNode device, VeraController controller) :
     base(device, controller)
 {
 }
예제 #7
0
 public SwitchDevice(XmlNode device, VeraController controller) :
     base(device, controller)
 {
 }
예제 #8
0
 public RollerShutter(XmlNode device, VeraController controller) :
     base(device, controller)
 {
 }