Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LifxDevice"/> class.
        /// </summary>
        /// <param name="lifx">The <c>LifxNetwork</c> the device belongs to.</param>
        /// <param name="macAddress">The MAC address of the device.</param>
        /// <param name="endPoint">The <c>IPEndPoint</c> of the device.</param>
        /// <param name="version">The version of the device.</param>
        protected internal LifxDevice(LifxNetwork lifx, MacAddress macAddress, IPEndPoint endPoint, ILifxVersion version)
        {
            this.Lifx       = lifx;
            this.MacAddress = macAddress;
            this.EndPoint   = endPoint;

            this.version = version;

            this.LastSeen = DateTime.MinValue;

            // Get product features
            ILifxProduct features = LifxNetwork.GetFeaturesForProduct(version);

            this.VendorName  = features.VendorName;
            this.ProductName = features.ProductName;

            this.SupportsColor    = features.SupportsColor;
            this.SupportsInfrared = features.SupportsInfrared;

            this.IsMultizone = features.IsMultizone;
            this.IsChain     = features.IsChain;
            this.IsMatrix    = features.IsMatrix;

            this.MinKelvin = features.MinKelvin;
            this.MaxKelvin = features.MaxKelvin;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LifxVirtualDevice"/> class.
        /// </summary>
        /// <param name="lifx">The <see cref="LifxNetwork"/> to associated this virtual device with.</param>
        /// <param name="macAddress">The <see cref="MacAddress"/> of this virtual device.</param>
        protected LifxVirtualDevice(LifxNetwork lifx, MacAddress macAddress)
        {
            if (lifx is null)
            {
                throw new ArgumentNullException(nameof(lifx));
            }

            if (macAddress is null)
            {
                throw new ArgumentNullException(nameof(macAddress));
            }

            // Init fields that require access to virtual device
            this.info    = new LifxInfo(this);
            this.version = new LifxVersion(this);

            this.Lifx       = lifx;
            this.MacAddress = macAddress;

            this.Lifx.RegisterVirtualDevice(this);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LifxVirtualMultizoneLight"/> class.
 /// </summary>
 /// <param name="lifx">The <see cref="LifxNetwork"/> to associated this virtual device with.</param>
 /// <param name="macAddress">The <see cref="MacAddress"/> of this virtual device.</param>
 public LifxVirtualMultizoneLight(LifxNetwork lifx, MacAddress macAddress) : base(lifx, macAddress)
 {
     // Empty
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LifxDeviceLostEventArgs"/> class.
 /// </summary>
 /// <param name="macAddress">The <see cref="Lifx.MacAddress"/> of the lost device.</param>
 internal LifxDeviceLostEventArgs(MacAddress macAddress)
 {
     this.MacAddress = macAddress;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LifxVirtualInfraredLight"/> class.
 /// </summary>
 /// <param name="lifx">The <see cref="LifxNetwork"/> to associated this virtual light with.</param>
 /// <param name="macAddress">The <see cref="MacAddress"/> of this virtual light.</param>
 public LifxVirtualInfraredLight(LifxNetwork lifx, MacAddress macAddress) : base(lifx, macAddress)
 {
     // Empty
 }
 /// <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
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LifxInfraredLight"/> 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>
 protected internal LifxInfraredLight(LifxNetwork lifx, MacAddress macAddress, IPEndPoint endPoint, ILifxVersion version) : base(lifx, macAddress, endPoint, version)
 {
     // Empty
 }
Exemplo n.º 8
0
 /// <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);
 }