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?
optionalnativeId:ScryptedNativeId
pluginId
pluginId:
string
interfaces
interfaces:
string[]
mixins
mixins:
string[]
name?
optionalname:string
info?
optionalinfo:DeviceInformation
providedInterfaces
providedInterfaces:
string[]
providedName?
optionalprovidedName:string
providedRoom?
optionalprovidedRoom:string
providedType?
optionalprovidedType:string
providerId?
optionalproviderId:string
room?
optionalroom:string
type?
optionaltype:string
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>
