Skip to content

Commit

Permalink
fix: useless restart of the FUXA device
Browse files Browse the repository at this point in the history
  • Loading branch information
unocelli committed Dec 2, 2024
1 parent 7562d91 commit 28d5979
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/app/_services/project.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,7 @@ export class ProjectService {
let devices = Object.values(this.projectData.devices).filter((device: Device) => device.id !== FuxaServer.id);
let fuxaServer = <Device>this.projectData.devices[FuxaServer.id];
if (fuxaServer) {
let changed = false;
devices.forEach((device: Device) => {
if (!Object.values(fuxaServer.tags).find((tag: Tag) => tag.sysType === TagSystemType.deviceConnectionStatus && tag.memaddress === device.id)) {
let tag = new Tag(Utils.getGUID(TAG_PREFIX));
Expand All @@ -996,9 +997,12 @@ export class ProjectService {
tag.sysType = TagSystemType.deviceConnectionStatus;
tag.init = tag.value = '';
fuxaServer.tags[tag.id] = tag;
changed = true;
}
});
this.setDeviceTags(fuxaServer);
if (changed) {
this.setDeviceTags(fuxaServer);
}
}
return this.getDevices();
}
Expand Down

0 comments on commit 28d5979

Please sign in to comment.