public async Task <DigitalOutputViewDTO> GetOutputAsync(int pin)
        {
            PinInRange(pin);

            var    baseUrl        = _configuration["ioDeviceBaseURI"];
            string internalResult = null;

            internalResult = await CallDevice(baseUrl, $"/io/out/{pin}");

            var formatedResult = JsonConvert.DeserializeObject <DigitalOutputViewEntity>(internalResult);

            DigitalOutputViewDTO dto = MapInternalToExternal(formatedResult);

            return(dto);
        }
        public async Task <DigitalOutputViewDTO> UpdateOutputAsync(int pin, DigitalOutputUpdateDTO outputPin)
        {
            var baseUrl = _configuration["ioDeviceBaseURI"];
            DigitalOutputViewDTO result = null;

            string internalResult = null;

            // the body for the put call

            var messageBody = MapPUTDTOtoEntity(outputPin);

            internalResult = await CallDevicePut(baseUrl, $"/io/out/{pin.ToString()}", messageBody);

            var formatedResult = JsonConvert.DeserializeObject <DigitalOutputViewEntity>(internalResult);

            result = FormatOutputViewEntityToDTOEntity(formatedResult);

            return(result);
        }