public static StoredSmartTemperatureClient FromSmartTemperatureClient(SmartTemperatureClient client)
        {
            var storedClient = new StoredSmartTemperatureClient();

            storedClient.ChipId         = client.ChipId;
            storedClient.Humidity       = client.Humidity;
            storedClient.LastDataUpdate = client.LastDataUpdate;
            storedClient.Temperature    = client.Temperature;
            storedClient.Name           = client.Name;
            return(storedClient);
        }
Beispiel #2
0
        public static SmartTemperatureClient ConvertToSmartClient(this StoredSmartTemperatureClient storedSmartTemperatureClient)
        {
            if (storedSmartTemperatureClient == null)
            {
                return(null);
            }
            SmartTemperatureClient smartTemperatureClient = new SmartTemperatureClient {
                ChipId = storedSmartTemperatureClient.ChipId
            };

            smartTemperatureClient.Temperature    = storedSmartTemperatureClient.Temperature;
            smartTemperatureClient.Humidity       = storedSmartTemperatureClient.Humidity;
            smartTemperatureClient.LastDataUpdate = storedSmartTemperatureClient.LastDataUpdate;
            smartTemperatureClient.Name           = storedSmartTemperatureClient.Name;
            return(smartTemperatureClient);
        }