Interface DeviceManager

DeviceManager is the interface used by DeviceProvider to report new devices, device states, and device events to Scrypted.

Hierarchy

  • DeviceManager

Methods

  • Get the logger for a device given a native id.

    Parameters

    • Optional nativeId: string

    Returns Logger

  • Get the console for the device given a native id.

    Parameters

    • Optional nativeId: string

    Returns Console

  • Get the console for the device given a native id.

    Parameters

    • mixinId: string
    • Optional nativeId: string

    Returns Console

  • Get the device state maintained by Scrypted. Setting properties on this state will update the state in Scrypted.

    Parameters

    • Optional nativeId: string

    Returns DeviceState

  • Create a device state object that will trap all state setting calls. Used internally by mixins and fork.

    Parameters

    • id: string
    • setState: ((property: string, value: any) => Promise<void>)
        • (property: string, value: any): Promise<void>
        • Parameters

          • property: string
          • value: any

          Returns Promise<void>

    Returns DeviceState

  • Get the storage for a mixin.

    Parameters

    • id: string

      The id of the device being mixined.

    • Optional nativeId: string

      The nativeId of the MixinProvider.

    Returns Storage

  • Fire an event for a mixin provided by this plugin.

    Parameters

    • id: string
    • mixinDevice: any
    • eventInterface: string
    • eventData: any

    Returns Promise<void>

  • Get the device Storage object.

    Parameters

    • Optional nativeId: string

    Returns Storage

  • Get all the native ids that have been reported by this plugin. This always includes "undefined", the plugin itself.

    Returns string[]

  • onDeviceDiscovered is used to report new devices that are trickle discovered, one by one, such as via a network broadcast.

    Parameters

    Returns Promise<string>

  • Fire an event for a device provided by this plugin.

    Parameters

    • nativeId: string
    • eventInterface: string
    • eventData: any

    Returns Promise<void>

  • onDeviceRemoved is used to report when discovered devices are removed.

    Parameters

    • nativeId: string

    Returns Promise<void>

  • onDevicesChanged is used to sync Scrypted with devices that are attached to a hub, such as Hue or SmartThings. All the devices should be reported at once.

    Parameters

    Returns Promise<void>

  • Restart the plugin. May not happen immediately.

    Returns Promise<void>

Generated using TypeDoc