Skip to content

Commit

Permalink
Updated handling of DDC/CI without brightness info
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Feb 6, 2021
1 parent 199b9a6 commit e00ac0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/BrightnessPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default class BrightnessPanel extends PureComponent {
this.lastLevels = []
let numMonitors = 0
for (let key in newMonitors) {
if (newMonitors[key].type != "none") numMonitors++;
if (newMonitors[key].type != "none" && !(newMonitors[key].type == "ddcci" && !newMonitors[key].brightnessType)) numMonitors++;
}
this.numMonitors = numMonitors
// Reset panel height so it's recalculated
Expand Down
12 changes: 10 additions & 2 deletions src/components/SettingsWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -696,15 +696,23 @@ export default class SettingsWindow extends PureComponent {
} else {
return Object.values(this.state.monitors).map((monitor, index) => {

let brightness = monitor.brightness
let brightnessMax = monitor.brightnessMax

if(monitor.type == "ddcci" && !monitor.brightnessType) {
brightness = "???"
brightnessMax = "???"
}

return (
<div key={monitor.key}>
<br />
<div className="sectionSubtitle"><div className="icon">&#xE7F4;</div><div>{monitor.name}</div></div>
<p>Name: <b>{this.getMonitorName(monitor, this.state.names)}</b>
<br />Internal name: <b>{monitor.hwid[1]}</b>
<br />Communication Method: {this.getDebugMonitorType(monitor.type)}
<br />Current Brightness: <b>{(monitor.type == "none" ? "Not supported" : monitor.brightness)}</b>
<br />Max Brightness: <b>{(monitor.type !== "ddcci" ? "Not supported" : monitor.brightnessMax)}</b>
<br />Current Brightness: <b>{(monitor.type == "none" ? "Not supported" : brightness)}</b>
<br />Max Brightness: <b>{(monitor.type !== "ddcci" ? "Not supported" : brightnessMax)}</b>
<br />Brightness Normalization: <b>{(monitor.type == "none" ? "Not supported" : monitor.min + " - " + monitor.max)}</b>
</p>
</div>
Expand Down

0 comments on commit e00ac0d

Please sign in to comment.