Heatzy API for Node.js - v21.3.1
    Preparing search index...

    Interface HeatzyAPIAdapter

    The API surface facades depend on — a structural slice of HeatzyAPI that keeps the facade layer decoupled from the client's lifecycle machinery (and trivially mockable in tests). It names exactly what a facade reads — the display locale, the sync notification and the two device endpoints — and nothing a facade does not: HeatzyAPI.fetch and HeatzyAPI.timezone stay public on the client alone, the timezone reaching every Device through the DeviceRegistry at construction.

    interface HeatzyAPIAdapter {
        getDeviceById: (id: string) => Device | undefined;
        getValues: (__namedParameters: { id: string }) => Promise<Attributes>;
        locale: string | undefined;
        notifySync: SyncCallback;
        updateValues: (
            __namedParameters: { id: string; postData: DevicePostDataAny },
        ) => Promise<void>;
    }

    Implemented by

    Index
    getDeviceById: (id: string) => Device | undefined

    Resolve a device against the LIVE registry by its Gizwits id.

    Facades bind by id rather than by entity reference: the registry prunes and rebuilds its entries on every sync and on a sign-out, so a facade holding the object would keep reading a detached copy forever once that happened.

    getValues: (__namedParameters: { id: string }) => Promise<Attributes>

    Read the live attribute payload of a single device.

    locale: string | undefined

    BCP-47 locale tag the instance was configured with (HeatzyAPIConfig.locale), or undefined when unset. Facades use it to render derogationEndString labels without a mutable global locale.

    notifySync: SyncCallback

    Notify any registered events.onSyncComplete observer that a sync just landed. Routed through the lifecycle emitter so a misbehaving observer cannot break the caller.

    updateValues: (
        __namedParameters: { id: string; postData: DevicePostDataAny },
    ) => Promise<void>

    Send a control payload to a single device.