Skip to content
Snippets Groups Projects
Commit c5d0cce8 authored by kasperlauge's avatar kasperlauge
Browse files

Added some debugging

parent 01169830
No related branches found
No related tags found
1 merge request!1Swagger improvements
......@@ -29,6 +29,7 @@ export class LedPresentationComponent implements OnInit {
}
onValueChange(currentValue: string, id: number) {
console.log(currentValue);
if (+currentValue === 1) {
this.setOff(id);
} else {
......@@ -43,12 +44,14 @@ export class LedPresentationComponent implements OnInit {
setOff(id: number) {
this.sensorService.setLED(id, false).pipe(takeUntil(this.unsubscribe)).subscribe(result => {
this.leds.find(led => led.id === result.id)[0] = result.value;
console.log(result);
this.leds.find(led => led.id === result.id)[0] = result;
});
}
setOn(id: number) {
this.sensorService.setLED(id, true).pipe(takeUntil(this.unsubscribe)).subscribe(result => {
this.leds.find(led => led.id === result.id)[0] = result.value;
console.log(result);
this.leds.find(led => led.id === result.id)[0] = result;
});
}
......
......@@ -26,7 +26,7 @@ export function setLED(req: Request, res: Response, next: NextFunction) {
setLEDservice(id, newValue);
const value = getLEDservice(id);
console.log(value);
res.status(201).json({id,value});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment