diff --git a/src/BondApi.ts b/src/BondApi.ts index bb2b6db..2e38db7 100644 --- a/src/BondApi.ts +++ b/src/BondApi.ts @@ -48,8 +48,8 @@ export class BondApi { const req = this.request(HTTPMethod.GET, this.uri.deviceIds()); return req.then(json => Object.keys(json).filter(x => { - // Ignore anything that is an empty string or '_' - return x.length > 0 && x !== '_'; + // Ignore anything that is an empty string or all underscores + return x.length > 0 && !/^_+$/.test(x); }), ); } @@ -278,8 +278,8 @@ export class BondApi { const req = this.request(HTTPMethod.GET, this.uri.commands(id)); return req.then(json => Object.keys(json).filter(x => { - // Ignore anything that is an empty string or '_' - return x.length > 0 && x !== '_'; + // Ignore anything that is an empty string or all underscores + return x.length > 0 && !/^_+$/.test(x); }), ); }