public String GenerateEnergyData(int deviceNumber, int roomNumber)
        {
            var modifier = 1.0F;

            if (DeviceSendingDetails.FailureConditions.Any(
                    device => device.FailedDeviceId == deviceNumber && device.SensorType == SensorTypes.Energy))
            {
                var deviceDetails =
                    DeviceSendingDetails.FailureConditions.First(device => device.FailedDeviceId == deviceNumber);
                modifier += deviceDetails.FailedDeviceGradient;
            }

            var energy = _rand.Next((int)((DeviceSendingDetails.EnergyMin * modifier) * 100),
                                    (int)((DeviceSendingDetails.EnergyMax * modifier) * 100)) / 100;

            var energyData = new EnergyData()
            {
                Deviceid   = "energy" + deviceNumber,
                Kwh        = (energy),
                Timestamp  = DateTime.UtcNow,
                RoomNumber = roomNumber
            };

            return(JsonConvert.SerializeObject(energyData));
        }
        public String GenerateEnergyData(int deviceNumber, int roomNumber)
        {
            var modifier = 1.0F;
            if (DeviceSendingDetails.FailureConditions.Any(
                    device => device.FailedDeviceId == deviceNumber && device.SensorType == SensorTypes.Energy))
            {
                var deviceDetails =
                    DeviceSendingDetails.FailureConditions.First(device => device.FailedDeviceId == deviceNumber);
                modifier += deviceDetails.FailedDeviceGradient;
            }

            var energy = _rand.Next((int)((DeviceSendingDetails.EnergyMin * modifier) * 100),
                    (int)((DeviceSendingDetails.EnergyMax * modifier) * 100)) / 100 ;

            var energyData = new EnergyData()
            {
                Deviceid = "energy" + deviceNumber,
                Kwh = (energy),
                Timestamp = DateTime.UtcNow,
                RoomNumber = roomNumber
            };

            return JsonConvert.SerializeObject(energyData);
  
        }