예제 #1
0
        /// <inheritdoc />
        public async Task <ILifxWifiInfo> GetWifiInfo(bool forceRefresh = false, int?timeoutMs = null, CancellationToken cancellationToken = default)
        {
            if (!forceRefresh && this.wifiInfo != null)
            {
                return(this.wifiInfo);
            }

            Messages.GetWifiInfo getWifiInfo = new Messages.GetWifiInfo();

            Messages.StateWifiInfo wifiInfo = await this.Lifx.SendWithResponse <Messages.StateWifiInfo>(this, getWifiInfo, timeoutMs, cancellationToken);

            this.wifiInfo = wifiInfo;

            return(wifiInfo);
        }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StateWifiInfo"/> class.
 /// </summary>
 /// <param name="wifiInfo">The <see cref="ILifxWifiInfo"/> to initialize this message from.</param>
 public StateWifiInfo(ILifxWifiInfo wifiInfo) : this()
 {
     this.Signal           = wifiInfo.Signal;
     this.TransmittedBytes = wifiInfo.TransmittedBytes;
     this.ReceivedBytes    = wifiInfo.ReceivedBytes;
 }