(list: WithLocation[])
| 43 | } |
| 44 | |
| 45 | const uniqueLocationIds = (list: WithLocation[]): string[] => { |
| 46 | // Note -- the `.filter(notEmpty))` is here because the source types such |
| 47 | // as InstalledApp are currently defined with optional locationId even |
| 48 | // though locationId is actually always set. The filter can be removed |
| 49 | // once that issue is corrected. |
| 50 | return Array.from(new Set(list.map(item => item.locationId).filter(notEmpty))) |
| 51 | } |
| 52 | |
| 53 | export const withLocationsAndRooms = async <T extends WithRoom>(client: SmartThingsClient, list: T[]): Promise<(T & WithNamedRoom)[]> => { |
| 54 | const locationNameById = await buildLocationNamesById(client) |
no outgoing calls
no test coverage detected