Table of Contents

Class AppVersionDiscovery

Namespace
PanasonicComfortCloudClient
Assembly
PanasonicComfortCloudClient.dll

Finds the Android app version using the Python reference's Play Store, AppBrain and optional gist sources.

public sealed class AppVersionDiscovery : IDisposable
Inheritance
AppVersionDiscovery
Implements
Inherited Members

Remarks

This explicitly created helper owns an in-memory two-day cache only. It never retries device commands or changes a cloud client's protocol version implicitly.

Constructors

AppVersionDiscovery(HttpClient?, AppVersionObservation?)

Creates an explicit version-discovery helper.

public AppVersionDiscovery(HttpClient? httpClient = null, AppVersionObservation? initialObservation = null)

Parameters

httpClient HttpClient

An optional caller-owned HTTP client whose redirects are disabled.

initialObservation AppVersionObservation

An optional application-restored version observation; storage remains application-owned.

Properties

Current

Gets the most recent successful version observation.

public AppVersionObservation? Current { get; }

Property Value

AppVersionObservation

The application version, source and observation time, or null before discovery.

Methods

Dispose()

Disposes this helper, retaining ownership of an injected client with its caller.

public void Dispose()

GetAsync(CancellationToken)

Returns the cached observation if younger than two days; otherwise refreshes it.

public Task<AppVersionObservation> GetAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancels waiting or retrieval.

Returns

Task<AppVersionObservation>

The current version observation.

ReadCommunityGistAsync(CancellationToken)

Explicitly reads the reference's community-maintained gist source.

public Task<AppVersionObservation> ReadCommunityGistAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancels waiting or retrieval.

Returns

Task<AppVersionObservation>

The validated gist observation. This source is not selected implicitly.

RefreshAsync(CancellationToken)

Explicitly refreshes from Play Store, falling back to AppBrain.

public Task<AppVersionObservation> RefreshAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancels waiting or retrieval.

Returns

Task<AppVersionObservation>

The new observation; failure retains the old cache and is reported.