slicing dashboard
This commit is contained in:
@@ -77,7 +77,7 @@ export class DeviceControlComponent {
|
||||
filterDevices(devices: any[]): any[] {
|
||||
return devices.filter((device) =>
|
||||
device.mapping.some(
|
||||
(map) => map.name.startsWith("switch") && map.type === "Boolean"
|
||||
(map) => map.code.startsWith("switch") && map.type === "Boolean"
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -150,8 +150,8 @@ export class DeviceControlComponent {
|
||||
|
||||
switchChanged(ev, data) {
|
||||
const requestData = {
|
||||
device_id: data.device_id,
|
||||
switch: data.mapping[0].switch,
|
||||
id: data.id,
|
||||
code: data.mapping[0].code,
|
||||
value: ev,
|
||||
command_type: "on_off",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user