slicing dashboard

This commit is contained in:
2024-07-15 21:39:12 +07:00
parent 4c2d40986e
commit 751c36209e
20 changed files with 221 additions and 133 deletions

View File

@@ -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",
};