Mercurial > code > home > repos > light-bridge
comparison src/main.ts @ 19:4e350dcdc4fe
zero button
author | drewp@bigasterisk.com |
---|---|
date | Mon, 29 Jan 2024 11:50:28 -0800 |
parents | 412d37f707c9 |
children | 178e020289c1 |
comparison
equal
deleted
inserted
replaced
18:412d37f707c9 | 19:4e350dcdc4fe |
---|---|
132 } | 132 } |
133 | 133 |
134 async onRequestingColor(lightName: string, ev: InputEvent) { | 134 async onRequestingColor(lightName: string, ev: InputEvent) { |
135 const currentRequest = this.lightByName.get(lightName)!.requestingColor; | 135 const currentRequest = this.lightByName.get(lightName)!.requestingColor; |
136 const value = (ev.target as HTMLInputElement).value; | 136 const value = (ev.target as HTMLInputElement).value; |
137 this.onCol(value, currentRequest, lightName); | |
138 } | |
139 | |
140 async onZero(lightName: string, ev: InputEvent) { | |
141 const currentRequest = this.lightByName.get(lightName)!.requestingColor; | |
142 const value = "#000000"; | |
143 this.onCol(value, currentRequest, lightName); | |
144 } | |
145 | |
146 private onCol(value: string, currentRequest: string, lightName: string) { | |
137 console.log("LbPage ~ onRequestingColor ~ value === currentRequest:", value, currentRequest); | 147 console.log("LbPage ~ onRequestingColor ~ value === currentRequest:", value, currentRequest); |
138 if (value === currentRequest) { | 148 if (value === currentRequest) { |
139 return; | 149 return; |
140 } | 150 } |
141 const url = new URL("api/output", location as any); | 151 const url = new URL("api/output", location as any); |