Beispiel #1
0
 public CpuTempMonitor(Bridge bridge)
 {
     _bridge             = bridge;
     Temp                = new CpuTemp(1);
     Temp.OnTempUpdated += temp_OnTempUpdated;
     LoadSettings();
 }
Beispiel #2
0
        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];
        }
Beispiel #3
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];
        }
Beispiel #4
0
        /// <summary>
        /// The Host provides a way to request information on objects present in the bridge.
        /// </summary


        //*********************** Local Plugin Variable *********************

        public Form_CpuTempMonitorSettings(CpuTemp temp, Bridge bridge)
        {
            InitializeComponent();
            _cpuvm = DataContext as CpuTempViewModel;
            _cpuvm.Initialize(bridge, temp);
        }