Exemple #1
0
        /// <inheritdoc />
        public async Task <ILifxHostFirmware> GetHostFirmware(bool forceRefresh = false, int?timeoutMs = null, CancellationToken cancellationToken = default)
        {
            if (!forceRefresh && this.hostFirmware != null)
            {
                return(this.hostFirmware);
            }

            Messages.GetHostFirmware getHostFirmware = new Messages.GetHostFirmware();

            Messages.StateHostFirmware hostFirmware = await this.Lifx.SendWithResponse <Messages.StateHostFirmware>(this, getHostFirmware, timeoutMs, cancellationToken);

            this.hostFirmware = hostFirmware;

            return(hostFirmware);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="StateHostFirmware"/> class.
 /// </summary>
 /// <param name="hostFirmware">The <see cref="ILifxHostFirmware"/> to initialize this message from.</param>
 public StateHostFirmware(ILifxHostFirmware hostFirmware) : this()
 {
     this.Build        = hostFirmware.Build;
     this.VersionMinor = hostFirmware.VersionMinor;
     this.VersionMajor = hostFirmware.VersionMajor;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LifxStandardMultizoneLight"/> class.
 /// </summary>
 /// <param name="lifx">The <see cref="LifxNetwork"/> that the device belongs to.</param>
 /// <param name="macAddress">The <see cref="MacAddress"/> of the device.</param>
 /// <param name="endPoint">The <see cref="IPEndPoint"/> of the device.</param>
 /// <param name="version">The <see cref="ILifxVersion"/> of the device.</param>
 /// <param name="hostFirmware">The <see cref="ILifxHostFirmware"/> of the device.</param>
 protected internal LifxStandardMultizoneLight(LifxNetwork lifx, MacAddress macAddress, IPEndPoint endPoint, ILifxVersion version, ILifxHostFirmware hostFirmware) : base(lifx, macAddress, endPoint, version, hostFirmware)
 {
     // Empty
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LifxMultizoneLight"/> class.
 /// </summary>
 /// <param name="lifx">The <see cref="LifxNetwork"/> that the device belongs to.</param>
 /// <param name="macAddress">The <see cref="MacAddress"/> of the device.</param>
 /// <param name="endPoint">The <see cref="IPEndPoint"/> of the device.</param>
 /// <param name="version">The <see cref="ILifxVersion"/> of the device.</param>
 /// <param name="hostFirmware">The <see cref="ILifxHostFirmware"/> of the device.</param>
 protected internal LifxMultizoneLight(LifxNetwork lifx, MacAddress macAddress, IPEndPoint endPoint, ILifxVersion version, ILifxHostFirmware hostFirmware) : base(lifx, macAddress, endPoint, version)
 {
     this.SetHostFirmwareCachedValue(hostFirmware);
 }
Exemple #5
0
 /// <summary>
 /// Sets the internal cached value for host firmware. Used when different firmware versions have different APIs.
 /// </summary>
 /// <param name="hostFirmware">The host firmware for the device.</param>
 protected void SetHostFirmwareCachedValue(ILifxHostFirmware hostFirmware)
 {
     this.hostFirmware = hostFirmware;
 }