nathankellenicki / node-poweredup

A Javascript module to interface with LEGO Powered Up components.
https://nathankellenicki.github.io/node-poweredup/
MIT License
483 stars 61 forks source link

Feature request: getConnectedHubByName #16

Closed nathankellenicki closed 5 years ago

nathankellenicki commented 5 years ago

Hi, @nathankellenicki can you add a new method called getConnectedHubByName, that use friendly name configured by setName, instead of UUID?

Originally posted by @GianCann in https://github.com/nathankellenicki/node-poweredup/issues/11#issuecomment-459745886

nathankellenicki commented 5 years ago

Hi @GianCann, I've added this in v1.8.0 which is now available. It is almost as you asked - getConnectedHubsByName (notice the plural), which returns an array of matching hubs. This is because multiple connected hubs can have the same name.

Hopefully this does what you need. :)

Documentation here: https://nathankellenicki.github.io/node-poweredup/PoweredUP.html#getConnectedHubsByName__anchor

GianCann commented 5 years ago

ok, thank you very much!

nathankellenicki commented 5 years ago

Closed, fixed with 9ced6da24e2f45536d0253429542d73047a69efb