Options
All
  • Public
  • Public/Protected
  • All
Menu

SDK class that expose the Sector Alarm API.

Note that login() does not need to be called explicitly. The SDK will lazily call login() to (re)authenticate when necessary.

Type parameters

  • Test: boolean = false

Hierarchy

  • SectorApi

Index

Constructors

  • new SectorApi<Test>(email: string, password: string, configuration?: Configuration<Test>): SectorApi<Test>
  • The generic type parameter should be either omitted or false in production.

    Type parameters

    • Test: boolean = false

    Parameters

    • email: string
    • password: string
    • Optional configuration: Configuration<Test>

    Returns SectorApi<Test>

Methods

  • changeAlarmState(panelId: string, command: "Disarm" | "Total" | "Partial", panelCode?: string): Promise<void>
  • Change the state of an alarm panel. The function returns once the alarm has confirmed the state change. The call throws if 1) the panel code is incorrect 2) The panel is offline 3) the underlying API version has changed.

    Parameters

    • panelId: string
    • command: "Disarm" | "Total" | "Partial"
    • Optional panelCode: string

    Returns Promise<void>

  • getPanelDetails(panelId: string): Promise<GetPanelResponse>
  • Fetch details about the support features of an alarm panel.

    Parameters

    • panelId: string

    Returns Promise<GetPanelResponse>

  • getPanelList(): Promise<GetPanelListResponse>
  • Fetch a list of high level information about alarm panels.

    Returns Promise<GetPanelListResponse>

  • getPanelStatus(panelId: string): Promise<GetPanelStatusResponse>
  • Request panel arm status.

    Parameters

    • panelId: string

    Returns Promise<GetPanelStatusResponse>

  • getTemperatures(panelId: string): Promise<GetTemperaturesResponse>
  • Fetch temperature measurements from the devices connected to the panel.

    Parameters

    • panelId: string

    Returns Promise<GetTemperaturesResponse>

  • login(): Promise<void>
  • Authenticate using the credentials specified in the constructor. The login flow emulates a user login and stores the authenticated cookie for subsequent API calls.

    This function is used internally and does not need to be called directly.

    Returns Promise<void>

  • setPanelSettings(panelId: string, displayName: string, quickArm: boolean): Promise<void>
  • Update the name and enable/disable the quick arm capability of an alarm panel.

    Parameters

    • panelId: string
    • displayName: string
    • quickArm: boolean

    Returns Promise<void>