Skip to content

Commit

Permalink
Add manual VCP sending to debug menu
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Sep 4, 2024
1 parent f29f9e1 commit 45502c2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/MonitorInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export default function MonitorInfo(props) {
const [contrast, setContrast] = useState(monitor?.features?.["0x12"] ? monitor?.features?.["0x12"][0] : 50)
const [volume, setVolume] = useState(monitor?.features?.["0x62"] ? monitor?.features?.["0x62"][0] : 50)
const [powerState, setPowerState] = useState(monitor?.features?.["0xD6"] ? monitor?.features?.["0xD6"][0] : 50)
const [manualVCP, setManualVCP] = useState("")
const [manualValue, setManualValue] = useState("")

let extraHTML = []

Expand Down Expand Up @@ -64,6 +66,15 @@ export default function MonitorInfo(props) {
)
}

// Manual VCP
extraHTML.push(
<div className="manual-vcp-row" key="manual">
<input placeholder="VCP code" value={manualVCP} onChange={e => { setManualVCP(e.target.value) }} />
<input placeholder="Value" value={manualValue} onChange={e => { setManualValue(e.target.value) }} />
<a className="button" onClick={() => setVCP(monitor.id, parseInt(manualVCP), parseInt(manualValue))}>Send VCP</a>
</div>
)

return (
<div key={monitor.key}>
<br />
Expand Down

0 comments on commit 45502c2

Please sign in to comment.