Ejemplo n.º 1
0
 public RoonApiStatus(RoonApi api, string message = "", bool isError = false)
 {
     _api = api;
     _subscriptionHandler = new RoonApiSubscriptionHandler();
     _currentStatus       = new RoonStatus {
         Message = message, IsError = isError
     };
     _api.AddService(RoonApi.ServiceStatus, OnStatus);
 }
Ejemplo n.º 2
0
 public RoonApiControlVolume(RoonApi api, bool simulateFeedback)
 {
     _id  = 0;
     _api = api;
     _simulateFeedback    = simulateFeedback;
     _subscriptionHandler = new RoonApiSubscriptionHandler();
     _api.AddService(RoonApi.ControlVolume, OnVolumeControl);
     _controls  = new List <Volume>();
     _functions = new List <VolumeFunctions>();
 }
Ejemplo n.º 3
0
        public RoonApiSettings(RoonApi api, List <LayoutBase> layout, Dictionary <string, string> values, Functions functions)
        {
            _api    = api;
            _layout = layout;
            _values = values;

            _subscriptionHandler = new RoonApiSubscriptionHandler();
            _api.AddService(RoonApi.ServiceSettings, OnSettings);
            _functions = new List <Functions>();
            _functions.Add(functions);
        }
Ejemplo n.º 4
0
 public RoonControl(IRoonControlAdaptor adaptor, string myIPAddress, string coreName, int slowCycleMS, int fastCycleMS, string persistencePath, ILogger logger)
 {
     _adaptor                 = adaptor;
     _myIPAddress             = myIPAddress;
     _coreName                = coreName;
     _logger                  = logger;
     _api                     = new RoonApi(null, null, persistencePath, logger);
     _apiStatus               = new RoonApiStatus(_api);
     _isOnline                = false;
     _cancellationTokenSource = new CancellationTokenSource();
     _slowCycleMS             = slowCycleMS;
     _fastCycleMS             = fastCycleMS;
 }
Ejemplo n.º 5
0
        internal async Task <int> ReplyAll(RoonApi api, string command, string body = null, string contentType = "application/json")
        {
            int count = 0;

            foreach (var subscription in _subscriptions)
            {
                if (await api.Reply(command, subscription.Value, true, body, false, contentType))
                {
                    count++;
                }
            }
            return(count);
        }
Ejemplo n.º 6
0
 public RoonApiImage(RoonApi api)
 {
     _api = api;
 }
Ejemplo n.º 7
0
 public RoonApiTransport(RoonApi api)
 {
     _api = api;
 }
Ejemplo n.º 8
0
 public RoonApiBrowse(RoonApi api)
 {
     _api = api;
 }