new PUPRemote()
The PUPRemote is emitted if the discovered device is a Powered UP Remote.
- Source:
Extends
Members
-
<readonly> batteryLevel
-
- Inherited From:
- Overrides:
- Source:
Properties:
Name Type Description batteryLevel
number Battery level of the hub (Percentage between 0-100)
-
<readonly> current
-
- Inherited From:
- Overrides:
- Source:
Properties:
Name Type Description current
number Current usage of the hub (Amps)
-
<readonly> firmwareVersion
-
- Inherited From:
- Overrides:
- Source:
Properties:
Name Type Description firmwareVersion
string Firmware version of the hub
-
<readonly> name
-
<readonly> rssi
-
<readonly> uuid
-
<readonly> voltage
-
- Inherited From:
- Overrides:
- Source:
Properties:
Name Type Description voltage
number Voltage of the hub (Volts)
Methods
-
connect()
-
Connect to the Hub.
- Inherited From:
- Overrides:
- Source:
Returns:
Resolved upon successful connect.
- Type
- Promise
-
disconnect()
-
Disconnect the Hub.
- Inherited From:
- Overrides:
- Source:
Returns:
Resolved upon successful disconnect.
- Type
- Promise
-
getHubType()
-
Get the hub type.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- HubType
-
getPortDeviceType(port)
-
Get the device type for a given port.
Parameters:
Name Type Description port
string - Inherited From:
- Overrides:
- Source:
Returns:
- Type
- DeviceType
-
setLEDColor(color)
-
Set the color of the LED on the Remote via a color value.
Parameters:
Name Type Description color
Color - Overrides:
- Source:
Returns:
Resolved upon successful issuance of command.
- Type
- Promise
-
setLEDRGB(red, green, blue)
-
Set the color of the LED on the Hub via RGB values.
Parameters:
Name Type Description red
number green
number blue
number - Overrides:
- Source:
Returns:
Resolved upon successful issuance of command.
- Type
- Promise
-
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).
- Inherited From:
- Source:
Returns:
Resolved upon successful issuance of command.
- Type
- Promise
-
shutdown()
-
Shutdown the Hub.
- Inherited From:
- Source:
Returns:
Resolved upon successful disconnect.
- Type
- Promise
-
sleep(delay)
-
Sleep a given amount of time.
This is a helper method to make it easier to add delays into a chain of commands.
Parameters:
Name Type Description delay
number How long to sleep (in milliseconds).
Returns:
Resolved after the delay is finished.
- Type
- Promise
-
subscribe(port [, mode])
-
Subscribe to sensor notifications on a given port.
Parameters:
Name Type Argument Description port
string mode
number <optional>
The sensor mode to activate. If no mode is provided, the default for that sensor will be chosen.
- Inherited From:
- Overrides:
- Source:
Returns:
Resolved upon successful issuance of command.
- Type
- Promise
-
unsubscribe(port)
-
Unsubscribe to sensor notifications on a given port.
Parameters:
Name Type Description port
string - Inherited From:
- Overrides:
- Source:
Returns:
Resolved upon successful issuance of command.
- Type
- Promise
-
wait(commands)
-
Wait until a given list of concurrently running commands are complete.
This is a helper method to make it easier to wait for concurrent commands to complete.
Parameters:
Name Type Description commands
Array.<Promise.<any>> Array of executing commands.
Returns:
Resolved after the commands are finished.
- Type
- Promise
Events
-
button
-
Emits when a button is pressed.
Parameters:
Name Type Description button
string state
ButtonState - Inherited From:
- Source:
-
colorAndDistance
-
A combined color and distance event, emits when the sensor is activated.
Parameters:
Name Type Description port
string color
Color distance
number Distance, in millimeters.
- Inherited From:
- Source: