# node-poweredup Class: WeDo2SmartHub

# Class: WeDo2SmartHub

## WeDo2SmartHub

#### new WeDo2SmartHub()

  The WeDo2SmartHub is emitted if the discovered device is a WeDo 2.0 Smart Hub.

  Source:
    - hubs/wedo2smarthub.js, line 28

### Extends

- BaseHub

### Members

#### <readonly> batteryLevel

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `batteryLevel` | number | Battery level of the hub (Percentage between 0-100)

  Inherited From:
    - BaseHub#batteryLevel
  Source:
    - hubs/basehub.js, line 141

#### <readonly> firmwareVersion

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `firmwareVersion` | string | Firmware version of the hub

  Inherited From:
    - BaseHub#firmwareVersion
  Source:
    - hubs/basehub.js, line 113

#### <readonly> hardwareVersion

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `hardwareVersion` | string | Hardware version of the hub

  Inherited From:
    - BaseHub#hardwareVersion
  Source:
    - hubs/basehub.js, line 120

#### <readonly> name

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `name` | string | Name of the hub

  Inherited From:
    - BaseHub#name
  Source:
    - hubs/basehub.js, line 92

#### <readonly> ports

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `ports` | Array.<string> | Array of port names

  Inherited From:
    - BaseHub#ports
  Source:
    - hubs/basehub.js, line 106

#### <readonly> primaryMACAddress

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `primaryMACAddress` | string | Primary MAC address of the hub

  Inherited From:
    - BaseHub#primaryMACAddress
  Source:
    - hubs/basehub.js, line 127

#### <readonly> rssi

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `rssi` | number | Signal strength of the hub

  Inherited From:
    - BaseHub#rssi
  Source:
    - hubs/basehub.js, line 148

#### <readonly> type

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `type` | string | Hub type

  Inherited From:
    - BaseHub#type
  Source:
    - hubs/basehub.js, line 99

#### <readonly> uuid

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `uuid` | string | UUID of the hub

  Inherited From:
    - BaseHub#uuid
  Source:
    - hubs/basehub.js, line 134

### Methods

#### setName(name)

  Set the name of the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `name` | string | New name of the hub (14 characters or less, ASCII only).

  Source:
    - hubs/wedo2smarthub.js, line 107

  ##### Returns:

  Resolved upon successful issuance of command.

  Type
    Promise

#### shutdown()

  Shutdown the Hub.

  Source:
    - hubs/wedo2smarthub.js, line 99

  ##### Returns:

  Resolved upon successful disconnect.

  Type
    Promise

### Events

#### button

  Emits when a button is pressed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `button` | string |
  `state` | ButtonState |

  Source:
    - hubs/wedo2smarthub.js, line 182

#### Search results