Ejemplo n.º 1
0
        public void Poll()
        {
            if (Type == DeviceType.BinarySwitch)
            {
                BinarySwitch.Poll();
                return;
            }

            if (Type == DeviceType.MultilevelSwitch)
            {
                MultilevelSwitch.Poll();
                return;
            }

            if (ColorSwitch != null)
            {
                ColorSwitch.Poll();
            }

            if (Type == DeviceType.Thermostat)
            {
                if (TemperatureSensor != null)
                {
                    TemperatureSensor.Poll();
                }

                if (Thermostat.Core != null)
                {
                    Thermostat.Core.PollCurrentAction();
                    Thermostat.Core.PollMode();
                    Thermostat.Core.PollSupportedModes();
                }

                if (Thermostat.Fan != null)
                {
                    Thermostat.Fan.PollCurrentAction();
                    Thermostat.Fan.PollMode();
                    Thermostat.Fan.PollSupportedModes();
                }

                if (Thermostat.Setpoints != null)
                {
                    Thermostat.Setpoints.PollSupportedSetpoints();
                    Thermostat.Setpoints.PollSetpointTemperatures();
                }
            }
        }