Cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Brandon Watson
2021-12-28 20:16:43 -05:00
parent e6e3d45b5b
commit 51441a706d
4 changed files with 16 additions and 15 deletions

View File

@ -100,19 +100,21 @@ export class ActivityService {
let currentOtherState: IActivityState =
this._stateDataProvider.states[controlUnitKey]!;
if (currentOtherState) {
currentOtherState.currentActivity.DeviceSetupList.forEach(
(value: IDeviceSetupItem) => {
//there are devices to remove
if (devicesToTurnOn.some((e) => e && e.name === value.DeviceName)) {
let deviceToRemove: HarmonyDevice = devicesToTurnOn.filter(
(i) => i.name === value.DeviceName
)[0];
delete devicesToTurnOn[devicesToTurnOn.indexOf(deviceToRemove)];
}
}
);
if (!currentOtherState) {
return devicesToTurnOn;
}
currentOtherState.currentActivity.DeviceSetupList.forEach(
(value: IDeviceSetupItem) => {
//there are devices to remove
if (devicesToTurnOn.some((e) => e && e.name === value.DeviceName)) {
let deviceToRemove: HarmonyDevice = devicesToTurnOn.filter(
(i) => i.name === value.DeviceName
)[0];
delete devicesToTurnOn[devicesToTurnOn.indexOf(deviceToRemove)];
}
}
);
}
return devicesToTurnOn;