Mercurial > code > home > repos > light-bridge
diff src/main.ts @ 19:4e350dcdc4fe
zero button
author | drewp@bigasterisk.com |
---|---|
date | Mon, 29 Jan 2024 11:50:28 -0800 |
parents | 412d37f707c9 |
children | 178e020289c1 |
line wrap: on
line diff
--- a/src/main.ts Mon Jan 29 11:50:06 2024 -0800 +++ b/src/main.ts Mon Jan 29 11:50:28 2024 -0800 @@ -134,6 +134,16 @@ async onRequestingColor(lightName: string, ev: InputEvent) { const currentRequest = this.lightByName.get(lightName)!.requestingColor; const value = (ev.target as HTMLInputElement).value; + this.onCol(value, currentRequest, lightName); + } + + async onZero(lightName: string, ev: InputEvent) { + const currentRequest = this.lightByName.get(lightName)!.requestingColor; + const value = "#000000"; + this.onCol(value, currentRequest, lightName); + } + + private onCol(value: string, currentRequest: string, lightName: string) { console.log("LbPage ~ onRequestingColor ~ value === currentRequest:", value, currentRequest); if (value === currentRequest) { return;