Exemplo n.º 1
0
 /**
  * Method: SendHVACCommand
  * Access: public
  * Description: Receive Commands from Interfaces and pass to S+ via TriggerSendCommand delegate
  */
 public void SendHVACCommand(HVACCommand _cmd, ushort _state)
 {
     if (TriggerSendCommand != null)
     {
         TriggerSendCommand((ushort)_cmd, _state);
     }
 }
Exemplo n.º 2
0
        /**
         * Method: FeedbackEvent
         * Access: public
         * Description: Receive hardware feedback from S+, store in variable, and push value to subscribed Interfaces via event
         */
        public void FeedbackEvent(ushort _action, ushort _state)
        {
            HVACCommand act = (HVACCommand)_action;

            switch (act)
            {
            case HVACCommand.SystemMode_Off_Fb:
                if (_state == 1)
                {
                    currentSystemMode = "Off";
                }
                break;

            case HVACCommand.SystemMode_Cool_Fb:
                if (_state == 1)
                {
                    currentSystemMode = "Cool";
                }
                break;

            case HVACCommand.SystemMode_Heat_Fb:
                if (_state == 1)
                {
                    currentSystemMode = "Heat";
                }
                break;

            case HVACCommand.SystemMode_Auto_Fb:
                if (_state == 1)
                {
                    currentSystemMode = "Auto";
                }
                break;

            case HVACCommand.FanMode_On_Fb:
                if (_state == 1)
                {
                    currentFanMode = "On";
                }
                break;

            case HVACCommand.FanMode_Auto_Fb:
                if (_state == 1)
                {
                    currentFanMode = "Auto";
                }
                break;

            case HVACCommand.FanSpeed_Low_Fb:
                if (_state == 1)
                {
                    currentFanSpeed = "Low";
                }
                break;

            case HVACCommand.FanSpeed_Medium_Fb:
                if (_state == 1)
                {
                    currentFanSpeed = "Medium";
                }
                break;

            case HVACCommand.FanSpeed_High_Fb:
                if (_state == 1)
                {
                    currentFanSpeed = "High";
                }
                break;

            case HVACCommand.FanSpeed_Max_Fb:
                if (_state == 1)
                {
                    currentFanSpeed = "Max";
                }
                break;

            case HVACCommand.CoolCall_Fb:
                coolCallActive = _state == 1 ? true : false;
                break;

            case HVACCommand.HeatCall_Fb:
                heatCallActive = _state == 1 ? true : false;
                break;

            case HVACCommand.FanCall_Fb:
                fanCallActive = _state == 1 ? true : false;
                break;

            case HVACCommand.TempSetpoint:
                currentSetpointTemp = _state;
                break;

            case HVACCommand.TempAmbient:
                currentAmbientTemp = _state;
                break;

            case HVACCommand.Power_On_Fb:
                powerIsOn = true;
                break;

            case HVACCommand.Power_Off_Fb:
                powerIsOn = false;
                break;
            }

            // Broadcast to UpdateEvent subscribers
            if (this.UpdateEvent != null)
            {
                UpdateEvent(this.id, act, _state);
            }
        }