mysa-js-sdk
    Preparing search index...

    Function buildShadowStateUpdate

    • Builds the body of a shadow state update that applies a setpoint and/or an operating mode.

      Heating-only devices keep their setpoint in targetHeat. Devices that can cool keep it in targetCool while cooling, so the section is picked from the requested mode, or from the device's current mode when only a setpoint is being changed.

      Parameters

      • device: DeviceBase

        The device the update is aimed at.

      • setPoint: number | undefined

        The setpoint to apply, in degrees Celsius, or undefined to leave it unchanged.

      • mode: MysaDeviceMode | undefined

        The operating mode to apply, or undefined to leave it unchanged.

      • OptionalcurrentMode: MysaDeviceMode

        The device's current mode, used to pick the setpoint section when mode is undefined.

      Returns ShadowStateUpdate | undefined

      The update body, or undefined when there is nothing to change.