public void Initialize(CpuTemp temp) { _temp = temp; _temp.OnTempUpdated += _temp_OnTempUpdated; _temp.OnSensorUpdated += _temp_OnSensorUpdated; _temp.Start(); List <IHueObject> hr = BridgesManager.Instance.SelectedBridge.GetAllObjects(); if (hr == null) { return; } ListLightGroups.AddRange(hr.Where(x => x is Light)); ListLightGroups.AddRange(hr.Where(x => x is Group)); SelectedObject = Properties.Settings.Default.CPUTemp_ObjectID != "" ? ListLightGroups.Find(x => x.Id == Properties.Settings.Default.CPUTemp_ObjectID) : ListLightGroups[0]; }
public void Initialize(Bridge bridge, CpuTemp temp) { _bridge = bridge; _temp = temp; _temp.OnTempUpdated += _temp_OnTempUpdated; _temp.OnSensorUpdated += _temp_OnSensorUpdated; _temp.Start(); List <IHueObject> hr = HueObjectHelper.GetBridgeDataStore(_bridge); if (hr == null) { return; } ListLightGroups.AddRange(hr.Where(x => x is Light)); ListLightGroups.AddRange(hr.Where(x => x is Group)); SelectedObject = Properties.Settings.Default.CPUTemp_ObjectID != "" ? ListLightGroups.Find(x => x.Id == Properties.Settings.Default.CPUTemp_ObjectID) : ListLightGroups[0]; }