targetsAsResources property

List<Resource> get targetsAsResources

Returns a list of the targets as Resource objects.

Throws MissingHueNetworkException if the hueNetwork is null, if a target can not be found on the hueNetwork, or if the target's ResourceType cannot be found on the hueNetwork.

Implementation

List<Resource> get targetsAsResources {
  List<Relative> targets = [];

  for (SmartSceneWeek weekTimeslot in weekTimeslots) {
    targets.addAll(weekTimeslot.timeslots.map((timeslot) => timeslot.target));
  }

  return getRelativesAsResources(targets);
}