public BrightnessMonitor() { currentInstance = WMITool.GetDisplayInstance(); prevBrightness = WMITool.GetBrightness(); prevState = WMITool.GetBatteryState(); }
public void BrightnessTick(int currBrightness) { int currState = WMITool.GetBatteryState(); if (currState != prevState) { WMITool.SetBrightness(currentInstance, prevBrightness); BrightnessChanged?.Invoke(prevBrightness); } prevState = currState; prevBrightness = currBrightness; }