示例#1
0
        /// <summary>
        /// Reads single thermostats.
        /// </summary>
        /// <param name="uuid"></param>
        /// <returns></returns>
        public async Task <(ThermostatInfo Data, DataStatus Status)> DataReadThermostatAsync(Guid uuid)
        {
            var(thermostat, status) = await ReadThermostatAsync(uuid, ThermostatFlags.ALL);

            if (status.IsGood)
            {
                Data.UpdateThermostats(thermostat);
            }
            else
            {
                _logger?.LogError($"Error code {status.Code} in reading thermostat: {status.Explanation}.");
            }

            Data.Status = status;
            return(thermostat, Data.Status);
        }