Exemplo n.º 1
0
        private void DevFound(object?sender, DreamScreenClient.DeviceDiscoveryEventArgs e)
        {
            Log.Debug("Dream Device found??");
            var dd = new DreamScreenData(e.Device);

            Log.Debug("Got one: " + JsonConvert.SerializeObject(dd));
            _cs.AddDevice(dd).ConfigureAwait(false);
        }
Exemplo n.º 2
0
        public Task ReloadData()
        {
            var dev = DataUtil.GetDevice(Id);

            if (dev != null)
            {
                _data = dev;
            }

            return(Task.CompletedTask);
        }
Exemplo n.º 3
0
        public DreamScreenDevice(DreamScreenData data, ColorService cs) : base(cs)
        {
            _data = data;
            Id    = data.Id;
            var client = cs.ControlService.GetAgent("DreamAgent");

            if (client != null)
            {
                _client = client;
            }

            _ipAddress = _data.IpAddress;
            _deviceTag = _data.DeviceTag;
            LoadData();
            cs.ColorSendEventAsync += SetColors;
            var myIp = IPAddress.Parse(_ipAddress);

            _dev = new DreamDevice(_deviceTag)
            {
                IpAddress = myIp, DeviceGroup = data.GroupNumber
            };
        }