public async ValueTask StopAsync() { if (_mdc != null) { _logger.LogInformation($"Disconnecting from display on port '{_configuration.Value.Port}'"); await _mdc.DisconnectAsync(); await _mdc.DisposeAsync(); _mdc = null; } else { throw new InvalidOperationException("Controller has not been started"); } }