Table of Contents

Class AcController

Namespace
PanasonicComfortCloudClient
Assembly
PanasonicComfortCloudClient.dll

Owns upstream-style preference buffering for one AC when automatic power-on is disabled.

public sealed class AcController : IDisposable
Inheritance
AcController
Implements
Inherited Members

Constructors

AcController(ComfortCloudClient, string, bool)

Owns upstream-style preference buffering for one AC when automatic power-on is disabled.

public AcController(ComfortCloudClient client, string deviceGuid, bool autoPowerOn = true)

Parameters

client ComfortCloudClient

The application-owned cloud client.

deviceGuid string

The AC whose queued settings this controller owns.

autoPowerOn bool

Whether to use immediate upstream-style command submission; false buffers preferences while off.

Properties

HasPendingChanges

Gets whether this controller retains preferences for the next explicit power-on.

public bool HasPendingChanges { get; }

Property Value

bool

True when preferences are buffered; no files or automatic writes are created.

Methods

ApplyAsync(AcSnapshot, AcUpdate, CancellationToken)

Applies or buffers changes based on the explicitly supplied current device state.

public Task<bool> ApplyAsync(AcSnapshot snapshot, AcUpdate changes, CancellationToken cancellationToken = default)

Parameters

snapshot AcSnapshot

The current snapshot of this controller's device.

changes AcUpdate

The intended settings, including explicit power-on when buffered settings should be submitted.

cancellationToken CancellationToken

Cancels waiting or submission.

Returns

Task<bool>

True if a command was acknowledged; false if it was buffered.

Remarks

Queued preferences are consumed before a write attempt, so a lost acknowledgement never causes them to be replayed automatically.

CreateChangeRequest(AcSnapshot)

Creates a builder with this controller's power policy.

public AcCommandBuilder CreateChangeRequest(AcSnapshot snapshot)

Parameters

snapshot AcSnapshot

The recent device snapshot used for swing and power decisions.

Returns

AcCommandBuilder

A new independent command builder.

Dispose()

Discards queued preferences and cancels this controller's pending operations without disposing the shared client.

public void Dispose()