public static void UpdateTargetDoorStateFeedback(string name)
        {
            var tempUpdateValueObject = new SetIntValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "TargetDoorState";
            tempUpdateValueObject.Payload.Value          = GarageDoors[GarageDoors.FindIndex(i => i.Name == name)].TargetDoorState;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
Пример #2
0
        public static void RemoveDevice(string name)
        {
            var tempRemoveObject = new RemoveObject();

            if (Fans[Fans.FindIndex(i => i.Name == name)].DeviceLocation == "Local")
            {
                tempRemoveObject.Payload.Name = name;
                HBCrestron.SendWebSocketData(JsonConvert.SerializeObject(tempRemoveObject)); //Serialize the Data above
            }
            Fans.Remove(Fans[Fans.FindIndex(i => i.Name == name)]);
        }
        public static void UpdateCoolingThresholdTemperatureFeedback(string name)
        {
            var tempUpdateValueObject = new SetIntValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "CoolingThresholdTemperature";
            tempUpdateValueObject.Payload.Value          = (int)Thermostats[Thermostats.FindIndex(i => i.Name == name)].CoolingThresholdTemperature;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
        public static void UpdateCurrentRelativeHumidityFeedback(string name)
        {
            var tempUpdateValueObject = new SetIntValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "CurrentRelativeHumidity";
            tempUpdateValueObject.Payload.Value          = Thermostats[Thermostats.FindIndex(i => i.Name == name)].CurrentRelativeHumidity;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
        public static void UpdateObstructionDetectedFeedback(string name)
        {
            var tempUpdateValueObject = new SetBoolValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "ObstructionDetected";
            tempUpdateValueObject.Payload.Value          = GarageDoors[GarageDoors.FindIndex(i => i.Name == name)].ObstructionDetected;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
Пример #6
0
        public static void UpdatePositionStateFeedback(string name)
        {
            var tempUpdateValueObject = new SetIntValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "PositionState";
            tempUpdateValueObject.Payload.Value          = Windows[Windows.FindIndex(i => i.Name == name)].PositionState;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
        public static void UpdateOccupancyDetectedFeedback(string name)
        {
            var tempUpdateValueObject = new SetIntValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "OccupancyDetected";
            tempUpdateValueObject.Payload.Value          = OccupancySensors[OccupancySensors.FindIndex(i => i.Name == name)].OccupancyDetected;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
Пример #8
0
        public static void UpdateOnFeedback(string name)
        {
            var tempUpdateValueObject = new SetBoolValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "On";
            tempUpdateValueObject.Payload.Value          = Fans[Fans.FindIndex(i => i.Name == name)].On;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
        public static void UpdateStatusLowBatteryFeedback(string name)
        {
            var tempUpdateValueObject = new SetBoolValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "StatusLowBattery";
            tempUpdateValueObject.Payload.Value          = OccupancySensors[OccupancySensors.FindIndex(i => i.Name == name)].StatusLowBattery;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
Пример #10
0
        public static void UpdateCurrentPositionFeedback(string name)
        {
            var tempUpdateValueObject = new SetIntValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "CurrentPosition";
            tempUpdateValueObject.Payload.Value          = Doors[Doors.FindIndex(i => i.Name == name)].CurrentPosition;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
        public static void UpdateTemperatureDisplayUnitsFeedback(string name)
        {
            var tempUpdateValueObject = new SetIntValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "TemperatureDisplayUnits";
            tempUpdateValueObject.Payload.Value          = Thermostats[Thermostats.FindIndex(i => i.Name == name)].TemperatureDisplayUnits;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
Пример #12
0
        public static void UpdateStatusTamperedFeedback(string name)
        {
            var tempUpdateValueObject = new SetBoolValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "StatusTampered";
            tempUpdateValueObject.Payload.Value          = SecuritySystems[SecuritySystems.FindIndex(i => i.Name == name)].StatusTampered;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
Пример #13
0
        public static void UpdateSecuritySystemAlarmType(string name)
        {
            var tempUpdateValueObject = new SetIntValueObject();

            tempUpdateValueObject.Payload.Name           = name;
            tempUpdateValueObject.Payload.Characteristic = "SecuritySystemAlarmType";
            tempUpdateValueObject.Payload.Value          = SecuritySystems[SecuritySystems.FindIndex(i => i.Name == name)].SecuritySystemAlarmType;
            var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);

            HBCrestron.SendWebSocketData(stringToSend);
        }
Пример #14
0
 public static void UpdateRotationDirectionFeedback(string name)
 {
     if (Fans[Fans.FindIndex(i => i.Name == name)].SupportsRotationDirection == 1)
     {
         var tempUpdateValueObject = new SetIntValueObject();
         tempUpdateValueObject.Payload.Name           = name;
         tempUpdateValueObject.Payload.Characteristic = "RotationDirection";
         tempUpdateValueObject.Payload.Value          = Fans[Fans.FindIndex(i => i.Name == name)].RotationDirection;
         var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);
         HBCrestron.SendWebSocketData(stringToSend);
     }
 }
 public static void UpdateColorTemperatureFeedback(string name)
 {
     if (Lightbulbs[Lightbulbs.FindIndex(i => i.Name == name)].SupportsColorTemperature == 1)
     {
         var tempUpdateValueObject = new SetIntValueObject();
         tempUpdateValueObject.Payload.Name           = name;
         tempUpdateValueObject.Payload.Characteristic = "ColorTemperature";
         tempUpdateValueObject.Payload.Value          = Lightbulbs[Lightbulbs.FindIndex(i => i.Name == name)].ColorTemperature;
         var stringToSend = JsonConvert.SerializeObject(tempUpdateValueObject);
         HBCrestron.SendWebSocketData(stringToSend);
     }
 }
Пример #16
0
 public static void AddDevice(string name, string deviceLocation)
 {
     Outlets.Add(new Outlet {
         Name = name, DeviceLocation = deviceLocation
     });
     if (deviceLocation == "Local")
     {
         var tempAddOutletPayload = new AddOutletPayload();
         tempAddOutletPayload.Name = name;
         var tempAddObject = new AddObject(tempAddOutletPayload);
         HBCrestron.SendWebSocketData(JsonConvert.SerializeObject(tempAddObject)); //Serialize the Data above
     }
 }
Пример #17
0
 public static void AddDevice(string name, ushort supportsRotationSpeed, ushort supportsRotationDirection, string deviceLocation)
 {
     Fans.Add(new Fan {
         Name = name, SupportsRotationSpeed = supportsRotationSpeed, SupportsRotationDirection = supportsRotationDirection, DeviceLocation = deviceLocation
     });
     if (deviceLocation == "Local")
     {
         var tempAddFanPayload = new AddFanPayload();
         tempAddFanPayload.Name = name;
         tempAddFanPayload.SupportsRotationSpeed     = supportsRotationSpeed;
         tempAddFanPayload.SupportsRotationDirection = supportsRotationDirection;
         var tempAddObject = new AddObject(tempAddFanPayload);
         HBCrestron.SendWebSocketData(JsonConvert.SerializeObject(tempAddObject)); //Serialize the Data above
     }
 }
 public static void AddDevice(string name, ushort supportsHoldPosition, ushort supportsObstructionDetected, string deviceLocation)
 {
     GarageDoors.Add(new GarageDoor {
         Name = name, DeviceLocation = deviceLocation
     });
     if (deviceLocation == "Local")
     {
         var tempAddGarageDoorObject = new AddGarageDoorPayload();
         tempAddGarageDoorObject.Name = name;
         tempAddGarageDoorObject.SupportsHoldPosition        = supportsHoldPosition;
         tempAddGarageDoorObject.SupportsObstructionDetected = supportsObstructionDetected;
         var tempAddObject = new AddObject(tempAddGarageDoorObject);
         HBCrestron.SendWebSocketData(JsonConvert.SerializeObject(tempAddObject)); //Serialize the Data above
     }
 }
Пример #19
0
 public static void AddDevice(string name, ushort supportsStatusFault, ushort supportsStatusTampered, string deviceLocation)
 {
     SecuritySystems.Add(new SecuritySystem {
         Name = name, SupportsStatusFault = supportsStatusFault, SupportsStatusTampered = supportsStatusTampered, DeviceLocation = deviceLocation
     });
     if (deviceLocation == "Local")
     {
         var tempAddSecuritySystemPayload = new AddSecuritySystemPayload();
         tempAddSecuritySystemPayload.Name = name;
         tempAddSecuritySystemPayload.SupportsStatusFault    = supportsStatusFault;
         tempAddSecuritySystemPayload.SupportsStatusTampered = supportsStatusFault;
         var tempAddObject = new AddObject(tempAddSecuritySystemPayload);
         HBCrestron.SendWebSocketData(JsonConvert.SerializeObject(tempAddObject)); //Serialize the Data above
     }
 }
 public static void AddDevice(string name, ushort supportsCurrentRelativeHumidity, ushort supportsTargetRelativeHumidity, ushort supportsCoolingThresholdTemperature, ushort supportsHeatingThresholdTemperature, string deviceLocation)
 {
     Thermostats.Add(new Thermostat {
         Name = name, SupportsCurrentRelativeHumidity = supportsCurrentRelativeHumidity, SupportsTargetRelativeHumidity = supportsTargetRelativeHumidity, SupportsCoolingThresholdTemperature = supportsCoolingThresholdTemperature, SupportsHeatingThresholdTemperature = supportsHeatingThresholdTemperature, DeviceLocation = deviceLocation
     });
     if (deviceLocation == "Local")
     {
         var tempAddThermostatPayload = new AddThermostatPayload();
         tempAddThermostatPayload.Name = name;
         tempAddThermostatPayload.SupportsCurrentRelativeHumidity     = supportsCurrentRelativeHumidity;
         tempAddThermostatPayload.SupportsTargetRelativeHumidity      = supportsTargetRelativeHumidity;
         tempAddThermostatPayload.SupportsCoolingThresholdTemperature = supportsCoolingThresholdTemperature;
         tempAddThermostatPayload.SupportsHeatingThresholdTemperature = supportsHeatingThresholdTemperature;
         var tempAddObject = new AddObject(tempAddThermostatPayload);
         HBCrestron.SendWebSocketData(JsonConvert.SerializeObject(tempAddObject)); //Serialize the Data above
     }
 }
 public static void AddDevice(string name, ushort supportsStatusActive, ushort supportsStatusFault, ushort supportsStatusTampered, ushort supportsStatusLowBattery, string deviceLocation)
 {
     OccupancySensors.Add(new OccupancySensor {
         Name = name, SupportsStatusActive = supportsStatusActive, SupportsStatusFault = supportsStatusFault, SupportsStatusTampered = supportsStatusTampered, SupportsStatusLowBattery = supportsStatusLowBattery, DeviceLocation = deviceLocation
     });
     if (deviceLocation == "Local")
     {
         var tempAddOccupancySensorPayload = new AddOccupancySensorPayload();
         tempAddOccupancySensorPayload.Name = name;
         tempAddOccupancySensorPayload.SupportsStatusActive     = supportsStatusActive;
         tempAddOccupancySensorPayload.SupportsStatusFault      = supportsStatusFault;
         tempAddOccupancySensorPayload.SupportsStatusTampered   = supportsStatusFault;
         tempAddOccupancySensorPayload.SupportsStatusLowBattery = supportsStatusLowBattery;
         var tempAddObject = new AddObject(tempAddOccupancySensorPayload);
         HBCrestron.SendWebSocketData(JsonConvert.SerializeObject(tempAddObject)); //Serialize the Data above
     }
 }
        public static void AddDevice(string name, ushort supportsBrightness, ushort supportsHue, ushort supportsSaturation, ushort supportsColorTemperature, ushort supportsRGB, string deviceLocation)
        {
            Lightbulbs.Add(new Lightbulb {
                Name = name, SupportsBrightness = supportsBrightness, SupportsHue = supportsHue, SupportsSaturation = supportsSaturation, SupportsColorTemperature = supportsColorTemperature, SupportsRGB = supportsRGB, DeviceLocation = deviceLocation
            });

            if (deviceLocation == "Local")
            {
                var tempAddLightbulbPayload = new AddLightbulbPayload();
                tempAddLightbulbPayload.Name = name;
                tempAddLightbulbPayload.SupportsBrightness       = supportsBrightness;
                tempAddLightbulbPayload.SupportsHue              = supportsHue;
                tempAddLightbulbPayload.SupportsSaturation       = supportsSaturation;
                tempAddLightbulbPayload.SupportsColorTemperature = supportsColorTemperature;
                var tempAddObject = new AddObject(tempAddLightbulbPayload);
                HBCrestron.SendWebSocketData(JsonConvert.SerializeObject(tempAddObject));
            }
        }