Scrypted Documentation / ScryptedDevice
Interface: ScryptedDevice
All devices in Scrypted implement ScryptedDevice, which contains the id, name, and type. Add listeners to subscribe to events from that device.
Properties
id
id:
string
nativeId?
optional
nativeId:ScryptedNativeId
pluginId
pluginId:
string
interfaces
interfaces:
string
[]
mixins
mixins:
string
[]
name?
optional
name:string
info?
optional
info:DeviceInformation
providedInterfaces
providedInterfaces:
string
[]
providedName?
optional
providedName:ScryptedDeviceType
providedRoom?
optional
providedRoom:string
providedType?
optional
providedType:ScryptedDeviceType
providerId?
optional
providerId:string
room?
optional
room:string
type?
optional
type:ScryptedDeviceType
Methods
listen()
listen(
event
,callback
):EventListenerRegister
Subscribe to events from a specific interface on a device, such as 'OnOff' or 'Brightness'.
Parameters
• event: string
| EventListenerOptions
• callback: EventListener
Returns
setName()
setName(
name
):Promise
<void
>
Parameters
• name: string
Returns
Promise
<void
>
setRoom()
setRoom(
room
):Promise
<void
>
Parameters
• room: string
Returns
Promise
<void
>
setType()
setType(
type
):Promise
<void
>
Parameters
• type: ScryptedDeviceType
Returns
Promise
<void
>
setMixins()
setMixins(
mixins
):Promise
<void
>
Parameters
• mixins: string
[]
Returns
Promise
<void
>
probe()
probe():
Promise
<boolean
>
Probes the device, ensuring creation of it and any mixins.
Returns
Promise
<boolean
>