/// <inheritdoc /> public async Task <ILifxInfo> GetInfo(bool forceRefresh = false, int?timeoutMs = null, CancellationToken cancellationToken = default) { if (!forceRefresh && this.info != null) { return(this.info); } Messages.GetInfo getInfo = new Messages.GetInfo(); Messages.StateInfo info = await this.Lifx.SendWithResponse <Messages.StateInfo>(this, getInfo, timeoutMs, cancellationToken); this.info = info; return(info); }
/// <summary> /// Initializes a new instance of the <see cref="StateInfo"/> class. /// </summary> /// <param name="info">The <see cref="ILifxInfo"/> to initialize this message from.</param> public StateInfo(ILifxInfo info) : this() { this.Time = info.Time; this.Uptime = info.Uptime; this.Downtime = info.Downtime; }