Preparing search index...
The search index is not available
@lucadiba/switchbot-client
@lucadiba/switchbot-client
devices/Device
DeviceWithPower
Class DeviceWithPower<StatusBody, CommandBody>
Type Parameters
StatusBody
extends
BaseDeviceWithPowerStatusBody
<
DeviceTypes
>
CommandBody
Hierarchy (
View Summary
)
DeviceWithStatus
<
StatusBody
,
CommandBody
>
DeviceWithPower
DeviceWithPowerToggle
default
default
Index
Constructors
constructor
Properties
_deps
_device
Id
Methods
_get
Path
get
Hub
Device
Id
get
Power
Status
get
Status
send
Command
turn
Off
turn
On
Constructors
constructor
new
DeviceWithPower
<
StatusBody
extends
BaseDeviceWithPowerStatusBody
<
|
"Blind Tilt"
|
"Bot"
|
"Curtain"
|
"Curtain 3"
|
"Hub"
|
"Hub 2"
|
"Hub Plus"
|
"Hub Mini"
|
"Meter"
|
"MeterPlus"
|
"WoIOSensor"
|
"Smart Lock"
|
"Keypad"
|
"Keypad Touch"
|
"Remote"
|
"Motion Sensor"
|
"Contact Sensor"
|
"Ceiling Light"
|
"Ceiling Light Pro"
|
"Plug Mini (US)"
|
"Plug Mini (JP)"
|
"Plug"
|
"Strip Light"
|
"Color Bulb"
|
"Robot Vacuum Cleaner S1"
|
"Robot Vacuum Cleaner S1 Plus"
|
"Humidifier"
|
"Indoor Cam"
|
"Pan/Tilt Cam"
,
>
,
CommandBody
,
>
(
deviceId
:
string
,
deps
:
Deps
,
)
:
DeviceWithPower
<
StatusBody
,
CommandBody
>
Type Parameters
StatusBody
extends
BaseDeviceWithPowerStatusBody
<
|
"Blind Tilt"
|
"Bot"
|
"Curtain"
|
"Curtain 3"
|
"Hub"
|
"Hub 2"
|
"Hub Plus"
|
"Hub Mini"
|
"Meter"
|
"MeterPlus"
|
"WoIOSensor"
|
"Smart Lock"
|
"Keypad"
|
"Keypad Touch"
|
"Remote"
|
"Motion Sensor"
|
"Contact Sensor"
|
"Ceiling Light"
|
"Ceiling Light Pro"
|
"Plug Mini (US)"
|
"Plug Mini (JP)"
|
"Plug"
|
"Strip Light"
|
"Color Bulb"
|
"Robot Vacuum Cleaner S1"
|
"Robot Vacuum Cleaner S1 Plus"
|
"Humidifier"
|
"Indoor Cam"
|
"Pan/Tilt Cam"
,
>
CommandBody
Parameters
deviceId
:
string
deps
:
Deps
Returns
DeviceWithPower
<
StatusBody
,
CommandBody
>
Properties
Protected
Readonly
_deps
_deps
:
Deps
Protected
Readonly
_device
Id
_deviceId
:
string
Methods
Protected
_get
Path
_getPath
(
path
:
string
)
:
string
Parameters
path
:
string
Returns
string
get
Hub
Device
Id
getHubDeviceId
()
:
Promise
<
string
>
Returns
Promise
<
string
>
get
Power
Status
getPowerStatus
()
:
Promise
<
"on"
|
"off"
>
Returns
Promise
<
"on"
|
"off"
>
get
Status
getStatus
(
options
?:
GetStatusOptions
)
:
Promise
<
StatusBody
>
Parameters
options
:
GetStatusOptions
= {}
Returns
Promise
<
StatusBody
>
Protected
send
Command
sendCommand
(
command
:
string
,
parameter
?:
any
)
:
Promise
<
CommandBody
>
Parameters
command
:
string
parameter
:
any
= "default"
Returns
Promise
<
CommandBody
>
turn
Off
turnOff
()
:
Promise
<
CommandBody
>
Set the device to off state.
Returns
Promise
<
CommandBody
>
turn
On
turnOn
()
:
Promise
<
CommandBody
>
Set the device to on state.
Returns
Promise
<
CommandBody
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
_deps
_device
Id
Methods
_get
Path
get
Hub
Device
Id
get
Power
Status
get
Status
send
Command
turn
Off
turn
On
@lucadiba/switchbot-client
Loading...
Set the device to off state.