Heatzy API for Node.js - v13.0.0
    Preparing search index...

    Class Device

    In-memory model of one bound Heatzy device: wire identity, the last-synced attribute payload, and the derived state the wire does not carry (previous mode, derogation end date). Instances are created and updated exclusively by DeviceRegistry.syncDevices, which preserves object identity across syncs.

    Index
    • Builds the model from a /bindings entry and its live attributes.

      Parameters

      • binding: DeviceBinding

        Wire identity from /bindings.

      • attributes: Attributes

        Live attribute payload from /devdata.

      • Optionaltimezone: string

        IANA timezone anchoring derogation end dates; defaults to the runtime system timezone.

      Returns Device

    id: string

    Wire did — the device's unique identifier.

    name: string

    Wire dev_alias — the user-facing device name; tracks renames across syncs.

    product: Product

    Product generation resolved from the wire product_key.

    productKey: string

    Wire product_key hash.

    productName: string

    Wire product_name label.

    • get derogationEndDate(): Temporal.ZonedDateTime | null

      When the running derogation (boost, vacation, presence countdown) ends, or null when none is running or the deadline has passed. The wire carries the derogation's duration but not its start, so the end is derived when a change is observed. A derogation already running when the SDK first sees the device therefore stays null until it changes — a persistent client can bridge the gap by retaining the last end it observed.

      Returns Temporal.ZonedDateTime | null

      The derogation end date, or null.

    • Merge a fresh (possibly partial) attribute payload into the model and derive the transition state (previous mode, derogation end). Explicit-undefined keys are dropped — a tolerant caller payload cannot erase known state.

      Parameters

      Returns void