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

Resolved a small error

parent 35516c47
No related branches found
No related tags found
1 merge request!2Features/led fix
export class LED {
value: number;
id: string
}
\ No newline at end of file
id: number;
};
export class LEDs {
leds: LED[];
};
\ No newline at end of file
......@@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { Observable } from 'rxjs';
import { Dht } from './models/dht.model';
import { LED } from './models/led.model';
import { LED, LEDs } from './models/led.model';
@Injectable({
providedIn: 'root'
......@@ -20,8 +20,8 @@ export class SensorService {
return this.http.get<Dht>(`${this.rootUrl}api/sensor/dht`);
}
getLEDs(): Observable<any> {
return this.http.get<any>(`${this.rootUrl}api/actuator/led`);
getLEDs(): Observable<LEDs> {
return this.http.get<LEDs>(`${this.rootUrl}api/actuator/led`);
}
setLED(id: number, status: boolean): Observable<LED> {
......
......@@ -86,9 +86,9 @@ export function getLEDservice(lednr: number) {
export function getAllLEDsservice() {
let tmp = [
{ "value": getLEDservice(2), "id": "2" },
{ "value": getLEDservice(4), "id": "4" },
{ "value": getLEDservice(22), "id": "22" }
{ "value": getLEDservice(2), "id": 2 },
{ "value": getLEDservice(4), "id": 4 },
{ "value": getLEDservice(22), "id": 22 }
];
return tmp;
......
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