Skip to content

Commit

Permalink
Fix DiscoveryServer implementation
Browse files Browse the repository at this point in the history
Couple of bugs caught by thingpedia-client's tests hitting almond-dev
  • Loading branch information
gcampax committed Oct 25, 2018
1 parent e57885a commit 6d92a8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions util/thingpedia-client.js
Expand Up @@ -42,14 +42,14 @@ class ThingpediaDiscoveryDatabase {
// for compatibility until thingpedia-discovery is updated
getByAnyKind(kind) {
if (kind.startsWith('bluetooth-'))
return this.getByDiscoveryService('bluetooth', kind.substring('bluetooth-').length);
return this.getByDiscoveryService('bluetooth', kind.substring('bluetooth-'.length));
if (kind.startsWith('upnp-'))
return this.getByDiscoveryService('upnp', kind.substring('upnp-').length);
return this.getByDiscoveryService('upnp', kind.substring('upnp-'.length));
return db.withClient((dbClient) => device.getByAnyKind(dbClient, kind));
}
getAllKinds(deviceId) {
return this.getAllDiscoveryServices(deviceId).then((services) => services.map((s) => {
return s.discovery_type + s.service;
return { kind: s.discovery_type + s.service };
}));
}

Expand Down

0 comments on commit 6d92a8e

Please sign in to comment.